123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902 |
- /*******************************************************************************
- * OpenAjax-mashup.js
- *
- * Reference implementation of the OpenAjax Hub, as specified by OpenAjax Alliance.
- * Specification is under development at:
- *
- * http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification
- *
- * 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.
- *
- ******************************************************************************/
- var OpenAjax=OpenAjax||{};
- OpenAjax.hub||(OpenAjax.hub=function(){var h={};return{implementer:"http://openajax.org",implVersion:"2.0.4",specVersion:"2.0",implExtraData:{},libraries:h,registerLibrary:function(k,n,a,b){h[k]={prefix:k,namespaceURI:n,version:a,extraData:b};this.publish("org.openajax.hub.registerLibrary",h[k])},unregisterLibrary:function(k){this.publish("org.openajax.hub.unregisterLibrary",h[k]);delete h[k]}}}(),OpenAjax.hub.Error={BadParameters:"OpenAjax.hub.Error.BadParameters",Disconnected:"OpenAjax.hub.Error.Disconnected",Duplicate:"OpenAjax.hub.Error.Duplicate",
- NoContainer:"OpenAjax.hub.Error.NoContainer",NoSubscription:"OpenAjax.hub.Error.NoSubscription",NotAllowed:"OpenAjax.hub.Error.NotAllowed",WrongProtocol:"OpenAjax.hub.Error.WrongProtocol",IncompatBrowser:"OpenAjax.hub.Error.IncompatBrowser"},OpenAjax.hub.SecurityAlert={LoadTimeout:"OpenAjax.hub.SecurityAlert.LoadTimeout",FramePhish:"OpenAjax.hub.SecurityAlert.FramePhish",ForgedMsg:"OpenAjax.hub.SecurityAlert.ForgedMsg"},OpenAjax.hub._debugger=function(){},OpenAjax.hub.ManagedHub=function(h){if(!h||
- !h.onPublish||!h.onSubscribe)throw Error(OpenAjax.hub.Error.BadParameters);this._p=h;this._onUnsubscribe=h.onUnsubscribe?h.onUnsubscribe:null;this._scope=h.scope||window;if(h.log){var k=this;this._log=function(n){try{h.log.call(k._scope,"ManagedHub: "+n)}catch(a){OpenAjax.hub._debugger()}}}else this._log=function(){};this._subscriptions={c:{},s:null};this._containers={};this._seq=0;this._active=!0;this._isPublishing=!1;this._pubQ=[]},OpenAjax.hub.ManagedHub.prototype.subscribeForClient=function(h,
- k,n){this._assertConn();if(this._invokeOnSubscribe(k,h))return this._subscribe(k,this._sendToClient,this,{c:h,sid:n});throw Error(OpenAjax.hub.Error.NotAllowed);},OpenAjax.hub.ManagedHub.prototype.unsubscribeForClient=function(h,k){this._unsubscribe(k);this._invokeOnUnsubscribe(h,k)},OpenAjax.hub.ManagedHub.prototype.publishForClient=function(h,k,n){this._assertConn();this._publish(k,n,h)},OpenAjax.hub.ManagedHub.prototype.disconnect=function(){this._active=!1;for(var h in this._containers)this.removeContainer(this._containers[h])},
- OpenAjax.hub.ManagedHub.prototype.getContainer=function(h){return(h=this._containers[h])?h:null},OpenAjax.hub.ManagedHub.prototype.listContainers=function(){var h=[],k;for(k in this._containers)h.push(this._containers[k]);return h},OpenAjax.hub.ManagedHub.prototype.addContainer=function(h){this._assertConn();var k=h.getClientID();if(this._containers[k])throw Error(OpenAjax.hub.Error.Duplicate);this._containers[k]=h},OpenAjax.hub.ManagedHub.prototype.removeContainer=function(h){var k=h.getClientID();
- if(!this._containers[k])throw Error(OpenAjax.hub.Error.NoContainer);h.remove();delete this._containers[k]},OpenAjax.hub.ManagedHub.prototype.subscribe=function(h,k,n,a,b){function c(a,c,g,m){if(d._invokeOnPublish(a,c,m,null))try{k.call(n,a,c,b)}catch(p){OpenAjax.hub._debugger(),d._log("caught error from onData callback to Hub.subscribe(): "+p.message)}}this._assertConn();this._assertSubTopic(h);if(!k)throw Error(OpenAjax.hub.Error.BadParameters);n=n||window;if(this._invokeOnSubscribe(h,null)){var d=
- this,h=this._subscribe(h,c,n,b);this._invokeOnComplete(a,n,h,!0);return h}this._invokeOnComplete(a,n,null,!1,OpenAjax.hub.Error.NotAllowed)},OpenAjax.hub.ManagedHub.prototype.publish=function(h,k){this._assertConn();this._assertPubTopic(h);this._publish(h,k,null)},OpenAjax.hub.ManagedHub.prototype.unsubscribe=function(h,k,n){this._assertConn();if(!h)throw Error(OpenAjax.hub.Error.BadParameters);this._unsubscribe(h);this._invokeOnUnsubscribe(null,h);this._invokeOnComplete(k,n,h,!0)},OpenAjax.hub.ManagedHub.prototype.isConnected=
- function(){return this._active},OpenAjax.hub.ManagedHub.prototype.getScope=function(){return this._scope},OpenAjax.hub.ManagedHub.prototype.getSubscriberData=function(h){this._assertConn();var h=h.split("."),k=h.pop();if(h=this._getSubscriptionObject(this._subscriptions,h,0,k))return h.data;throw Error(OpenAjax.hub.Error.NoSubscription);},OpenAjax.hub.ManagedHub.prototype.getSubscriberScope=function(h){this._assertConn();var h=h.split("."),k=h.pop();if(h=this._getSubscriptionObject(this._subscriptions,
- h,0,k))return h.scope;throw Error(OpenAjax.hub.Error.NoSubscription);},OpenAjax.hub.ManagedHub.prototype.getParameters=function(){return this._p},OpenAjax.hub.ManagedHub.prototype._sendToClient=function(h,k,n,a){this.isConnected()&&this._invokeOnPublish(h,k,a,n.c)&&n.c.sendToClient(h,k,n.sid)},OpenAjax.hub.ManagedHub.prototype._assertConn=function(){if(!this.isConnected())throw Error(OpenAjax.hub.Error.Disconnected);},OpenAjax.hub.ManagedHub.prototype._assertPubTopic=function(h){if(!h||""===h||-1!=
- h.indexOf("*")||-1!=h.indexOf("..")||"."==h.charAt(0)||"."==h.charAt(h.length-1))throw Error(OpenAjax.hub.Error.BadParameters);},OpenAjax.hub.ManagedHub.prototype._assertSubTopic=function(h){if(!h)throw Error(OpenAjax.hub.Error.BadParameters);for(var h=h.split("."),k=h.length,n=0;n<k;n++){var a=h[n];if(""===a||-1!=a.indexOf("*")&&"*"!=a&&"**"!=a)throw Error(OpenAjax.hub.Error.BadParameters);if("**"==a&&n<k-1)throw Error(OpenAjax.hub.Error.BadParameters);}},OpenAjax.hub.ManagedHub.prototype._invokeOnComplete=
- function(h,k,n,a,b){if(h)try{k=k||window,h.call(k,n,a,b)}catch(c){OpenAjax.hub._debugger(),this._log("caught error from onComplete callback: "+c.message)}},OpenAjax.hub.ManagedHub.prototype._invokeOnPublish=function(h,k,n,a){try{return this._p.onPublish.call(this._scope,h,k,n,a)}catch(b){OpenAjax.hub._debugger(),this._log("caught error from onPublish callback to constructor: "+b.message)}return!1},OpenAjax.hub.ManagedHub.prototype._invokeOnSubscribe=function(h,k){try{return this._p.onSubscribe.call(this._scope,
- h,k)}catch(n){OpenAjax.hub._debugger(),this._log("caught error from onSubscribe callback to constructor: "+n.message)}return!1},OpenAjax.hub.ManagedHub.prototype._invokeOnUnsubscribe=function(h,k){if(this._onUnsubscribe){var n=k.slice(0,k.lastIndexOf("."));try{this._onUnsubscribe.call(this._scope,n,h)}catch(a){OpenAjax.hub._debugger(),this._log("caught error from onUnsubscribe callback to constructor: "+a.message)}}},OpenAjax.hub.ManagedHub.prototype._subscribe=function(h,k,n,a){var b=h+"."+this._seq,
- k={scope:n,cb:k,data:a,sid:this._seq++},h=h.split(".");this._recursiveSubscribe(this._subscriptions,h,0,k);return b},OpenAjax.hub.ManagedHub.prototype._recursiveSubscribe=function(h,k,n,a){var b=k[n];n==k.length?(a.next=h.s,h.s=a):("undefined"==typeof h.c&&(h.c={}),"undefined"==typeof h.c[b]&&(h.c[b]={c:{},s:null}),this._recursiveSubscribe(h.c[b],k,n+1,a))},OpenAjax.hub.ManagedHub.prototype._publish=function(h,k,n){if(this._isPublishing)this._pubQ.push({t:h,d:k,p:n});else for(this._safePublish(h,
- k,n);0<this._pubQ.length;)h=this._pubQ.shift(),this._safePublish(h.t,h.d,h.p)},OpenAjax.hub.ManagedHub.prototype._safePublish=function(h,k,n){this._isPublishing=!0;var a=h.split(".");this._recursivePublish(this._subscriptions,a,0,h,k,n);this._isPublishing=!1},OpenAjax.hub.ManagedHub.prototype._recursivePublish=function(h,k,n,a,b,c){if("undefined"!=typeof h&&(n!=k.length&&(this._recursivePublish(h.c[k[n]],k,n+1,a,b,c),this._recursivePublish(h.c["*"],k,n+1,a,b,c),h=h.c["**"]),"undefined"!=typeof h))for(h=
- h.s;h;){var k=h.scope,n=h.cb,d=h.data;"string"==typeof n&&(n=k[n]);n.call(k,a,b,d,c);h=h.next}},OpenAjax.hub.ManagedHub.prototype._unsubscribe=function(h){var h=h.split("."),k=h.pop();if(!this._recursiveUnsubscribe(this._subscriptions,h,0,k))throw Error(OpenAjax.hub.Error.NoSubscription);},OpenAjax.hub.ManagedHub.prototype._recursiveUnsubscribe=function(h,k,n,a){if("undefined"==typeof h)return!1;if(n<k.length){var b=h.c[k[n]];if(!b)return!1;this._recursiveUnsubscribe(b,k,n+1,a);if(!b.s){for(var c in b.c)return!0;
- delete h.c[k[n]]}}else{k=h.s;n=null;for(b=!1;k;){if(a==k.sid){b=!0;k==h.s?h.s=k.next:n.next=k.next;break}n=k;k=k.next}if(!b)return!1}return!0},OpenAjax.hub.ManagedHub.prototype._getSubscriptionObject=function(h,k,n,a){if("undefined"!=typeof h){if(n<k.length)return this._getSubscriptionObject(h.c[k[n]],k,n+1,a);for(h=h.s;h;){if(a==h.sid)return h;h=h.next}}return null},OpenAjax.hub._hub=new OpenAjax.hub.ManagedHub({onSubscribe:function(){return!0},onPublish:function(){return!0}}),OpenAjax.hub.subscribe=
- function(h,k,n,a){"string"===typeof k&&(n=n||window,k=n[k]||null);return OpenAjax.hub._hub.subscribe(h,k,n,null,a)},OpenAjax.hub.unsubscribe=function(h){return OpenAjax.hub._hub.unsubscribe(h)},OpenAjax.hub.publish=function(h,k){OpenAjax.hub._hub.publish(h,k)},OpenAjax.hub.registerLibrary("OpenAjax","http://openajax.org/hub","2.0",{}));
- OpenAjax.hub.InlineContainer=function(h,k,n){function a(a,b,c,d,e){if(a)try{b=b||window,a.call(b,c,d,e)}catch(f){OpenAjax.hub._debugger(),p._log("caught error from onComplete callback: "+f.message)}}function b(){for(var a in g)h.unsubscribeForClient(this,g[a].h);g=[];m=0;f=!1}function c(){if(!f)throw Error(OpenAjax.hub.Error.Disconnected);}function d(a){if(a=g[a])return a;throw Error(OpenAjax.hub.Error.NoSubscription);}if(!h||!k||!n||!n.Container||!n.Container.onSecurityAlert)throw Error(OpenAjax.hub.Error.BadParameters);
- var e=n.Container.scope||window,f=!1,g=[],m=0,p=null,u=n.Container.log?function(a){try{n.Container.log.call(e,"InlineContainer::"+k+": "+a)}catch(b){OpenAjax.hub._debugger()}}:function(){};this._init=function(){h.addContainer(this)};this.getHub=function(){return h};this.sendToClient=function(a,b,c){if(f){c=g[c];try{c.cb.call(c.sc,a,b,c.d)}catch(d){OpenAjax.hub._debugger(),p._log("caught error from onData callback to HubClient.subscribe(): "+d.message)}}};this.remove=function(){f&&b()};this.isConnected=
- function(){return f};this.getClientID=function(){return k};this.getPartnerOrigin=function(){return f?window.location.protocol+"//"+window.location.hostname:null};this.getParameters=function(){return n};this.connect=function(b,c,d){if(f)throw Error(OpenAjax.hub.Error.Duplicate);f=!0;p=b;if(n.Container.onConnect)try{n.Container.onConnect.call(e,this)}catch(g){OpenAjax.hub._debugger(),u("caught error from onConnect callback to constructor: "+g.message)}a(c,d,b,!0)};this.disconnect=function(c,d,g){if(!f)throw Error(OpenAjax.hub.Error.Disconnected);
- b();if(n.Container.onDisconnect)try{n.Container.onDisconnect.call(e,this)}catch(m){OpenAjax.hub._debugger(),u("caught error from onDisconnect callback to constructor: "+m.message)}a(d,g,c,!0)};this.subscribe=function(b,d,e,f,p){c();if(!b)throw Error(OpenAjax.hub.Error.BadParameters);for(var u=b.split("."),k=u.length,n=0;n<k;n++){var A=u[n];if(""===A||-1!=A.indexOf("*")&&"*"!=A&&"**"!=A)throw Error(OpenAjax.hub.Error.BadParameters);if("**"==A&&n<k-1)throw Error(OpenAjax.hub.Error.BadParameters);}if(!d)throw Error(OpenAjax.hub.Error.BadParameters);
- u=""+m++;k=!1;n=null;try{var z=h.subscribeForClient(this,b,u),k=!0}catch(C){u=null,n=C.message}e=e||window;k&&(g[u]={h:z,cb:d,sc:e,d:p});a(f,e,u,k,n);return u};this.publish=function(a,b){c();if(null==a||""===a||-1!=a.indexOf("*")||-1!=a.indexOf("..")||"."==a.charAt(0)||"."==a.charAt(a.length-1))throw Error(OpenAjax.hub.Error.BadParameters);h.publishForClient(this,a,b)};this.unsubscribe=function(b,d,e){c();if("undefined"===typeof b||null===b)throw Error(OpenAjax.hub.Error.BadParameters);var f=g[b];
- if(!f)throw Error(OpenAjax.hub.Error.NoSubscription);h.unsubscribeForClient(this,f.h);delete g[b];a(d,e,b,!0)};this.getSubscriberData=function(a){c();return d(a).d};this.getSubscriberScope=function(a){c();return d(a).sc};this._init()};
- OpenAjax.hub.InlineHubClient=function(h){if(!h||!h.HubClient||!h.HubClient.onSecurityAlert||!h.InlineHubClient||!h.InlineHubClient.container)throw Error(OpenAjax.hub.Error.BadParameters);var k=h.InlineHubClient.container,n=h.HubClient.scope||window;this._log=h.HubClient.log?function(a){try{h.HubClient.log.call(n,"InlineHubClient::"+k.getClientID()+": "+a)}catch(b){OpenAjax.hub._debugger()}}:function(){};this.connect=function(a,b){k.connect(this,a,b)};this.disconnect=function(a,b){k.disconnect(this,
- a,b)};this.getPartnerOrigin=function(){return k.getPartnerOrigin()};this.getClientID=function(){return k.getClientID()};this.subscribe=function(a,b,c,d,e){return k.subscribe(a,b,c,d,e)};this.publish=function(a,b){k.publish(a,b)};this.unsubscribe=function(a,b,c){k.unsubscribe(a,b,c)};this.isConnected=function(){return k.isConnected()};this.getScope=function(){return n};this.getSubscriberData=function(a){return k.getSubscriberData(a)};this.getSubscriberScope=function(a){return k.getSubscriberScope(a)};
- this.getParameters=function(){return h}};OpenAjax=OpenAjax||{};OpenAjax.hub=OpenAjax.hub||{};OpenAjax.gadgets="object"===typeof OpenAjax.gadgets?OpenAjax.gadgets:"object"===typeof gadgets?gadgets:{};OpenAjax.gadgets.rpctx=OpenAjax.gadgets.rpctx||{};
- (function(){if("undefined"===typeof gadgets){if("undefined"===typeof oaaConfig)for(var h=document.getElementsByTagName("script"),k=/openajax(?:managedhub-(?:all|core).*|-mashup)\.js$/i,n=h.length-1;0<=n;n--){var a=h[n].getAttribute("src");if(a&&a.match(k)){if(h=h[n].getAttribute("oaaConfig"))try{oaaConfig=eval("({ "+h+" })")}catch(b){}break}}"undefined"!==typeof oaaConfig&&oaaConfig.gadgetsGlobal&&(gadgets=OpenAjax.gadgets)}})();
- OpenAjax.hub.IframeContainer||function(){OpenAjax.hub.IframeContainer=function(b,c,d){function e(){if(h){h=!1;document.getElementById(r).style.visibility="hidden";for(var a in k)b.unsubscribeForClient(u,k[a]);k={}}}function f(a){try{d.Container.onSecurityAlert.call(y,u,a)}catch(b){OpenAjax.hub._debugger(),x("caught error from onSecurityAlert callback to constructor: "+b.message)}}function g(){v=setTimeout(function(){f(OpenAjax.hub.SecurityAlert.LoadTimeout);u._handleIncomingRPC=function(){}},w)}var m=
- arguments[1],p=arguments[2];if(!arguments[0]||!m||!p||!p.Container||!p.Container.onSecurityAlert||!p.IframeContainer||!p.IframeContainer.parent||!p.IframeContainer.uri)throw Error(OpenAjax.hub.Error.BadParameters);var u=this,y=d.Container.scope||window,h=!1,k={},n,r,w=d.IframeContainer.timeout||15E3,v,x=d.Container.log?function(a){try{d.Container.log.call(y,"IframeContainer::"+c+": "+a)}catch(b){OpenAjax.hub._debugger()}}:function(){};this._init=function(){b.addContainer(this);r=OpenAjax.hub.IframeContainer._rpcRouter.add(c,
- this);var a=d,e=y,f=x;if(!OpenAjax.hub.IframeContainer._prng){var m=(new Date).getTime()+Math.random()+document.cookie;OpenAjax.hub.IframeContainer._prng=OpenAjax._smash.crypto.newPRNG(m)}if((a=a.IframeContainer||a.IframeHubClient)&&a.seed)try{var p=a.seed.call(e);OpenAjax.hub.IframeContainer._prng.addSeed(p)}catch(u){OpenAjax.hub._debugger(),f("caught error from 'seed' callback: "+u.message)}n=OpenAjax.hub.IframeContainer._prng.nextRandomB64Str(a&&a.tokenLength||6);e=null;f=OpenAjax.gadgets.rpc.getRelayChannel();
- if(d.IframeContainer.tunnelURI){if("wpm"!==f&&"nix"!==f)throw Error(OpenAjax.hub.Error.IncompatBrowser);}else x("WARNING: Parameter 'IframeContaienr.tunnelURI' not specified. Connection will not be fully secure."),"rmr"===f&&(e=OpenAjax.gadgets.rpc.getOrigin(d.IframeContainer.uri)+"/robots.txt");f=document.createElement("span");d.IframeContainer.parent.appendChild(f);p='<iframe id="'+r+'" name="'+r+'" src="javascript:\'<html></html>\'"';a="";if(m=d.IframeContainer.iframeAttrs)for(var h in m)switch(h){case "style":for(var k in m.style)a+=
- k+":"+m.style[k]+";";break;case "className":p+=' class="'+m[h]+'"';break;default:p+=" "+h+'="'+m[h]+'"'}p+=' style="'+(a+"visibility:hidden;")+'"></iframe>';f.innerHTML=p;h=d.IframeContainer.tunnelURI;document.getElementById(r).src=d.IframeContainer.uri+"#rpctoken="+n+(h?"&parent="+encodeURIComponent(h)+"&forcesecure=true":"&oaaParent="+encodeURIComponent(OpenAjax.gadgets.rpc.getOrigin(window.location.href)));OpenAjax.gadgets.rpc.setupReceiver(r,e);g()};this.sendToClient=function(a,b,c){OpenAjax.gadgets.rpc.call(r,
- "openajax.pubsub",null,"pub",a,b,c)};this.remove=function(){e();clearTimeout(v);OpenAjax.gadgets.rpc.removeReceiver(r);var a=document.getElementById(r);a.parentNode.removeChild(a);OpenAjax.hub.IframeContainer._rpcRouter.remove(r)};this.isConnected=function(){return h};this.getClientID=function(){return c};this.getPartnerOrigin=function(){if(h){var a=OpenAjax.gadgets.rpc.getReceiverOrigin(r);if(a)return/^([a-zA-Z]+:\/\/[^:]+).*/.exec(a)[1]}return null};this.getParameters=function(){return d};this.getHub=
- function(){return b};this.getIframe=function(){return document.getElementById(r)};this._handleIncomingRPC=function(a,c,f){switch(a){case "pub":b.publishForClient(u,c,f);break;case "sub":a="";try{k[f]=b.subscribeForClient(u,c,f)}catch(m){a=m.message}return a;case "uns":return b.unsubscribeForClient(u,k[f]),delete k[f],f;case "con":return OpenAjax.gadgets.rpc.call(r,"openajax.pubsub",function(a){if(a&&(h=!0,clearTimeout(v),document.getElementById(r).style.visibility="visible",d.Container.onConnect))try{d.Container.onConnect.call(y,
- u)}catch(b){OpenAjax.hub._debugger(),x("caught error from onConnect callback to constructor: "+b.message)}},"cmd","con"),!0;case "dis":g();e();if(d.Container.onDisconnect)try{d.Container.onDisconnect.call(y,u)}catch(p){OpenAjax.hub._debugger(),x("caught error from onDisconnect callback to constructor: "+p.message)}return!0}};this._onSecurityAlert=function(b){f(a[b])};this._init()};OpenAjax.hub.IframeHubClient=function(a){function c(){if(!f)throw Error(OpenAjax.hub.Error.Disconnected);}if(!a||!a.HubClient||
- !a.HubClient.onSecurityAlert)throw Error(OpenAjax.hub.Error.BadParameters);var d=this,e=a.HubClient.scope||window,f=!1,g={},m=0,p,u=a.HubClient.log?function(c){try{a.HubClient.log.call(e,"IframeHubClient::"+p+": "+c)}catch(d){OpenAjax.hub._debugger()}}:function(){};this._init=function(){var c=OpenAjax.gadgets.util.getUrlParameters();c.parent||OpenAjax.gadgets.rpc.setupReceiver("..",c.oaaParent+"/robots.txt");if(a.IframeHubClient&&a.IframeHubClient.requireParentVerifiable&&null===OpenAjax.gadgets.rpc.getReceiverOrigin(".."))throw OpenAjax.gadgets.rpc.removeReceiver(".."),
- Error(OpenAjax.hub.Error.IncompatBrowser);OpenAjax.hub.IframeContainer._rpcRouter.add("..",this);c=OpenAjax.gadgets.rpc.RPC_ID;if(!c)throw Error(OpenAjax.hub.Error.WrongProtocol);p=c.substr(c.indexOf("_")+1)};this.connect=function(a,b){if(f)throw Error(OpenAjax.hub.Error.Duplicate);OpenAjax.gadgets.rpc.call("..","openajax.pubsub",function(c){if(c&&(f=!0,a))try{a.call(b||window,d,!0)}catch(e){OpenAjax.hub._debugger(),u("caught error from onComplete callback to connect(): "+e.message)}},"con")};this.disconnect=
- function(a,b){if(!f)throw Error(OpenAjax.hub.Error.Disconnected);f=!1;var c=null;a&&(c=function(){try{a.call(b||window,d,!0)}catch(c){OpenAjax.hub._debugger(),u("caught error from onComplete callback to disconnect(): "+c.message)}});OpenAjax.gadgets.rpc.call("..","openajax.pubsub",c,"dis")};this.getPartnerOrigin=function(){if(f){var a=OpenAjax.gadgets.rpc.getReceiverOrigin("..");if(a)return/^([a-zA-Z]+:\/\/[^:]+).*/.exec(a)[1]}return null};this.getClientID=function(){return p};this.subscribe=function(a,
- b,d,e,f){c();if(!a)throw Error(OpenAjax.hub.Error.BadParameters);for(var p=a.split("."),h=p.length,k=0;k<h;k++){var n=p[k];if(""===n||-1!=n.indexOf("*")&&"*"!=n&&"**"!=n)throw Error(OpenAjax.hub.Error.BadParameters);if("**"==n&&k<h-1)throw Error(OpenAjax.hub.Error.BadParameters);}if(!b)throw Error(OpenAjax.hub.Error.BadParameters);var d=d||window,z=""+m++;g[z]={cb:b,sc:d,d:f};OpenAjax.gadgets.rpc.call("..","openajax.pubsub",function(a){""!==a&&delete g[z];if(e)try{e.call(d,z,""===a,a)}catch(b){OpenAjax.hub._debugger(),
- u("caught error from onComplete callback to subscribe(): "+b.message)}},"sub",a,z);return z};this.publish=function(a,b){c();if(!a||""===a||-1!=a.indexOf("*")||-1!=a.indexOf("..")||"."==a.charAt(0)||"."==a.charAt(a.length-1))throw Error(OpenAjax.hub.Error.BadParameters);OpenAjax.gadgets.rpc.call("..","openajax.pubsub",null,"pub",a,b)};this.unsubscribe=function(a,b,d){c();if(!a)throw Error(OpenAjax.hub.Error.BadParameters);if(!g[a]||g[a].uns)throw Error(OpenAjax.hub.Error.NoSubscription);g[a].uns=!0;
- OpenAjax.gadgets.rpc.call("..","openajax.pubsub",function(){delete g[a];if(b)try{b.call(d||window,a,!0)}catch(c){OpenAjax.hub._debugger(),u("caught error from onComplete callback to unsubscribe(): "+c.message)}},"uns",null,a)};this.isConnected=function(){return f};this.getScope=function(){return e};this.getSubscriberData=function(a){c();if(g[a])return g[a].d;throw Error(OpenAjax.hub.Error.NoSubscription);};this.getSubscriberScope=function(a){c();if(g[a])return g[a].sc;throw Error(OpenAjax.hub.Error.NoSubscription);
- };this.getParameters=function(){return a};this._handleIncomingRPC=function(a,b,c,d){if("pub"===a&&g[d]&&!g[d].uns)try{g[d].cb.call(g[d].sc,b,c,g[d].d)}catch(e){OpenAjax.hub._debugger(),u("caught error from onData callback to subscribe(): "+e.message)}return"con"===b?!0:!1};this._init()};var h=function(){var a=n[this.f];if(a)return a._handleIncomingRPC.apply(a,arguments)},k=function(a,c){var d=n[a];d&&d._onSecurityAlert.call(d,c)},n={};OpenAjax.hub.IframeContainer._rpcRouter={add:function(b,c){function d(a,
- b){if(".."===a)n[".."]||(n[".."]=b);else{do newID=(32767*Math.random()|0).toString(16)+"_"+a;while(n[newID]);n[newID]=b;return newID}}OpenAjax.gadgets.rpc.register("openajax.pubsub",h);OpenAjax.gadgets.rpc.config({securityCallback:k});a[OpenAjax.gadgets.rpc.SEC_ERROR_LOAD_TIMEOUT]=OpenAjax.hub.SecurityAlert.LoadTimeout;a[OpenAjax.gadgets.rpc.SEC_ERROR_FRAME_PHISH]=OpenAjax.hub.SecurityAlert.FramePhish;a[OpenAjax.gadgets.rpc.SEC_ERROR_FORGED_MSG]=OpenAjax.hub.SecurityAlert.ForgedMsg;this.add=d;return d(b,
- c)},remove:function(a){delete n[a]}};var a={}}();"undefined"==typeof OpenAjax._smash&&(OpenAjax._smash={});
- OpenAjax._smash.crypto={strToWA:function(h,k){for(var n=[],a=(1<<k)-1,b=0;b<h.length*k;b+=k)n[b>>5]|=(h.charCodeAt(b/k)&a)<<32-k-b%32;return n},hmac_sha1:function(h,k,n){for(var a=Array(16),b=Array(16),c=0;16>c;c++)a[c]=h[c]^909522486,b[c]=h[c]^1549556828;h=this.sha1(a.concat(this.strToWA(k,n)),512+k.length*n);return this.sha1(b.concat(h),672)},newPRNG:function(h){function k(c){for(var c=n.hmac_sha1(a,c,8),e=0;5>e;e++)b[e]^=c[e]}var n=this;("string"!=typeof h||12>h.length)&&alert("WARNING: Seed length too short ...");
- var a=[43417,15926,18182,33130,9585,30800,49772,40144,47678,55453,4659,38181,65340,6787,54417,65301],b=[],c=0;k(h);return{addSeed:function(a){k(a)},nextRandomOctets:function(a){for(var e=[];0<a;){c+=1;for(var f=n.hmac_sha1(b,c.toString(16),8),g=0;20>g&0<a;g++,a--)e.push((f[g>>2]>>g%4)%256)}return e},nextRandomB64Str:function(a){for(var b=this.nextRandomOctets(a),c="",g=0;g<a;g++)c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(b[g]&63);return c}}},sha1:function(){var h=
- function(h,n){var a=(h&65535)+(n&65535);return(h>>16)+(n>>16)+(a>>16)<<16|a&65535};return function(k,n){k[n>>5]|=128<<24-n%32;k[(n+64>>9<<4)+15]=n;for(var a=Array(80),b=1732584193,c=-271733879,d=-1732584194,e=271733878,f=-1009589776,g=0;g<k.length;g+=16){for(var m=b,p=c,u=d,y=e,t=f,q=0;80>q;q++){a[q]=16>q?k[g+q]:(a[q-3]^a[q-8]^a[q-14]^a[q-16])<<1|(a[q-3]^a[q-8]^a[q-14]^a[q-16])>>>31;var s=m<<5|m>>>27,r;r=20>q?p&u|~p&y:40>q?p^u^y:60>q?p&u|p&y|u&y:p^u^y;s=h(h(s,r),h(h(t,a[q]),20>q?1518500249:40>q?1859775393:
- 60>q?-1894007588:-899497514));t=y;y=u;u=p<<30|p>>>2;p=m;m=s}b=h(m,b);c=h(p,c);d=h(u,d);e=h(y,e);f=h(t,f)}return[b,c,d,e,f]}}()};this.JSON||(JSON={});
- (function(){function h(a){return 10>a?"0"+a:a}function k(a){b.lastIndex=0;return b.test(a)?'"'+a.replace(b,function(a){var b=e[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function n(a,b){var e,u,h,t,q=c,s,r=b[a];r&&("object"===typeof r&&"function"===typeof r.toJSON)&&(r=r.toJSON(a));"function"===typeof f&&(r=f.call(b,a,r));switch(typeof r){case "string":return k(r);case "number":return isFinite(r)?String(r):"null";case "boolean":case "null":return String(r);
- case "object":if(!r)return"null";c+=d;s=[];if("[object Array]"===Object.prototype.toString.apply(r)){t=r.length;for(e=0;e<t;e+=1)s[e]=n(e,r)||"null";h=0===s.length?"[]":c?"[\n"+c+s.join(",\n"+c)+"\n"+q+"]":"["+s.join(",")+"]";c=q;return h}if(f&&"object"===typeof f){t=f.length;for(e=0;e<t;e+=1)u=f[e],"string"===typeof u&&(h=n(u,r))&&s.push(k(u)+(c?": ":":")+h)}else for(u in r)Object.hasOwnProperty.call(r,u)&&(h=n(u,r))&&s.push(k(u)+(c?": ":":")+h);h=0===s.length?"{}":c?"{\n"+c+s.join(",\n"+c)+"\n"+
- q+"}":"{"+s.join(",")+"}";c=q;return h}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+h(this.getUTCMonth()+1)+"-"+h(this.getUTCDate())+"T"+h(this.getUTCHours())+":"+h(this.getUTCMinutes())+":"+h(this.getUTCSeconds())+"Z"},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var a=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- b=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,c,d,e={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},f;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,e){var u;d=c="";if("number"===typeof e)for(u=0;u<e;u+=1)d+=" ";else"string"===typeof e&&(d=e);if((f=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return n("",{"":a})});
- "function"!==typeof JSON.parse&&(JSON.parse=function(b,c){function d(a,b){var e,f,g=a[b];if(g&&"object"===typeof g)for(e in g)Object.hasOwnProperty.call(g,e)&&(f=d(g,e),void 0!==f?g[e]=f:delete g[e]);return c.call(a,b,g)}var e;a.lastIndex=0;a.test(b)&&(b=b.replace(a,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,
- "")))return e=eval("("+b+")"),"function"===typeof c?d({"":e},""):e;throw new SyntaxError("JSON.parse");})})();
- OpenAjax.gadgets.util=function(){var h=null,k=[];return{getUrlParameters:function(k){if(null!==h&&"undefined"===typeof k)return h;var a={},b;b=k||document.location.href;var c=b.indexOf("?"),d=b.indexOf("#");b=(-1===d?b.substr(c+1):[b.substr(c+1,d-c-1),"&",b.substr(d+1)].join("")).split("&");for(var c=window.decodeURIComponent?decodeURIComponent:unescape,d=0,e=b.length;d<e;++d){var f=b[d].indexOf("=");if(-1!==f){var g=b[d].substring(0,f),f=b[d].substring(f+1),f=f.replace(/\+/g," ");a[g]=c(f)}}"undefined"===
- typeof k&&(h=a);return a},registerOnLoadHandler:function(h){k.push(h)},runOnLoadHandlers:function(){for(var h=0,a=k.length;h<a;++h)k[h]()},attachBrowserEvent:function(h,a,b,c){h.addEventListener?h.addEventListener(a,b,c):h.attachEvent&&h.attachEvent("on"+a,b)},removeBrowserEvent:function(h,a,b,c){h.removeEventListener?h.removeEventListener(a,b,c):h.detachEvent&&h.detachEvent("on"+a,b)}}}();OpenAjax.gadgets.util.getUrlParameters();OpenAjax.gadgets.json=OpenAjax.gadgets.json||{};
- OpenAjax.gadgets.json.stringify||(OpenAjax.gadgets.json={parse:function(h){try{return"postmessage.test"===h?!1:window.JSON.parse(h)}catch(k){return!1}},stringify:function(h){try{return window.JSON.stringify(h)}catch(k){return null}}});OpenAjax.gadgets.log=function(h){OpenAjax.gadgets.log.logAtLevel(OpenAjax.gadgets.log.INFO,h)};OpenAjax.gadgets.warn=function(h){OpenAjax.gadgets.log.logAtLevel(OpenAjax.gadgets.log.WARNING,h)};
- OpenAjax.gadgets.error=function(h){OpenAjax.gadgets.log.logAtLevel(OpenAjax.gadgets.log.ERROR,h)};OpenAjax.gadgets.setLogLevel=function(h){OpenAjax.gadgets.log.logLevelThreshold_=h};OpenAjax.gadgets.log.logAtLevel=function(h,k){if(!(h<OpenAjax.gadgets.log.logLevelThreshold_)&&OpenAjax.gadgets.log._console){var n=OpenAjax.gadgets.log._console;h==OpenAjax.gadgets.log.WARNING&&n.warn?n.warn(k):h==OpenAjax.gadgets.log.ERROR&&n.error?n.error(k):n.log&&n.log(k)}};OpenAjax.gadgets.log.INFO=1;
- OpenAjax.gadgets.log.WARNING=2;OpenAjax.gadgets.log.ERROR=3;OpenAjax.gadgets.log.NONE=4;OpenAjax.gadgets.log.logLevelThreshold_=OpenAjax.gadgets.log.INFO;OpenAjax.gadgets.log._console=window.console?window.console:window.opera?window.opera.postError:void 0;
- (function(){if(!window.__isgadget){var h=!1,k=function(){h||(h=!0,OpenAjax.gadgets.util.runOnLoadHandlers(),OpenAjax.gadgets.util.registerOnLoadHandler=function(h){setTimeout(h,0)},window.detachEvent&&window.detachEvent("onload",k))};window.addEventListener?(document.addEventListener("DOMContentLoaded",k,!1),window.addEventListener("load",k,!1)):window.attachEvent&&window.attachEvent("onload",k)}})();OpenAjax.gadgets.rpctx=OpenAjax.gadgets.rpctx||{};
- OpenAjax.gadgets.rpctx.frameElement||(OpenAjax.gadgets.rpctx.frameElement=function(){var h,k;return{getCode:function(){return"fe"},isParentVerifiable:function(){return!1},init:function(n,a){h=n;k=a;return!0},setup:function(n){if(".."!==n)try{document.getElementById(n).__g2c_rpc=function(a){h(OpenAjax.gadgets.json.parse(a))}}catch(a){return!1}".."===n&&(k("..",!0),OpenAjax.gadgets.util.registerOnLoadHandler(function(){window.setTimeout(function(){OpenAjax.gadgets.rpc.call(n,OpenAjax.gadgets.rpc.ACK)},
- 500)}));return!0},call:function(k,a,b){try{if(".."!==a){var c=window.frameElement;"function"===typeof c.__g2c_rpc&&("function"!==typeof c.__g2c_rpc.__c2g_rpc&&(c.__g2c_rpc.__c2g_rpc=function(a){h(OpenAjax.gadgets.json.parse(a))}),c.__g2c_rpc(OpenAjax.gadgets.json.stringify(b)))}else{var d=document.getElementById(k);"function"===typeof d.__g2c_rpc&&"function"===typeof d.__g2c_rpc.__c2g_rpc&&d.__g2c_rpc.__c2g_rpc(OpenAjax.gadgets.json.stringify(b))}}catch(e){}}}}());
- OpenAjax.gadgets.rpctx=OpenAjax.gadgets.rpctx||{};
- OpenAjax.gadgets.rpctx.ifpc||(OpenAjax.gadgets.rpctx.ifpc=function(){function h(a){for(var c=[],d=0,e=a.length;d<e;++d)c.push(encodeURIComponent(OpenAjax.gadgets.json.stringify(a[d])));return c.join("&")}var k=[],n=0,a;return{getCode:function(){return"ifpc"},isParentVerifiable:function(){return!0},init:function(b,c){a=c;a("..",!0);return!0},setup:function(b){a(b,!0);return!0},call:function(a,c,d){var e=OpenAjax.gadgets.rpc.getRelayUrl(a);++n;if(e){for(var f=null,a=f=d.l?[e,"#",h([c,n,1,0,h([c,d.s,
- "","",c].concat(d.a))])].join(""):[e,"#",a,"&",c,"@",n,"&1&0&",encodeURIComponent(OpenAjax.gadgets.json.stringify(d))].join(""),g,c=k.length-1;0<=c;--c){d=k[c];try{if(d&&(d.recyclable||"complete"===d.readyState))if(d.parentNode.removeChild(d),window.ActiveXObject)k[c]=d=null,k.splice(c,1);else{d.recyclable=!1;g=d;break}}catch(m){}}g||(g=document.createElement("iframe"),g.style.border=g.style.width=g.style.height="0px",g.style.visibility="hidden",g.style.position="absolute",g.onload=function(){this.recyclable=
- !0},k.push(g));g.src=a;window.setTimeout(function(){document.body.appendChild(g)},0);return!0}OpenAjax.gadgets.warn("No relay file assigned for IFPC")}}}());OpenAjax.gadgets.rpctx=OpenAjax.gadgets.rpctx||{};
- OpenAjax.gadgets.rpctx.nix||(OpenAjax.gadgets.rpctx.nix=function(){function h(){var c=b[".."];if(!c)if(++e>n)OpenAjax.gadgets.warn("Nix transport setup failed, falling back..."),d("..",!1);else{if(!c&&(window.opener&&"GetAuthToken"in window.opener)&&(c=window.opener,c.GetAuthToken()==OpenAjax.gadgets.rpc.getAuthToken(".."))){var g=OpenAjax.gadgets.rpc.getAuthToken("..");c.CreateChannel(window[k]("..",g),g);b[".."]=c;window.opener=null;d("..",!0);return}window.setTimeout(function(){h()},a)}}var k=
- "GRPC____NIXVBS_get_wrapper",n=10,a=500,b={},c={},d,e=0;return{getCode:function(){return"nix"},isParentVerifiable:function(a){return a?c[a]:!1},init:function(a,c){d=c;if("unknown"!==typeof window[k]){window.GRPC____NIXVBS_handle_message=function(b){window.setTimeout(function(){a(OpenAjax.gadgets.json.parse(b))},0)};window.GRPC____NIXVBS_create_channel=function(a,c,e){OpenAjax.gadgets.rpc.getAuthToken(a)===e&&(b[a]=c,d(a,!0))};var e="Class GRPC____NIXVBS_wrapper\n Private m_Intended\nPrivate m_Auth\nPublic Sub SetIntendedName(name)\n If isEmpty(m_Intended) Then\nm_Intended = name\nEnd If\nEnd Sub\nPublic Sub SetAuth(auth)\n If isEmpty(m_Auth) Then\nm_Auth = auth\nEnd If\nEnd Sub\nPublic Sub SendMessage(data)\n GRPC____NIXVBS_handle_message(data)\nEnd Sub\nPublic Function GetAuthToken()\n GetAuthToken = m_Auth\nEnd Function\nPublic Sub CreateChannel(channel, auth)\n Call GRPC____NIXVBS_create_channel(m_Intended, channel, auth)\nEnd Sub\nEnd Class\nFunction "+
- k+"(name, auth)\nDim wrap\nSet wrap = New GRPC____NIXVBS_wrapper\nwrap.SetIntendedName name\nwrap.SetAuth auth\nSet "+k+" = wrap\nEnd Function";try{window.execScript(e,"vbscript")}catch(p){return!1}}return!0},setup:function(a,b,e){c[a]=!!e;if(".."===a){if(e){var p=2147483647*Math.random()|0,a=window.location.href,e=a.indexOf("#"),a=[-1==e?a:a.substring(0,e),p];OpenAjax.gadgets.rpc._createRelayIframe(b,a);var u=window.location.href.split("#")[1]||"",y=setInterval(function(){if((window.location.href.split("#")[1]||
- "")!==u)clearInterval(y),OpenAjax.gadgets.util.getUrlParameters(window.location.href).childtoken==p?h():d("..",!1)},100)}else h();return!0}try{var n=document.getElementById(a),q=window[k](a,b);n.contentWindow.opener=q}catch(s){return!1}return!0},call:function(a,c,d){try{b[a]&&b[a].SendMessage(OpenAjax.gadgets.json.stringify(d))}catch(e){return!1}return!0},relayOnload:function(a,b){var c=b[0]+"#childtoken="+b[1];document.getElementById(a).src=c}}}());
- OpenAjax.gadgets.rpctx=OpenAjax.gadgets.rpctx||{};
- OpenAjax.gadgets.rpctx.rmr||(OpenAjax.gadgets.rpctx.rmr=function(){function h(a,c,d,e){var f=function(){document.body.appendChild(a);a.src="about:blank";e&&(a.onload=function(){b(e)});a.src=c+"#"+d};document.body?f():OpenAjax.gadgets.util.registerOnLoadHandler(function(){f()})}function k(a){var b=null;f[a].searchCounter++;try{var g=OpenAjax.gadgets.rpc._getTargetWin(a),b=".."===a?g.frames["rmrtransport-"+OpenAjax.gadgets.rpc.RPC_ID]:g.frames["rmrtransport-.."]}catch(m){}g=!1;b&&(g=c(a,b));!g&&!(f[a].searchCounter>
- e)&&window.setTimeout(function(){k(a)},d)}function n(b,c,d,e){var g=null;if(g=".."!==d?f[".."]:f[b]){c!==OpenAjax.gadgets.rpc.ACK&&g.queue.push(e);if(g.waiting||0===g.queue.length&&!(c===OpenAjax.gadgets.rpc.ACK&&e&&!0===e.ackAlone))return!0;0<g.queue.length&&(g.waiting=!0);b=g.relayUri+"#"+a(b);try{g.frame.contentWindow.location=b;var m=10==g.width?20:10;g.frame.style.width=m+"px";g.width=m}catch(h){return!1}}return!0}function a(a){var a=f[a],b={id:a.sendId};a&&(b.d=Array.prototype.slice.call(a.queue,
- 0),b.d.push({s:OpenAjax.gadgets.rpc.ACK,id:a.recvId}));return OpenAjax.gadgets.json.stringify(b)}function b(a){for(var b=f[a],c=b.receiveWindow.location.hash.substring(1),d=OpenAjax.gadgets.json.parse(decodeURIComponent(c))||{},c=d.d||[],e=!1,h=!1,k=0,d=b.recvId-d.id,w=0;w<c.length;++w){var v=c[w];if(v.s===OpenAjax.gadgets.rpc.ACK){m(a,!0);b.waiting&&(h=!0);b.waiting=!1;var x=Math.max(0,v.id-b.sendId);b.queue.splice(0,x);b.sendId=Math.max(b.sendId,v.id||0)}else e=!0,++k<=d||(++b.recvId,g(v))}if(e||
- h&&0<b.queue.length)n(a,OpenAjax.gadgets.rpc.ACK,".."===a?OpenAjax.gadgets.rpc.RPC_ID:"..",{ackAlone:e})}function c(c,d){function e(){b(c)}var g=f[c];try{var m=!1,m="document"in d;if(!m)return!1;m="object"==typeof d.document;if(!m||"about:blank"===d.location.href)return!1}catch(k){return!1}g.receiveWindow=d;"undefined"===typeof d.attachEvent?d.onresize=e:d.attachEvent("onresize",e);".."===c?h(g.frame,g.relayUri,a(c),c):b(c);return!0}var d=500,e=10,f={},g,m;return{getCode:function(){return"rmr"},isParentVerifiable:function(){return!0},
- init:function(a,b){g=a;m=b;return!0},setup:function(b){try{if("object"!==typeof f[b]){var c=document.createElement("iframe"),d=c.style;d.position="absolute";d.top="0px";d.border="0";d.opacity="0";d.width="10px";d.height="1px";c.id="rmrtransport-"+b;c.name=c.id;var e=OpenAjax.gadgets.rpc.getRelayUrl(b);e||(e=OpenAjax.gadgets.rpc.getOrigin(OpenAjax.gadgets.util.getUrlParameters().parent)+"/robots.txt");f[b]={frame:c,receiveWindow:null,relayUri:e,searchCounter:0,width:10,waiting:!0,queue:[],sendId:0,
- recvId:0};".."!==b&&h(c,e,a(b));k(b)}}catch(g){return OpenAjax.gadgets.warn("Caught exception setting up RMR: "+g),!1}return!0},call:function(a,b,c){return n(a,c.s,b,c)}}}());OpenAjax.gadgets.rpctx=OpenAjax.gadgets.rpctx||{};
- OpenAjax.gadgets.rpctx.wpm||(OpenAjax.gadgets.rpctx.wpm=function(){function h(a){var b=OpenAjax.gadgets.json.parse(a.data);if(b&&b.f){var f=OpenAjax.gadgets.rpc.getRelayUrl(b.f)||OpenAjax.gadgets.util.getUrlParameters().parent,f=OpenAjax.gadgets.rpc.getOrigin(f);(!c?a.origin!==f:a.domain!==/^.+:\/\/([^:]+).*/.exec(f)[1])||k(b)}}var k,n,a,b=!1,c=!1;return{getCode:function(){return"wpm"},isParentVerifiable:function(){return!0},init:function(d,e){k=d;n=e;var f=function(a){"postmessage.test"==a.data&&
- (g=!0,"undefined"===typeof a.origin&&(c=!0))},g=!1;OpenAjax.gadgets.util.attachBrowserEvent(window,"message",f,!1);window.postMessage("postmessage.test","*");g&&(b=!0);OpenAjax.gadgets.util.removeBrowserEvent(window,"message",f,!1);a=b?function(a,b,c){window.setTimeout(function(){a.postMessage(b,c)},0)}:function(a,b,c){a.postMessage(b,c)};OpenAjax.gadgets.util.attachBrowserEvent(window,"message",h,!1);n("..",!0);return!0},setup:function(a,b,c){".."===a&&(c?OpenAjax.gadgets.rpc._createRelayIframe(b):
- OpenAjax.gadgets.rpc.call(a,OpenAjax.gadgets.rpc.ACK));return!0},call:function(b,c,f){c=OpenAjax.gadgets.rpc._getTargetWin(b);b=OpenAjax.gadgets.rpc.getRelayUrl(b)||OpenAjax.gadgets.util.getUrlParameters().parent;(b=OpenAjax.gadgets.rpc.getOrigin(b))?a(c,OpenAjax.gadgets.json.stringify(f),b):OpenAjax.gadgets.error("No relay set (used as window.postMessage targetOrigin), cannot send cross-domain message");return!0},relayOnload:function(a){n(a,!0)}}}());
- OpenAjax.gadgets.rpc||(OpenAjax.gadgets.rpc=function(){function h(a,b){var c=B;b||(c=E);C[a]=c;for(var d=D[a]||[],e=0;e<d.length;++e){var f=d[e];f.t=r[a];c.call(a,f.f,f)}D[a]=[]}function k(a,b,c,d,e){if(!r[b]||r[b]!==c)OpenAjax.gadgets.error("Invalid auth token. "+r[b]+" vs "+c),F(b,H);e.onunload=function(){x[b]&&!L&&(F(b,K),OpenAjax.gadgets.rpc.removeReceiver(b))};a=function(){L=!0};M||(OpenAjax.gadgets.util.attachBrowserEvent(window,"unload",a,!1),M=!0);d=OpenAjax.gadgets.json.parse(decodeURIComponent(d));
- B.relayOnload(b,d)}function n(a){if(a&&"string"===typeof a.s&&"string"===typeof a.f&&a.a instanceof Array)if(r[a.f]&&r[a.f]!==a.t&&(OpenAjax.gadgets.error("Invalid auth token. "+r[a.f]+" vs "+a.t),F(a.f,H)),a.s===p)window.setTimeout(function(){h(a.f,!0)},0);else{a.c&&(a.callback=function(b){OpenAjax.gadgets.rpc.call(a.f,g,null,a.c,b)});var b=(t[a.s]||t[m]).apply(a,a.a);a.c&&"undefined"!==typeof b&&OpenAjax.gadgets.rpc.call(a.f,g,null,a.c,b)}}function a(a){if(!a)return"";a=a.toLowerCase();0==a.indexOf("//")&&
- (a=window.location.protocol+a);-1==a.indexOf("://")&&(a=window.location.protocol+"//"+a);var b=a.substring(a.indexOf("://")+3),c=b.indexOf("/");-1!=c&&(b=b.substring(0,c));var a=a.substring(0,a.indexOf("://")),c="",d=b.indexOf(":");if(-1!=d){var e=b.substring(d+1),b=b.substring(0,d);if("http"===a&&"80"!==e||"https"===a&&"443"!==e)c=":"+e}return a+"://"+b+c}function b(a){if("undefined"===typeof a||".."===a)return window.parent;var a=String(a),b=window.frames[a];return b?b:(b=document.getElementById(a))&&
- b.contentWindow?b.contentWindow:null}function c(a,b,d){if(!0!==x[a]){"undefined"===typeof x[a]&&(x[a]=0);var e=document.getElementById(a);(".."===a||null!=e)&&!0===B.setup(a,b,d)?x[a]=!0:!0!==x[a]&&x[a]++<y?window.setTimeout(function(){c(a,b,d)},u):(C[a]=E,x[a]=!0)}}function d(a,b,c){/http(s)?:\/\/.+/.test(b)||(0==b.indexOf("//")?b=window.location.protocol+b:"/"==b.charAt(0)?b=window.location.protocol+"//"+window.location.host+b:-1==b.indexOf("://")&&(b=window.location.protocol+"//"+b));q[a]=b;s[a]=
- !!c}function e(a,b,d){b=b||"";r[a]=String(b);c(a,b,d)}function f(b,c,f,g){if(".."===b){var m=f||z.rpctoken||z.ifpctok||"";if(!0===window.__isgadget)OpenAjax.gadgets.config.register("rpc",{parentRelayUrl:OpenAjax.gadgets.config.NonEmptyStringValidator},function(b){var c=b?b.rpc:{},b=c.parentRelayUrl;if("http://"!==b.substring(0,7)&&"https://"!==b.substring(0,8)&&"//"!==b.substring(0,2)&&"string"===typeof z.parent&&""!==z.parent)if("/"!==b.substring(0,1))var f=z.parent.lastIndexOf("/"),b=z.parent.substring(0,
- f+1)+b;else b=a(z.parent)+b;c=!!c.useLegacyProtocol;d("..",b,c);c&&(B=OpenAjax.gadgets.rpctx.ifpc,B.init(n,h));e("..",m,g||z.forcesecure||!1)});else if(b=g||z.forcesecure||!1,c=c||z.parent)d("..",c),e("..",m,b)}else if(OpenAjax.gadgets.util){var p=document.getElementById(b);if(!p)throw Error("Cannot set up gadgets.rpc receiver with ID: "+b+", element not found.");d(b,c||p.src);c=OpenAjax.gadgets.util.getUrlParameters(p.src);e(b,f||c.rpctoken,g||c.forcesecure)}}var g="__cb",m="",p="__ack",u=500,y=
- 10,t={},q={},s={},r={},w=0,v={},x={},A={},z={},C={},D={},J=window.top!==window.self,G=window.name,F=function(){},K=1,H=2,E,I=function(a){return function(){OpenAjax.gadgets.log("gadgets.rpc."+a+"("+OpenAjax.gadgets.json.stringify(Array.prototype.slice.call(arguments))+"): call ignored. [caller: "+document.location+", isChild: "+J+"]")}};E={getCode:function(){return"noop"},isParentVerifiable:function(){return!0},init:I("init"),setup:I("setup"),call:I("call")};OpenAjax.gadgets.util&&(z=OpenAjax.gadgets.util.getUrlParameters());
- var L=!1,M=!1,B="function"===typeof window.postMessage?OpenAjax.gadgets.rpctx.wpm:"object"===typeof window.postMessage?OpenAjax.gadgets.rpctx.wpm:window.ActiveXObject?OpenAjax.gadgets.rpctx.nix:0<navigator.userAgent.indexOf("WebKit")?OpenAjax.gadgets.rpctx.rmr:"Gecko"===navigator.product?OpenAjax.gadgets.rpctx.frameElement:OpenAjax.gadgets.rpctx.ifpc;t[m]=function(){OpenAjax.gadgets.warn("Unknown RPC service: "+this.s)};t[g]=function(a,b){var c=v[a];c&&(delete v[a],c(b))};return{config:function(a){"function"===
- typeof a.securityCallback&&(F=a.securityCallback)},register:function(a,b){if(a===g||a===p)throw Error("Cannot overwrite callback/ack service");if(a===m)throw Error("Cannot overwrite default service: use registerDefault");t[a]=b},unregister:function(a){if(a===g||a===p)throw Error("Cannot delete callback/ack service");if(a===m)throw Error("Cannot delete default service: use unregisterDefault");delete t[a]},registerDefault:function(a){t[m]=a},unregisterDefault:function(){delete t[m]},forceParentVerifiable:function(){B.isParentVerifiable()||
- (B=OpenAjax.gadgets.rpctx.ifpc)},call:function(c,d,e,f){var c=c||"..",g="..";".."===c&&(g=G);++w;e&&(v[w]=e);var m={s:d,f:g,c:e?w:0,a:Array.prototype.slice.call(arguments,3),t:r[c],l:s[c]};if(".."!==c&&!document.getElementById(c))OpenAjax.gadgets.log("WARNING: attempted send to nonexistent frame: "+c);else{var p;a:{p=c;var h=m;if("undefined"===typeof A[p]){A[p]=!1;var u=OpenAjax.gadgets.rpc.getRelayUrl(p);if(a(u)!==a(window.location.href)){p=!1;break a}u=b(p);try{A[p]=u.OpenAjax.gadgets.rpc.receiveSameDomain}catch(k){OpenAjax.gadgets.error("Same domain call failed: parent= incorrectly set.")}}"function"===
- typeof A[p]?(A[p](h),p=!0):p=!1}p||((p=C[c])?(s[c]&&(p=OpenAjax.gadgets.rpctx.ifpc),!1===p.call(c,g,m)&&(C[c]=E,B.call(c,g,m))):D[c]?D[c].push(m):D[c]=[m])}},getRelayUrl:function(a){(a=q[a])&&"/"===a.substring(0,1)&&(a="/"===a.substring(1,2)?document.location.protocol+a:document.location.protocol+"//"+document.location.host+a);return a},setRelayUrl:d,setAuthToken:e,setupReceiver:f,getAuthToken:function(a){return r[a]},removeReceiver:function(a){delete q[a];delete s[a];delete r[a];delete x[a];delete A[a];
- delete C[a]},getRelayChannel:function(){return B.getCode()},receive:function(a,b){4<a.length?n(OpenAjax.gadgets.json.parse(decodeURIComponent(a[a.length-1]))):k.apply(null,a.concat(b))},receiveSameDomain:function(a){a.a=Array.prototype.slice.call(a.a);window.setTimeout(function(){n(a)},0)},getOrigin:a,getReceiverOrigin:function(a){var b=C[a];if(!b||!b.isParentVerifiable(a))return null;a=OpenAjax.gadgets.rpc.getRelayUrl(a)||OpenAjax.gadgets.util.getUrlParameters().parent;return OpenAjax.gadgets.rpc.getOrigin(a)},
- init:function(){!1===B.init(n,h)&&(B=E);J&&f("..")},_getTargetWin:b,_createRelayIframe:function(a,b){function c(){document.body.appendChild(f);f.src='javascript:"<html></html>"';f.src=e}var d=OpenAjax.gadgets.rpc.getRelayUrl("..");if(d){var e=d+"#..&"+G+"&"+a+"&"+encodeURIComponent(OpenAjax.gadgets.json.stringify(b)),f=document.createElement("iframe");f.style.border=f.style.width=f.style.height="0px";f.style.visibility="hidden";f.style.position="absolute";document.body?c():OpenAjax.gadgets.util.registerOnLoadHandler(function(){c()});
- return f}},ACK:p,RPC_ID:G,SEC_ERROR_LOAD_TIMEOUT:0,SEC_ERROR_FRAME_PHISH:K,SEC_ERROR_FORGED_MSG:H}}(),OpenAjax.gadgets.rpc.init());
- /** Licensed Materials - Property of IBM, 5724-U69, (C) Copyright IBM Corp. 2008, 2012 - All Rights reserved. **/
- require(["dojo/_base/connect","dojo/string","dojo/back","dojox/xml/parser","dojox/uuid/generateRandomUuid"],function(){function h(a){eval.call(self,a)}dojo.i18n._preloadLocalizations("com.ibm.mm.enabler.nls.enabler","ROOT ar ca cs da de el en es fi fr he hr hu it ja ko nb nl no pl pt pt-br ro ru sk sl sv th tr uk zh zh-tw".split(" "));var k=["3","0","0","20110927-1750"];4==k.length&&dojo.setObject("com.ibm.mashups.enabler.version",{major:k[0],minor:k[1],patch:k[2],flag:"_enabler.core",revision:k[3],
- toString:function(){return this.major+"."+this.minor+"."+this.patch+(this.flag||"")+" ("+this.revision+")"}});dojo.provide("com.ibm.mashups.enabler.DefaultLocalized");dojo.provide("com.ibm.mashups.enabler.Deferred");dojo.provide("com.ibm.mashups.enabler.DeferredIterator");dojo.provide("com.ibm.mashups.enabler.DeferredIterator_API");dojo.provide("com.ibm.mashups.enabler.DeferredOperation");dojo.provide("com.ibm.mashups.enabler.Deferred_API");dojo.provide("com.ibm.mashups.enabler.DirtyFlagProvider");
- dojo.provide("com.ibm.mashups.enabler.Discardable");dojo.provide("com.ibm.mashups.enabler.Invalidatable");dojo.provide("com.ibm.mashups.enabler.Invalidatable_API");dojo.provide("com.ibm.mashups.enabler.Iterator");dojo.provide("com.ibm.mashups.enabler.ListModel");dojo.provide("com.ibm.mashups.enabler.ListModelController");dojo.provide("com.ibm.mashups.enabler.Localized");dojo.provide("com.ibm.mashups.enabler.Localized_API");dojo.provide("com.ibm.mashups.enabler.ModifiableLocalized");dojo.provide("com.ibm.mashups.enabler.Representation");
- dojo.provide("com.ibm.mashups.enabler.RepresentationProvider");dojo.provide("com.ibm.mashups.enabler.SubmittableForm");dojo.provide("com.ibm.mashups.enabler.SubmittableFormProvider");dojo.provide("com.ibm.mashups.enabler.SubmittableForm_API");dojo.provide("com.ibm.mashups.enabler.TimeStamped");dojo.provide("com.ibm.mashups.enabler.Transformable");dojo.provide("com.ibm.mashups.enabler.TreeModelController");dojo.provide("com.ibm.mashups.enabler.context.Factory");dojo.provide("com.ibm.mashups.enabler.context.LocalizedContext");
- dojo.provide("com.ibm.mashups.enabler.context.LocalizedContext_API");dojo.provide("com.ibm.mashups.enabler.context.PageContext");dojo.provide("com.ibm.mashups.enabler.io.DynamicResolver");dojo.provide("com.ibm.mashups.enabler.io.DynamicResolver_API");dojo.provide("com.ibm.mashups.enabler.io.XHRMultipart");dojo.provide("com.ibm.mashups.enabler.io.XHRMultipartFactory");dojo.provide("com.ibm.mashups.enabler.model.Model");dojo.provide("com.ibm.mashups.enabler.model.Model_API");dojo.provide("com.ibm.mashups.enabler.model.ServiceDocumentModel");
- dojo.provide("com.ibm.mashups.enabler.model.ServiceDocumentModel_API");dojo.provide("com.ibm.mashups.enabler.model.state.Accessor");dojo.provide("com.ibm.mashups.enabler.model.state.AccessorFactory");dojo.provide("com.ibm.mashups.enabler.model.state.LayoutAccessor");dojo.provide("com.ibm.mashups.enabler.model.state.LayoutContainerAccessor");dojo.provide("com.ibm.mashups.enabler.model.state.NavigationStateModel");dojo.provide("com.ibm.mashups.enabler.model.state.NavigationStateModelFactory");dojo.provide("com.ibm.mashups.enabler.model.state.NavigationStateNode");
- dojo.provide("com.ibm.mashups.enabler.model.state.NavigationStateNode_API");dojo.provide("com.ibm.mashups.enabler.model.state.NavigationStateProcessor");dojo.provide("com.ibm.mashups.enabler.model.state.PageAccessor");dojo.provide("com.ibm.mashups.enabler.model.state.PageAccessor_API");dojo.provide("com.ibm.mashups.enabler.model.state.PageModeAccessor");dojo.provide("com.ibm.mashups.enabler.model.state.ShareableParameterSetAccessor");dojo.provide("com.ibm.mashups.enabler.model.state.SpaceAccessor");
- dojo.provide("com.ibm.mashups.enabler.model.state.UrlGenerator");dojo.provide("com.ibm.mashups.enabler.model.state.UrlGeneratorFactory");dojo.provide("com.ibm.mashups.enabler.model.state.WidgetAccessor");dojo.provide("com.ibm.mashups.enabler.model.url.ModelUrl");dojo.provide("com.ibm.mashups.enabler.model.url.ModelUrlFactory");dojo.provide("com.ibm.mashups.enabler.model.url.ModelUrl_API");dojo.provide("com.ibm.mashups.enabler.services.ConfigObject");dojo.provide("com.ibm.mashups.enabler.services.ConfigObject_API");
- dojo.provide("com.ibm.mashups.enabler.services.ConfigService");dojo.provide("com.ibm.mashups.enabler.services.IdentificationService");dojo.provide("com.ibm.mashups.enabler.services.IdentificationService_API");dojo.provide("com.ibm.mashups.enabler.strategy.ListLoadAheadStrategy");dojo.provide("com.ibm.mashups.enabler.strategy.Strategy");dojo.provide("com.ibm.mashups.enabler.strategy.SyncMetaDataStrategy");dojo.provide("com.ibm.mashups.enabler.strategy.TreeLoadAheadStrategy");dojo.provide("com.ibm.mashups.enabler.utils.EndpointHelper");
- dojo.provide("com.ibm.mashups.enabler.utils.EventTransformer");dojo.provide("com.ibm.mashups.enabler.utils.EventTransformer_API");dojo.provide("com.ibm.mashups.enabler.utils.URLHelper");dojo.provide("com.ibm.mashups.enabler.widget.Constants");dojo.provide("com.ibm.mashups.enabler.xml.XPath");dojo.provide("com.ibm.mashups.enabler.xml.XPath_API");dojo.provide("com.ibm.mashups.iwidget.Constants");dojo.provide("com.ibm.mashups.iwidget.IEvent");dojo.provide("com.ibm.mashups.iwidget.IEventDescription");
- dojo.provide("com.ibm.mashups.iwidget.IEventDescription_API");dojo.provide("com.ibm.mashups.iwidget.IEvent_API");dojo.provide("com.ibm.mashups.iwidget.iContext");dojo.provide("com.ibm.mashups.iwidget.iEvents");dojo.provide("com.ibm.mashups.iwidget.iEvents_API");dojo.provide("com.ibm.mashups.iwidget.io");dojo.provide("com.ibm.mashups.iwidget.itemset.ItemSet");dojo.provide("com.ibm.mashups.iwidget.itemset.ManagedItemSet");dojo.provide("com.ibm.mashups.iwidget.itemset.ManagedItemSet_API");dojo.provide("com.ibm.mashups.iwidget.itemset.ShareableItemSet");
- dojo.provide("com.ibm.mashups.iwidget.model.EventModel");dojo.provide("com.ibm.mashups.iwidget.model.EventModelFactory");dojo.provide("com.ibm.mashups.iwidget.model.Factory");dojo.provide("com.ibm.mashups.iwidget.model.Factory_API");dojo.provide("com.ibm.mashups.iwidget.services.ContainerService");dojo.provide("com.ibm.mashups.iwidget.services.ContainerService_API");dojo.provide("com.ibm.mashups.iwidget.services.EventService");dojo.provide("com.ibm.mashups.iwidget.services.PersistentAttributesFactoryService");
- dojo.provide("com.ibm.mashups.iwidget.services.PersistentAttributesFactoryService_API");dojo.provide("com.ibm.mashups.iwidget.services.WidgetEventModelFactoryService");dojo.provide("com.ibm.mashups.iwidget.services.WidgetEventModelFactoryService_API");dojo.provide("com.ibm.mashups.iwidget.services.WireProviderFactoryService");dojo.provide("com.ibm.mashups.iwidget.services.WireProviderFactoryService_API");dojo.provide("com.ibm.mashups.iwidget.widget.IWidgetDefinition");dojo.provide("com.ibm.mashups.iwidget.widget.IWidgetDefinition_API");
- dojo.provide("com.ibm.mashups.iwidget.widget.IWidgetInstance");dojo.provide("com.ibm.mashups.iwidget.widget.IWidgetInstance_API");dojo.provide("com.ibm.mashups.iwidget.widget.IWidgetWrapper");dojo.provide("com.ibm.mashups.iwidget.widget.ModifiableProperties");dojo.provide("com.ibm.mashups.iwidget.widget.ModifiableWireProvider");dojo.provide("com.ibm.mashups.iwidget.widget.Properties");dojo.provide("com.ibm.mashups.iwidget.widget.Properties_API");dojo.provide("com.ibm.mashups.iwidget.widget.Wire");
- dojo.provide("com.ibm.mashups.iwidget.widget.WireProvider");dojo.provide("com.ibm.mashups.iwidget.widget.WireProviderFactory");dojo.provide("com.ibm.mashups.iwidget.widget.Wire_API");dojo.provide("com.ibm.mashups.livetext.CallbackModel");dojo.provide("com.ibm.mashups.livetext.ConfigEntry");dojo.provide("com.ibm.mashups.livetext.ConfigEntry_API");dojo.provide("com.ibm.mashups.livetext.LivetextBatchModel");dojo.provide("com.ibm.mashups.livetext.LivetextModel");dojo.provide("com.ibm.mashups.livetext.ServiceModel");
- dojo.provide("com.ibm.mashups.livetext.ServiceModel_API");dojo.provide("com.ibm.mashups.services.ServiceManager");dojo.provide("com.ibm.mashups.services.ServiceManager_API");dojo.provide("com.ibm.mm.data.datatypes");dojo.provide("com.ibm.mm.enabler.ArrayMap");dojo.provide("com.ibm.mm.enabler.DeferredImpl");dojo.provide("com.ibm.mm.enabler.DeferredIteratorImpl");dojo.provide("com.ibm.mm.enabler.DeferredOperationImpl");dojo.provide("com.ibm.mm.enabler.DirtyFlagProviderImpl");dojo.provide("com.ibm.mm.enabler.EndpointUtils");
- dojo.provide("com.ibm.mm.enabler.EndpointUtilsExtendedImpl");dojo.provide("com.ibm.mm.enabler.IdentifiableHelper");dojo.provide("com.ibm.mm.enabler.IdentifierImpl");dojo.provide("com.ibm.mm.enabler.RepresentationImpl");dojo.provide("com.ibm.mm.enabler.RepresentationModelImpl");dojo.provide("com.ibm.mm.enabler.RepresentationProviderImpl");dojo.provide("com.ibm.mm.enabler.ServiceDocConsumer");dojo.provide("com.ibm.mm.enabler.SubmittableFormImpl");dojo.provide("com.ibm.mm.enabler.TransformableImpl");
- dojo.provide("com.ibm.mm.enabler.aggregation.javascript");dojo.provide("com.ibm.mm.enabler.aggregation.javascript.ExternalScriptFilter");dojo.provide("com.ibm.mm.enabler.aggregation.javascript.Filter");dojo.provide("com.ibm.mm.enabler.aggregation.javascript.FilterChain");dojo.provide("com.ibm.mm.enabler.aggregation.javascript.InlineScriptFilter");dojo.provide("com.ibm.mm.enabler.aggregation.javascript.WidgetJavascriptHandler");dojo.provide("com.ibm.mm.enabler.context.FactoryImpl");dojo.provide("com.ibm.mm.enabler.context.LocalizedContextImpl");
- dojo.provide("com.ibm.mm.enabler.context.PageContextImpl");dojo.provide("com.ibm.mm.enabler.core");dojo.provide("com.ibm.mm.enabler.encode.huffman.HuffmanURL");dojo.provide("com.ibm.mm.enabler.encode.huffman.ZEncoder");dojo.provide("com.ibm.mm.enabler.endpoints.XHREndpointExtensionImpl");dojo.provide("com.ibm.mm.enabler.hub.MainHubAdapterImpl");dojo.provide("com.ibm.mm.enabler.hub.ManagedHubImpl");dojo.provide("com.ibm.mm.enabler.hub.SubDomainPoolImpl");dojo.provide("com.ibm.mm.enabler.hub.XHRHeaderExtensionImpl");
- dojo.provide("com.ibm.mm.enabler.io.DynamicResolver");dojo.provide("com.ibm.mm.enabler.io.XHRMultipartFactoryImpl");dojo.provide("com.ibm.mm.enabler.io.XHRMultipartImpl");dojo.provide("com.ibm.mm.enabler.io.XHRWrapper");dojo.provide("com.ibm.mm.enabler.model.HttpStatusCodes");dojo.provide("com.ibm.mm.enabler.model.ModelImpl");dojo.provide("com.ibm.mm.enabler.model.NameSpaceFactory");dojo.provide("com.ibm.mm.enabler.model.ServiceDocumentModel");dojo.provide("com.ibm.mm.enabler.model.state.AccessorFactoryImpl");
- dojo.provide("com.ibm.mm.enabler.model.state.CookieManager");dojo.provide("com.ibm.mm.enabler.model.state.LayoutAccessorImpl");dojo.provide("com.ibm.mm.enabler.model.state.LayoutContainerAccessorImpl");dojo.provide("com.ibm.mm.enabler.model.state.NavigationStateModelFactoryImpl");dojo.provide("com.ibm.mm.enabler.model.state.NavigationStateModelImpl");dojo.provide("com.ibm.mm.enabler.model.state.PageAccessorImpl");dojo.provide("com.ibm.mm.enabler.model.state.PageModeAccessorImpl");dojo.provide("com.ibm.mm.enabler.model.state.ShareableParameterSetAccessorImpl");
- dojo.provide("com.ibm.mm.enabler.model.state.SpaceAccessorImpl");dojo.provide("com.ibm.mm.enabler.model.state.UrlGeneratorFactoryImpl");dojo.provide("com.ibm.mm.enabler.model.state.UrlGeneratorImpl");dojo.provide("com.ibm.mm.enabler.model.state.WidgetAccessorImpl");dojo.provide("com.ibm.mm.enabler.model.url.BaseModelUrl");dojo.provide("com.ibm.mm.enabler.model.url.ModelUrlFactoryImpl");dojo.provide("com.ibm.mm.enabler.model.url.SchemeBasedModelMediaUrlImpl");dojo.provide("com.ibm.mm.enabler.model.url.SchemeBasedModelUrlImpl");
- dojo.provide("com.ibm.mm.enabler.model.url.StringBasedModelUrlImpl");dojo.provide("com.ibm.mm.enabler.model.url.ThemeResourceUrlImpl");dojo.provide("com.ibm.mm.enabler.persistence.xml.IdentifiableXmlImpl");dojo.provide("com.ibm.mm.enabler.services.AbstractConfigServiceImpl");dojo.provide("com.ibm.mm.enabler.services.ConfigObjectDefaultImpl");dojo.provide("com.ibm.mm.enabler.services.ConfigServiceDefaultImpl");dojo.provide("com.ibm.mm.enabler.services.ConfigServiceExtendedImpl");dojo.provide("com.ibm.mm.enabler.services.IdentificationServiceImpl");
- dojo.provide("com.ibm.mm.enabler.services.ModelRestServiceRequest");dojo.provide("com.ibm.mm.enabler.utils.Atom");dojo.provide("com.ibm.mm.enabler.utils.Dom");dojo.provide("com.ibm.mm.enabler.utils.EndpointHelperImpl");dojo.provide("com.ibm.mm.enabler.utils.EventModelHelperImpl");dojo.provide("com.ibm.mm.enabler.utils.EventTransformerImpl");dojo.provide("com.ibm.mm.enabler.utils.HttpUrl");dojo.provide("com.ibm.mm.enabler.utils.Misc");dojo.provide("com.ibm.mm.enabler.utils.URLHelper");dojo.provide("com.ibm.mm.enabler.utils.Utils");
- dojo.provide("com.ibm.mm.enabler.widget.Constants");dojo.provide("com.ibm.mm.enabler.xml.XPathImpl");dojo.provide("com.ibm.mm.enabler.xml.xpath._Generic");dojo.provide("com.ibm.mm.enabler.xslt");dojo.provide("com.ibm.mm.iwidget.Constants");dojo.provide("com.ibm.mm.iwidget.DeferredLiveTextUnprocessImpl");dojo.provide("com.ibm.mm.iwidget.DeferredLiveTextUnprocessStubImpl");dojo.provide("com.ibm.mm.iwidget.DeferredLoadImpl");dojo.provide("com.ibm.mm.iwidget.IEventDescriptionImpl");dojo.provide("com.ibm.mm.iwidget.RenderController");
- dojo.provide("com.ibm.mm.iwidget.Utils");dojo.provide("com.ibm.mm.iwidget.UtilsExtended");dojo.provide("com.ibm.mm.iwidget.icontext.IContextDefaultImpl");dojo.provide("com.ibm.mm.iwidget.icontext.IContextExtendedImpl");dojo.provide("com.ibm.mm.iwidget.icontext.IContextIEventsImpl");dojo.provide("com.ibm.mm.iwidget.icontext.IContextIOImpl");dojo.provide("com.ibm.mm.iwidget.icontext.IContextMMExtensionImpl");dojo.provide("com.ibm.mm.iwidget.itemset.ItemsetDefaultImpl");dojo.provide("com.ibm.mm.iwidget.itemset.ShareableItemSetImpl");
- dojo.provide("com.ibm.mm.iwidget.manageditemset.DOMPersistentAttributesFactoryImpl");dojo.provide("com.ibm.mm.iwidget.manageditemset.IDescriptorDefaultImpl");dojo.provide("com.ibm.mm.iwidget.manageditemset.IDescriptorExtendedImpl");dojo.provide("com.ibm.mm.iwidget.manageditemset.UserProfileImpl");dojo.provide("com.ibm.mm.iwidget.model.DOMEventModelFactoryImpl");dojo.provide("com.ibm.mm.iwidget.model.DOMEventModelImpl");dojo.provide("com.ibm.mm.iwidget.model.FactoryImpl");dojo.provide("com.ibm.mm.iwidget.model.WidgetModel");
- dojo.provide("com.ibm.mm.iwidget.model.WidgetModelExtended");dojo.provide("com.ibm.mm.iwidget.parser.LegacyXMLParser");dojo.provide("com.ibm.mm.iwidget.parser.OpenSocialXMLParser");dojo.provide("com.ibm.mm.iwidget.parser.StandardXMLParser");dojo.provide("com.ibm.mm.iwidget.parser.WidgetParser");dojo.provide("com.ibm.mm.iwidget.parser.WidgetParserFactory");dojo.provide("com.ibm.mm.iwidget.payloadDef");dojo.provide("com.ibm.mm.iwidget.services.ContainerServiceImpl");dojo.provide("com.ibm.mm.iwidget.services.EventService");
- dojo.provide("com.ibm.mm.iwidget.services.EventServiceExtended");dojo.provide("com.ibm.mm.iwidget.services.IFrameEventServiceImpl");dojo.provide("com.ibm.mm.iwidget.services.PersistentAttributesFactoryServiceImpl");dojo.provide("com.ibm.mm.iwidget.services.ResourceLoadServiceImpl");dojo.provide("com.ibm.mm.iwidget.services.WidgetEventModelFactoryServiceImpl");dojo.provide("com.ibm.mm.iwidget.services.WidgetLoadServiceImpl");dojo.provide("com.ibm.mm.iwidget.services.WireProviderFactoryServiceImpl");
- dojo.provide("com.ibm.mm.iwidget.widget.DOMWireProviderFactoryImpl");dojo.provide("com.ibm.mm.iwidget.widget.IWidgetDefinitionDefaultImpl");dojo.provide("com.ibm.mm.iwidget.widget.IWidgetDefinitionExtendedImpl");dojo.provide("com.ibm.mm.iwidget.widget.IWidgetDefinitionLegacyImpl");dojo.provide("com.ibm.mm.iwidget.widget.IWidgetInstanceDefaultImpl");dojo.provide("com.ibm.mm.iwidget.widget.IWidgetInstanceExtendedImpl");dojo.provide("com.ibm.mm.iwidget.widget.IWidgetWrapperDefaultImpl");dojo.provide("com.ibm.mm.iwidget.widget.IWidgetWrapperExtendedImpl");
- dojo.provide("com.ibm.mm.iwidget.widget.IWidgetWrapperStubImpl");dojo.provide("com.ibm.mm.iwidget.widget.ModifiablePropertiesImpl");dojo.provide("com.ibm.mm.iwidget.widget.ModifiableWireModelImpl");dojo.provide("com.ibm.mm.iwidget.widget.PropertiesImpl");dojo.provide("com.ibm.mm.iwidget.widget.ResourceImpl");dojo.provide("com.ibm.mm.livetext.ConfigEntryImpl");dojo.provide("com.ibm.mm.livetext.ServiceModelImpl");dojo.provide("tagservices.widgets");dojo.declare("com.ibm.mashups.enabler.Deferred",null,
- {setFinishedCallback:function(){},start:function(){return{}}});dojo.declare("com.ibm.mm.enabler.DeferredImpl",[com.ibm.mashups.enabler.Deferred],{_chainedDeferred:null,_sync:!1,_previous:null,constructor:function(a,b,c){this.context=a;this.startfn=b;this.params=c},addErrorCallback:function(a,b){dojo.deprecated("com.ibm.mashups.enabler.Deferred.addErrorCallback()","use com.ibm.mashups.enabler.Deferred.setFinishedCallback() instead");this.errorCallback=a;this.errorCallbackParameters=b},addFinishedCallback:function(a,
- b){dojo.deprecated("com.ibm.mashups.enabler.Deferred.addFinishedCallback()","use com.ibm.mashups.enabler.Deferred.setFinishedCallback() instead");this.finishedCallback=a;this.finishedCallbackParameters=b},setFinishedCallback:function(a,b){this.finishedCallback2=a;this.finishedCallbackParameters2=b;return this},start:function(a,b){this._sync=a||"undefined"==typeof a;var c=null;dojo.isFunction(this.startfn)&&(c=dojo.hitch(this.context||null,this.startfn)(this,this._sync,this.params,b||null));return c},
- getFinishedCallback:function(){return this.finishedCallback2},getFinishedCallbackParameters:function(){return this.finishedCallbackParameters2},setChainedDeferred:function(a){this._chainedDeferred=a},getChainedDeferred:function(){return this._chainedDeferred},getPrevious:function(){return this._previous},_setPreviousDeferred:function(a,b,c){this._previous={deferred:a,result:b,status:c}},removeChainedDeferred:function(){this._chainedDeferred=null},finish:function(a,b){try{dojo.isFunction(this.getFinishedCallback())?
- dojo.partial(this.getFinishedCallback())(a,b,this.getFinishedCallbackParameters()):dojo.isFunction(this.finishedCallback)&&0===(""+b).indexOf("2")?dojo.partial(this.finishedCallback)(a,this.finishedCallbackParameters):dojo.isFunction(this.errorCallback)&&400<=b&&dojo.partial(this.errorCallback)(a,this.errorCallbackParameters)}catch(c){}this._chainedDeferred&&(this._chainedDeferred._setPreviousDeferred(this,a,b),this._chainedDeferred.start(this._sync))}});dojo.require("com.ibm.mm.enabler.DeferredImpl");
- dojo.declare("com.ibm.mashups.enabler.context.LocalizedContext",null,{getPreferredLocale:function(){},getDefaultLocale:function(){},getLocale:function(){},getDisplayLocale:function(){},getTitle:function(){},getDescription:function(){}});dojo.declare("com.ibm.mashups.enabler.xml.XPath",null,{evaluateXPath:function(){},evaluateEntry:function(){},evaluateBoolean:function(){},evaluateString:function(){},evaluateNumber:function(){}});com.ibm.mm.enabler.utils.Dom={getAttributeWithNS:function(a,b,c,d){if(!a||
- !b||!c||!d)return null;var e=null;if(dojo.isIE){if(e=a.getAttribute(b),null===e||""==e){a=a.attributes;for(b=a.length;0<b;b--)if(a[b-1].baseName==c&&a[b-1].namespaceURI==d){e=a[b-1].value;break}}}else e=a.getAttributeNS(d,c);return e},setAttributeWithNS:function(a,b,c,d,e,f){if(!dojo.isObject(b))throw Error("element must be a DOMNode");if(dojo.isIE){a=a.createNode(2,c,e);if(null===f||void 0===f)f="";a.nodeValue=f;b.setAttributeNode(a)}else b.setAttributeNS(e,c,f)},textContent:function(a,b){if(!a)return"";
- if(1<arguments.length){var c=a.ownerDocument.createTextNode(b||"");com.ibm.mm.enabler.utils.Dom.replaceChildren(a,c)}else return(c=dojox.xml.parser.textContent(a))?c:dojo.map(a.childNodes||[],function(a){return 0<a.nodeType&&4>a.nodeType?a.nodeValue:""}).join("")},createElement:function(a,b,c){return dojo.isIE?c?a.createNode(1,b,c):a.createElement(b):a.createElementNS(c,b)},destroyNode:function(a){var b=dojo.byId("IELeakGarbageBin");b||(b=dojo.create("div",{id:"IELeakGarbageBin",style:{display:"none"}},
- dojo.body()));dojo.place(a,b);dojo.attr(b,"innerHTML","");3!=a.nodeType&&dojo.isIE&&dojo.attr(a,"outerHTML","")},createDocument:function(a,b){return dojox.xml.parser.parse(a,b)},replaceChildren:function(a,b){return dojox.xml.parser.replaceChildren(a,b)},innerXML:function(a){return a?dojox.xml.parser.innerXML(a):null},removeChildren:function(a){return dojox.xml.parser.removeChildren(a)},copyChildren:function(a,b,c){a=a.cloneNode(!0);return this.moveChildren(a,b,c)},moveChildren:function(a,b,c){var d=
- 0;if(c){for(;a.hasChildNodes()&&3==a.firstChild.nodeType;)a.removeChild(a.firstChild);for(;a.hasChildNodes()&&3==a.lastChild.nodeType;)a.removeChild(a.lastChild)}for(;a.hasChildNodes();)b.appendChild(a.firstChild),d++;return d},getLocalName:function(a){if(!a)return null;switch(a.nodeType){case 3:return"#text";case 1:return a.localName||com.ibm.mm.enabler.utils.Dom.removeNodeNS(a.nodeName)}return null},getNodeNSPrefix:function(a){var a=""+a,b=a.indexOf(":");return-1!=b?a.substring(0,b):null},removeNodeNS:function(a){var b=
- ""+a,c=b.indexOf(":");return-1!=c?b.substring(1+c):a},lookupNamespaceURI:function(a,b){if(!dojo.isIE)return a.lookupNamespaceURI(b);for(var c=a;c&&9!=c.nodeType;){var d=c.getAttribute("xmlns:"+b);if(d)return d;c=c.parentNode}return null}};dojo.declare("com.ibm.mm.enabler.xml.xpath._Generic",null,{constructor:function(){},_evaluateXPath:function(a,b,c){return dojo.isSafari?this._safariEvaluateXPath(a,b,c):dojo.isIE?this._ieEvaluateXPath(a,b,c):this._geckoEvaluateXPath(a,b,c)},_transformNode:function(a,
- b){return "undefined"!=typeof XPathResult&&a instanceof XPathResult?this._xpathResultValue(a,b):b==com.ibm.mm.enabler.xml.xpath._Generic.ANY_TYPE?a:b==com.ibm.mm.enabler.xml.xpath._Generic.NUMBER_TYPE?parseFloat(com.ibm.mm.enabler.utils.Dom.textContent(a)):b==com.ibm.mm.enabler.xml.xpath._Generic.STRING_TYPE?com.ibm.mm.enabler.utils.Dom.textContent(a):b==com.ibm.mm.enabler.xml.xpath._Generic.BOOLEAN_TYPE?!!a:null},_xpathResultValue:function(a,b){return b==com.ibm.mm.enabler.xml.xpath._Generic.ANY_TYPE?
- a:b==com.ibm.mm.enabler.xml.xpath._Generic.NUMBER_TYPE?a.numberValue:b==com.ibm.mm.enabler.xml.xpath._Generic.STRING_TYPE?a.stringValue:b==com.ibm.mm.enabler.xml.xpath._Generic.BOOLEAN_TYPE?a.booleanValue:null},_evaluateXPathSingle:function(a,b,c,d){d=d||com.ibm.mm.enabler.xml.xpath._Generic.ANY_TYPE;if(dojo.isSafari){a=this._safariEvaluateXPathRaw(a,b,c,d);if(XPathResult&&a instanceof XPathResult)return d==com.ibm.mm.enabler.xml.xpath._Generic.ANY_TYPE?a.iterateNext():this._transformNode(a,d);if(a)return this._transformNode(a[0],
- d)}else if(dojo.isIE){if((a=this._ieEvaluateXPathRawSingle(a,b,c))||null===a)return this._transformNode(a,d)}else return(a=this._geckoEvaluateXPathRaw(a,b,c,d))&&d==com.ibm.mm.enabler.xml.xpath._Generic.ANY_TYPE?a.iterateNext():this._transformNode(a,d);return a||null},_geckoEvaluateXPath:function(a,b,c){a=this._geckoEvaluateXPathRaw(a,b,c,com.ibm.mm.enabler.xml.xpath._Generic.ANY_TYPE);b=[];if(a)for(;c=a.iterateNext();)b.push(c);return b},_geckoEvaluateXPathRaw:function(a,b,c,d){var e=b;9!=b.nodeType&&
- (e=b.ownerDocument);return e.evaluate(a,b,function(a){return c[a]?c[a].toString():null},d,null)},_ieEvaluateXPath:function(a,b,c){return this._ieEvaluateXPathRaw(a,b,c)||[]},_setIeNamespaces:function(a,b){if(b){var c=[],d,e;for(e in b)d=b[e],"xml"!=e&&c.push("xmlns:",e,"='",d,"' ");if(dojo.isIE !=11 && dojo.isIE !=10){d=a.ownerDocument||a;d.setProperty("SelectionNamespaces",c.join(""));d.setProperty("SelectionLanguage","XPath")}}},_ieEvaluateXPathRaw:function(a,b,c){this._setIeNamespaces(b,c);return b.selectNodes(a)},_ieEvaluateXPathRawSingle:function(a,
- b,c){this._setIeNamespaces(b,c);return b.selectSingleNode(a)},_safariEvaluateXPath:function(a,b,c){a=this._safariEvaluateXPathRaw(a,b,c,com.ibm.mm.enabler.xml.xpath._Generic.ANY_TYPE);if(XPathResult&&a instanceof XPathResult){for(b=[];c=a.iterateNext();)b.push(c);return b}return a||[]},_safariEvaluateXPathRaw:function(a,b,c,d){if("undefined"!=typeof XPathResult)return document.evaluate(a,b,function(a){return c[a]?c[a].toString():null},d,null);if(b.selectNodes)return b.selectNodes(a)}});com.ibm.mm.enabler.xml.xpath._Generic.ANY_TYPE=
- 0;com.ibm.mm.enabler.xml.xpath._Generic.NUMBER_TYPE=1;com.ibm.mm.enabler.xml.xpath._Generic.STRING_TYPE=2;com.ibm.mm.enabler.xml.xpath._Generic.BOOLEAN_TYPE=3;dojo.declare("com.ibm.mm.enabler.xml.XPathImpl",[com.ibm.mashups.enabler.xml.XPath,com.ibm.mm.enabler.xml.xpath._Generic],{modelMessages:null,constructor:function(){this.modelMessages=dojo.i18n.getLocalization("com.ibm.mm.enabler","modelMessages")},ANY_TYPE:com.ibm.mm.enabler.xml.xpath._Generic.ANY_TYPE,NUMBER_TYPE:com.ibm.mm.enabler.xml.xpath._Generic.NUMBER_TYPE,
- STRING_TYPE:com.ibm.mm.enabler.xml.xpath._Generic.STRING_TYPE,BOOLEAN_TYPE:com.ibm.mm.enabler.xml.xpath._Generic.BOOLEAN_TYPE,evaluateXPath:function(a,b,c){if(!dojo.isString(a)||0===a.length)throw Error(this.modelMessages.E_INVALID_XPATH_EXPR_0);if(!b)throw Error(this.modelMessages.E_INVALID_DOCUMENT_0);return this._evaluateXPath(a,b,c)},evaluateSingle:function(a,b,c,d){if(!dojo.isString(a)||0===a.length)throw Error(this.modelMessages.E_INVALID_XPATH_EXPR_0);if(!b)throw Error(this.modelMessages.E_INVALID_DOCUMENT_0);
- return this._evaluateXPathSingle(a,b,c,d)},evaluateEntry:function(a,b,c){return this.evaluateSingle(a,b,c,com.ibm.mashups.enabler.xml.XPath.ANY_TYPE)},evaluateBoolean:function(a,b,c){return this.evaluateSingle(a,b,c,com.ibm.mashups.enabler.xml.XPath.BOOLEAN_TYPE)},evaluateString:function(a,b,c){return this.evaluateSingle(a,b,c,com.ibm.mashups.enabler.xml.XPath.STRING_TYPE)},evaluateNumber:function(a,b,c){return this.evaluateSingle(a,b,c,com.ibm.mashups.enabler.xml.XPath.NUMBER_TYPE)},createXPath:function(a,
- b,c){var d=a.split("/"),e=d[0].split(":"),f;1<e.length?(f=e[0],e=e[1]):e=e[0];var g=com.ibm.mashups.enabler.xml.XPath.evaluateXPath((f?f+":":"")+e,b,c);g&&0<g.length?f=g[0]:(f=com.ibm.mm.enabler.utils.Dom.createElement(b.ownerDocument,(f?f+":":"")+e,f?c[f]:null),b.appendChild(f));1<d.length&&(f=com.ibm.mashups.enabler.xml.XPath.createXPath(a.substr(a.indexOf("/")+1),f,c));return f}});com.ibm.mashups.enabler.xml.XPath=new com.ibm.mm.enabler.xml.XPathImpl;com.ibm.mm.enabler.xml.xpath.evaluateXPath=
- function(a,b,c){return com.ibm.mm.enabler.xml.xpath._Generic.evaluateXPath.apply(null,arguments)};com.ibm.mm.enabler.utils.LocaleHelper={getLocale:function(a,b,c){if("undefined"==typeof a||null===a)return null;a=a.getLocales();if("undefined"==typeof a||(null===a||!dojo.isArray(a))||0===a.length)return null;var d=null;1===a.length&&(d=a[0]);var e={},f;for(f in a)if(Object.prototype.hasOwnProperty.call(a,f)){var g=a[f];e[g]=g}null===d&&("undefined"!=typeof b&&null!==b)&&(d=this.findMatchLocale(e,b),
- null===d&&(b=b.split(/-|_/),2==b.length&&(b=b[0],"undefined"!=typeof e[b]&&null!==e[b]&&(d=b))));null===d&&(b=(dojo.isIE?navigator.userLanguage:navigator.language).toLowerCase(),"undefined"!=typeof ibmConfig&&(ibmConfig&&"undefined"!=typeof ibmConfig.locale&&ibmConfig.locale)&&(b=ibmConfig.locale),null!==b&&(d=this.findMatchLocale(e,b),null===d&&(b=b.split(/-|_/),2==b.length&&(b=b[0],"undefined"!=typeof e[b]&&null!==e[b]&&(d=b)))));null===d&&c&&(d=c);null===d&&e.en&&(d="en");null===d&&(d=a[0]);return d},
- findMatchLocale:function(a,b){var c=null;a[b]&&(c=b);var d=this.toServerLocale(b);null===c&&a[d]&&(c=d);d=d.toLowerCase();null===c&&a[d]&&(c=d);return c},matchLocale:function(a,b){return com.ibm.mm.enabler.utils.LocaleHelper._matchLocale(com.ibm.mm.enabler.utils.LocaleHelper._getLocaleObj(a),com.ibm.mm.enabler.utils.LocaleHelper.normalizeLocale(b))},_matchLocale:function(a,b,c){var d=a,e=null;if(dojo.some(b,function(b){if(b==com.ibm.mm.enabler.utils.LocaleHelper.normalizeLocale(a.toString()))return e=
- b,!0})&&e)return e;if(a.variant)return a.variant=null,com.ibm.mm.enabler.utils.LocaleHelper._matchLocale(a,b);if(a.country)return a.country=null,com.ibm.mm.enabler.utils.LocaleHelper._matchLocale(a,b);if(!c){a=d;switch(a.language){case "he":a.language="iw";break;case "iw":a.language="he"}return com.ibm.mm.enabler.utils.LocaleHelper._matchLocale(a,b,!0)}return null},toServerLocale:function(a){if(!a)return null;if(0>a.indexOf("-"))return a;var a=a.replace(/-/,"_"),b=a.split("_"),a=b[0],b=b[1].toUpperCase();
- return a+"_"+b},_getLocaleObj:function(a){if(dojo.isArray(a))return dojo.map(a,function(a){return com.ibm.mm.enabler.utils.LocaleHelper._getLocaleObj(a)});if(dojo.isString(a)&&0<dojo.string.trim(a).length){var b={language:null,country:null,variant:null,toString:function(){return this.language?this.language+(this.country?"_"+this.country+(this.variant?"_"+this.variant:""):""):""},isValid:function(){return!!this.language}},a=dojo.string.trim(a).replace(/-/g,"_").split("_");switch(a.length){case 3:b.variant=
- a[2];case 2:b.country=a[1].toUpperCase();case 1:b.language=a[0].toLowerCase()}return b}return null},normalizeLocale:function(a){return dojo.isArray(a)?dojo.map(a,function(a){return com.ibm.mm.enabler.utils.LocaleHelper.normalizeLocale(a)}):a&&dojo.isString(a)?a.replace(/_/g,"-").toLowerCase():null}};dojo.declare("com.ibm.mm.enabler.model.NameSpaceFactoryImpl",null,{constructor:function(){this.NS_APP="app";this.NS_ATOM="atom";this.NS_THR="thr";this.NS_UM="um";this.NS_XHTML="xhtml";this.NS_XML="xml";
- this.NS_XSI="xsi";this.NS_OPENSEARCH="opensearch";this.NS_CM="cm";this.NS_CA="ca";this.NS_AC="ac";this.NS_EVENT_DATATYPES="event-datatypes";this.NS_XMLNS="xmlns";this.NS_XSD="xsd";this.NS_JS="js";this.namespaces={};this.namespaces[this.NS_APP]="http://www.w3.org/2007/app";this.namespaces[this.NS_ATOM]="http://www.w3.org/2005/Atom";this.namespaces[this.NS_THR]="http://purl.org/syndication/thread/1.0";this.namespaces[this.NS_UM]="http://www.ibm.com/xmlns/prod/websphere/um.xsd";this.namespaces[this.NS_XHTML]=
- "http://www.w3.org/1999/xhtml";this.namespaces[this.NS_XML]="http://www.w3.org/XML/1998/namespace";this.namespaces[this.NS_XSI]="http://www.w3.org/2001/XMLSchema-instance";this.namespaces[this.NS_XMLNS]="http://www.w3.org/2000/xmlns/";this.namespaces[this.NS_OPENSEARCH]="http://a9.com/-/spec/opensearch/1.1/";this.namespaces[this.NS_CM]="http://www.ibm.com/xmlns/prod/composite-applications/v1.0";this.namespaces[this.NS_CA]="http://www.ibm.com/xmlns/prod/composite-applications/v1.0";this.namespaces[this.NS_AC]=
- "http://www.ibm.com/xmlns/prod/lotus/access-control/v1.0";this.namespaces[this.NS_EVENT_DATATYPES]="http://www.ibm.com/xmlns/prod/lotus/mashups/event-datatypes";this.namespaces[this.NS_XSD]="http://www.w3.org/2001/XMLSchema";this.namespaces[this.NS_JS]="text/javascript"},getNameSpaces:function(a){for(var b={},c=a.length,d=0;d<c;d++){var e=a[d];b[e]=this.namespaces[e]}return b},getNameSpaceUri:function(a){return this.namespaces[a]}});com.ibm.mm.enabler.model.NameSpaceFactory=new com.ibm.mm.enabler.model.NameSpaceFactoryImpl;
- dojo.declare("com.ibm.mm.enabler.context.LocalizedContextImpl",[com.ibm.mashups.enabler.context.LocalizedContext],{constructor:function(a,b){var c=com.ibm.mm.enabler.model.NameSpaceFactory;this.ns=c.getNameSpaces([c.NS_ATOM,c.NS_XML]);this.basicFallback=!(a||b);this.preferredLocale=a||null;null===this.preferredLocale&&(this.preferredLocale="undefined"!=typeof ibmConfig&&null!==ibmConfig&&"undefined"!=typeof ibmConfig.locale&&null!==ibmConfig.locale?ibmConfig.locale:(dojo.isIE?navigator.userLanguage:
- navigator.language).toLowerCase());this.defaultLocale=b||"en";this._DEFAULT_TITLE="atom:title";this._DEFAULT_DESCRIPTION="atom:summary";this._DEFAULT_LOCALE=this._DEFAULT_TITLE+"/@xml:lang"},getPreferredLocale:function(){return this.preferredLocale},getDefaultLocale:function(){return this.defaultLocale},getLocale:function(a){if("undefined"==typeof a||null===a)return null;if(this.basicFallback&&dojo.isFunction(a.getDefaultLocale))return a.getDefaultLocale();a=a.getLocales();switch(a.length){case 0:return null;
- case 1:return com.ibm.mm.enabler.utils.LocaleHelper.normalizeLocale(a[0]);default:var b=com.ibm.mm.enabler.utils.LocaleHelper.matchLocale(this.preferredLocale,a);return b?b:(b=com.ibm.mm.enabler.utils.LocaleHelper.matchLocale(this.defaultLocale,a))?b:com.ibm.mm.enabler.utils.LocaleHelper.normalizeLocale(a[0])}},getTitle:function(a){if("undefined"==typeof a||null===a)return null;var b;this.basicFallback&&dojo.isFunction(a.getDefaultTitle)&&(b=a.getDefaultTitle());if(!b){var c=this.getLocale(a);c&&
- (b=a.getTitle(c))}"undefined"==typeof b&&(b=null);return b},getDescription:function(a){if("undefined"==typeof a||null===a)return null;var b;this.basicFallback&&dojo.isFunction(a.getDefaultDescription)&&(b=a.getDefaultDescription());if(!b){var c=this.getLocale(a);c&&(b=a.getDescription(c))}"undefined"==typeof b&&(b=null);return b},getDisplayLocale:function(a){a=dojo.isArray(a)?a:[a];if(ibmConfig&&ibmConfig.displayLocale){var b=ibmConfig.displayLocale.split(",");com.ibm.mm.enabler.utils.LocaleHelper.normalizeLocale(b);
- for(var c=0;c<b.length;c++){var d=b[c];if(d&&com.ibm.mm.enabler.utils.LocaleHelper.matchLocale(d,a))return d}}return a[0]}});dojo.declare("com.ibm.mashups.enabler.context.PageContext",null,{setBrowserTitle:function(){}});dojo.declare("com.ibm.mm.enabler.context.PageContextImpl",[com.ibm.mashups.enabler.context.PageContext],{constructor:function(){},setBrowserTitle:function(a){dojo.doc.title=a.replace(/&/g,"&").replace(/"/g,'"').replace(/>/g,">").replace(/</g,"<")}});com.ibm.mm.enabler.context.PageContext=
- new com.ibm.mm.enabler.context.PageContextImpl;dojo.declare("com.ibm.mashups.enabler.context.Factory",null,{getLocalizedContext:function(){},getLocalizedContext:function(){},getPageContext:function(){}});dojo.declare("com.ibm.mm.enabler.context.FactoryImpl",[com.ibm.mashups.enabler.context.Factory],{constructor:function(){},getLocalizedContext:function(a,b){return new com.ibm.mm.enabler.context.LocalizedContextImpl(a,b)},getPageContext:function(){return new com.ibm.mm.enabler.context.PageContextImpl}});
- com.ibm.mashups.enabler.context.Factory=new com.ibm.mm.enabler.context.FactoryImpl;dojo.declare("com.ibm.mashups.enabler.services.ConfigConstants",null,{PROXY_URL:"com.ibm.mashups.proxy.url",HUB_URL:"com.ibm.mashups.hub.url",LOGIN_URL:"com.ibm.mashups.url.login",LOGOUT_URL:"com.ibm.mashups.url.logout",CONTEXT_ROOT:"com.ibm.mashups.contextroot",CONTEXT_ROOT_ENABLER:"com.ibm.mashups.contextroot.enabler",CONTEXT_ROOT_BUILDER:"com.ibm.mashups.contextroot.builder",CONTENTHANDLER_PUBLIC:"com.ibm.mashups.contenthandler.public",
- CONTENTHANDLER_PRIVATE:"com.ibm.mashups.contenthandler.private",EMBEDDING_PUBLIC:"com.ibm.mashups.embedding.public",EMBEDDING_PRIVATE:"com.ibm.mashups.embedding.private",THEMES_FEEDS_EXPIRATION:"themes.feed.expiration",AVAILABLE_LOCALES:"availableLocales",DEFAULT_LOCALE:"default.locale",DISPLAY_LOCALE:"displayLocale",TUNNEL_MODE:"tunnel.mode",CLIENT_IS_DEBUG:"isDebug",CLIENT_IS_BIDI:"isBidi",WIDGETDEFID_SANDBOX_DISABLED:"com.ibm.mashups.sandbox.force.disable",TRACE_CONFIG:"traceConfig",CLIENT_POPUP_CONSOLE:"popupConsole",
- CLIENT_ALLOW_PUBLISH_LOGGING:"allowPublishLogging",CLIENT_ALLOW_PUBLISH_TRACING:"allowPublishTracing",CLIENT_ADDITIONAL_SERVICES:"additionalServices",CLIENT_DEFAULT_THEME_ID:"com.ibm.mashups.theme.defaultThemeId",CLIENT_PAGE_SOURCE_READ_ONLY:"pageSourceReadOnly",CLIENT_AUTO_ACCEPT_SHARED_GROUPNAME:"autoAcceptSharedGroupName",AUTO_WIRING_DEFAULT_ENABLED:"autoWiringDefaultEnabled",CLIENT_USER_ID_KEY:"userIdKey",CLIENT_GROUP_CN_KEY:"groupCNKey",SERVICE_DOCUMENT_URL:"serviceDocumentUrl",MULTIPART_ENABLED:"com.ibm.mashups.multipart.enabled",
- MULTIPART_CORRELATE_HOSTS:"com.ibm.mashups.multipart.correlatehosts",MULTIPART_CACHE_QUERIES:"com.ibm.mashups.multipart.cachequeries",ENDPOINTS:"endpointIDs",ENDPOINT_CONFIG_PROVIDER:"Endpoints",ANONYMOUS_USER:"anonymousUser",NAVIGATION_HIDDEN:"com.ibm.mashups.navigation.hidden",SPACE_HIDDEN:"com.ibm.mashups.space.hidden",USER:"user",SUBDOMAINS:"subdomains",SERVERDOMAIN:"serverdomain",SANDBOXENABLED:"sandboxenabled",SUBDOMAINREUSE:"subdomainreuse",NAVSTATE_PERSISTENCE_URL:"navstate.persistence.url",
- NAVSTATE_PERSISTENCE_PSTORE:"navstate.persistence.pstore",NAVSTATE_PERSISTENCE_URL_LIMIT:"navstate.persistence.url.limit",NAVSTATE_PERSISTENCE_URL_SPLIMIT:"navstate.persistence.url.splimit",NAVSTATE_HUFFMANNENCODE_ENABLED:"navstate.huffmannencode.enabled",LOADING_HTML:"loadingHTML",PAGE_LOAD_OPTIMIZATION:"pageLoadOptimization",PAGE_LOAD_OPTIMIZATION_THEME:"pageLoadOptimizationTheme",PAGE_LOAD_OPTIMIZATION_APP_WIDGETS:"pageLoadOptimizationAppWidgets",ANONYMOUS_ALLOW_CREATE:"com.ibm.mashups.anonymous.allow.create",
- DEFAULT_USER_DISPLAY_PROP:"com.ibm.mashups.default.user.display.prop",PRODUCT_NAME:"com.ibm.mashups.productname",DEFAULT_GROUP_DISPLAY_PROP:"com.ibm.mashups.default.group.display.prop",WELCOME_SPACE_ID:"com.ibm.mashups.welcome.space.name",BUILDER_TITLE_FILTER_REGEXP:"com.ibm.mashups.builder.filter.title.regexp",ANON_VIRTUAL_USER_ID:"com.ibm.mashups.anonUserId",ALL_AUTH_VIRTUAL_GROUP_ID:"com.ibm.mashups.allAuthGroupId",SERVER_TYPE:"com.ibm.mashups.server",SERVER_TYPE_MASHUPS:"Lotus_Mashups",SERVER_TYPE_PORTAL:"WebSphere_Portal",
- SERVER_TYPE_BSPACE:"Business_Space",ANON_MODE_ENABLED:"com.ibm.mashups.anonymous.mode",AUTO_WILDCARD_DISABLED:"com.ibm.mashups.autoWildcardSearchDisabled",CONTEXT_MENU_NAME:"com.ibm.mashups.contextmenu.name",WIDGET_BUILDER_ENABLED:"com.ibm.mashups.widgetBuilder.enabled",CREATE_SPACE_TEMPLATE_MODE:"createSpaceOnTemplateMode",FAVORITE_SPACES_MAXIMUM_NUMBER:"favorite.spaces.maximum.number",RECENT_SPACES_MAXIMUM_NUMBER:"recent.spaces.maximum.number",REGISTER_LOADEDRESOURCES:"register.loadedresources",
- PERSISTENCE_MODE:"com.ibm.mashups.enabler.icontext.persistence.mode",PERSISTENCE_MODE_EVENTS:"com.ibm.mashups.enabler.icontext.persistence.mode.events",PERSISTENCE_MODE_EVENTS_MODIFIABLE:"com.ibm.mashups.enabler.icontext.persistence.mode.events.modifiable",PERSISTENCE_MODE_WIRES:"com.ibm.mashups.enabler.icontext.persistence.mode.wires",PERSISTENCE_MODE_WIRES_MODIFIABLE:"com.ibm.mashups.enabler.icontext.persistence.mode.wires.modifiable",PERSISTENCE_MODE_ATTRIBUTES:"com.ibm.mashups.enabler.icontext.persistence.mode.attributes",
- PERSISTENCE_MODE_ATTRIBUTES_MODIFIABLE:"com.ibm.mashups.enabler.icontext.persistence.mode.attributes.modifiable",PERSISTENCE_MODE_ATTRIBUTES_JSON_INJECTXML:"com.ibm.mashups.enabler.icontext.attributes.json.injectxml",ICONTEXT_AUTO_COMMIT:"com.ibm.mashups.enabler.icontext.autocommit",ID_PREFIX:"com.ibm.mashups.iWidget.idPrefix",API_ENFORCEMENT_MODE:"com.ibm.mashups.enabler.enforcement",API_ENFORCEMENT_MODE_WARN:"warning",API_ENFORCEMENT_MODE_ERROR:"error",NON_PREVIEWABLE_WIDGET_LOCATION:"com.ibm.mashups.enabler.layout.widget.NonPreviewableContentWidget.location",
- LIMIT_PAGE_DESCRIPTION:"com.ibm.mashups.persistence.page.description.limit",WIDGET_PERSONALIZE_ENABLED:"com.ibm.mashups.widget.attributes.personalize.enabled",SPACEMANAGER_PAGE_QUERYCOUNT:"com.ibm.mashups.spacemanager.page.queryCount",SPACEMANAGER_PAGE_QUERYKEYWORD:"com.ibm.mashups.spacemanager.page.queryKeyword",SPACEMANAGER_SPACE_QUERYCOUNT:"com.ibm.mashups.spacemanager.spacetemplate.queryCount",SPACEMANAGER_SPACE_QUERYKEYWORD:"com.ibm.mashups.spacemanager.spacetemplate.queryKeyword",LOCALAPPS_REGEX:"com.ibm.mashups.multipart.localapps.regex",
- SERVER_OBJECT_ID_FORMAT:"com.ibm.mashups.server.oid.format",QUEUE_RENDERING:"com.ibm.mashups.queueRendering"});com.ibm.mashups.enabler.services.ConfigConstants=new com.ibm.mashups.enabler.services.ConfigConstants;dojo.declare("com.ibm.mashups.enabler.services.ConfigObject",null,{getValue:function(){return null},getValueDeferred:function(){return null}});dojo.declare("com.ibm.mm.enabler.services.ConfigObjectDefaultImpl",[com.ibm.mashups.enabler.services.ConfigObject],{constructor:function(a,b){this.provider=
- a;this.configService=b;this.ns={};this.ns.app="http://www.w3.org/2007/app";this.ns.atom="http://www.w3.org/2005/Atom"},getPreferenceValue:function(a){return"all"==this.provider?this.configService.getValue(a):this._getValue(this.provider,a)},getValue:function(a){return"all"==this.provider?this.configService.getValue(a,internal):this._getValue(this.provider,a)},_getValue:function(){return null},getValueDeferred:function(a){return"all"==this.provider?new com.ibm.mm.enabler.DeferredImpl(this,function(a,
- c,d){c=a.getFinishedCallback();(d=this.configService.getValue(d,internal))&&c&&c(d,com.ibm.mm.enabler.model.HttpStatusCodes.HTTP_OK,a.getFinishedCallbackParameters());return d}):this._getValueDeferred(this.provider,a)},_getValueDeferred:function(){return null}});ibmConfig.enablerLayerModules&&0<=dojo.indexOf(ibmConfig.enablerLayerModules,"Base")&&dojo.require("com.ibm.mm.enabler.services.ConfigObjectExtendedImpl");dojo.declare("com.ibm.mashups.enabler.services.ConfigService",null,{SERVICE_NAME:"configService",
- getValue:function(){return null},getConfigObject:function(){return null},getConfigProviderNames:function(){return null}});com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME="configService";dojo.declare("com.ibm.mashups.services.ServiceManager",null,{constructor:function(){},getService:function(){}});dojo.declare("com.ibm.mm.services.ServiceManagerImpl",com.ibm.mashups.services.ServiceManager,{constructor:function(){this._serviceEntries={};ibmConfig=ibmConfig||{};ibmConfig.additionalServices=
- ibmConfig.additionalServices||null;if(ibmConfig.additionalServices){var a=dojo.fromJson(ibmConfig.additionalServices),b;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){var c=a[b];this._serviceEntries[c.name]=c}}},getService:function(a){var b=this._serviceEntries[a],b=b||null;if(null!==b){var c=b.serviceHandler;if(null===(c||null))c=(c=this._createService(b))||null,null===c?this._loadScript(b):this._serviceEntries[a].serviceHandler=c}return this._serviceEntries[a].serviceHandler},setService:function(a,
- b){b=b||null;if(null===b)return null;var c=this._serviceEntries[a];null!==(c||null)&&delete this._serviceEntries[a];this._serviceEntries[a]||(this._serviceEntries[a]={});dojo.isString(b)?this._serviceEntries[a].baseClass=b:this._serviceEntries[a].serviceHandler=b},_loadScript:function(a){var b=this;dojo.xhrGet({url:a.path,handleAs:"text",sync:!0,load:function(c){dojo.eval(c);c=b._createService(a);"undefined"!=typeof c&&null!==c&&(a.serviceHandler=c)},error:function(){}})},_createService:function(a){var b=
- null;try{b=new (dojo.getObject(a.baseClass))}catch(c){}return b}});com.ibm.mashups.services.ServiceManager=new com.ibm.mm.services.ServiceManagerImpl;dojo.declare("com.ibm.mm.enabler.services.AbstractConfigServiceImpl",com.ibm.mashups.enabler.services.ConfigService,{constructor:function(){},getPreferenceValue:function(a){return this.getValue(a)},getValue:function(a){return ibmConfig[a]},getConfigObject:function(){return null},getConfigProviderNames:function(){return null}});dojo.declare("com.ibm.mm.enabler.services.ConfigServiceDefaultImpl",
- [com.ibm.mm.enabler.services.AbstractConfigServiceImpl],{constructor:function(){},_getConfigObject:function(a){if(!ibmConfig["CO_"+a]){var b=new com.ibm.mm.enabler.services.ConfigObjectDefaultImpl(a,this);ibmConfig["CO_"+a]=b}return ibmConfig["CO_"+a]},_getConfigProviderNames:function(){var a=[];a.push("all");return a},getValue:function(a){return this.inherited(arguments,[a,!0])},getConfigObject:function(a){return this._getConfigObject(a)},getConfigProviderNames:function(){return this._getConfigProviderNames()}});
- com.ibm.mashups.services.ServiceManager.setService("configService","com.ibm.mm.enabler.services.ConfigServiceDefaultImpl");ibmConfig.enablerLayerModules&&0<=dojo.indexOf(ibmConfig.enablerLayerModules,"Base")&&dojo.require("com.ibm.mm.enabler.services.ConfigServiceExtendedImpl");dojo.declare("com.ibm.mashups.enabler.utils.EndpointHelper",null,{resolve:function(){return null}});dojo.declare("com.ibm.mm.enabler.EndpointUtilsDefaultImpl",null,{constructor:function(){},checkForEndpoints:function(){return null}});
- com.ibm.mm.enabler.EndpointUtils=new com.ibm.mm.enabler.EndpointUtilsDefaultImpl;ibmConfig.enablerLayerModules&&0<=dojo.indexOf(ibmConfig.enablerLayerModules,"iWidget")&&dojo.require("com.ibm.mm.enabler.EndpointUtilsExtendedImpl");dojo.declare("com.ibm.mm.enabler.utils.EndpointHelperImpl",null,{resolve:function(a){if(!a)return a;var b=com.ibm.mm.enabler.EndpointUtils.checkForEndpoints(a);return b?b:a}});com.ibm.mashups.enabler.utils.EndpointHelper=new com.ibm.mm.enabler.utils.EndpointHelperImpl;dojo.declare("com.ibm.mashups.enabler.utils.URLHelper",
- null,{rewriteURL:function(){return null}});com.ibm.mm.enabler.utils.Misc={forIn:function(a,b,c){if(a&&"object"==typeof a){var c=c||null,d,e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&(d=a[e],dojo.hitch(c,b)(d,e,a))}},encodePath:function(a,b){if(0===a.length)return a;for(var c=a.split("/"),d=0;d<c.length;++d)c[d]=b?com.ibm.mm.enabler.utils.Misc._pathPartUnescape(c[d]):com.ibm.mm.enabler.utils.Misc._pathPartEscape(com.ibm.mm.enabler.utils.Misc._pathPartUnescape(c[d]));return c.join("/")},
- _pathPartUnescape:function(a){return a=decodeURIComponent(a)},_pathPartEscape:function(a){a=encodeURIComponent(a);a=a.replace(/%3a/g,":");return a=a.replace(/%3A/g,":")},inStringArray:function(a,b){var c=!1,d;for(d in b)if(Object.prototype.hasOwnProperty.call(b,d)&&b[d]==a){c=!0;break}return c},isEmpty:function(a){if(null===a||"undefined"==typeof a)return!0;if(dojo.isString(a))return 0===a.length;for(var b in a)if(Object.prototype.hasOwnProperty.call(a,b))return!1;return!0},encodeModelID4Uri:function(a){var b=
- a.indexOf(":");if(-1!=b)var c=a.slice(0,b+1),a=a.slice(b+1),a=c+encodeURIComponent(a);return encodeURIComponent(a)},preloadImage:function(a,b,c){b=b&&c?new Image(b,c):new Image;b.src=a;return b},isInstanceOf:function(a,b){return a&&b?"function"==typeof a.isInstanceOf&&a.isInstanceOf(b)?!0:a instanceof b:!1},isPocUrl:function(a){var b={http:"http",https:"https",file:"file"},c=!1;if(0<a.indexOf(":")){if(0===a.indexOf("/")||0===a.indexOf("?"))return!1;a=a.substring(0,a.indexOf(":"));b[a]||(c=!0)}return c}};
- dojo.declare("com.ibm.mm.enabler.utils.HttpUrl",null,{constructor:function(a,b){if(!1!==b){var c=com.ibm.mm.enabler.EndpointUtils.checkForEndpoints(a);c&&(a=c)}this.pocurl=this._resolvePocUrl(a);this.pocurl||(this.scheme=this._extractScheme(a),this.server=this._extractServer(a),this.port=this._extractPort(a),this.path=this._extractPath(a),this.parameters=this._extractQuery(a),this.anchor=this._extractAnchor(a))},_resolvePocUrl:function(a){var b=null;com.ibm.mm.enabler.utils.Misc.isPocUrl(a)&&(b=this._getPrefix(),
- a=escape(unescape(a)),b=b.concat(a));return b},_getPrefix:function(){var a=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME),b=a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTEXT_ROOT),a=a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.ANONYMOUS_USER)?a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTENTHANDLER_PUBLIC):a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTENTHANDLER_PRIVATE);
- return b.concat(a).concat("?uri=")},addParameter:function(a,b){dojo.isString(this.parameters[a])?this.parameters[a]=[this.parameters[a],b]:dojo.isArray(this.parameters[a])?this.parameters[a].push(b):this.parameters[a]=b},setParameter:function(a,b){this.parameters||(this.parameters={});this.parameters[a]=b},getParameter:function(a){return!this.parameters?!1:this.parameters[a]},getParameters:function(){return this.parameters},isProxyNeeded:function(){var a=document.location;if(a.protocol!=this.scheme||
- !this._equalsServer(a.hostname))return!0;if(a.port==this.port)return!1;var b;return"http:"==this.scheme&&(b="80",""==a.port&&this.port==b||a.port==b&&""==this.port)||"https:"==this.scheme&&(b="443",""==a.port&&this.port==b||a.port==b&&""==this.port)?!1:!0},toServerRelativeString:function(a){if(this.pocurl)return this.pocurl;var b="";""!=this.path&&(b+="/"+com.ibm.mm.enabler.utils.Misc.encodePath(this.path,a));com.ibm.mm.enabler.utils.Misc.isEmpty(this.parameters)||(b+="?"+(a?this._parametersToQuery(this.parameters):
- dojo.objectToQuery(this.parameters)));""!=this.anchor&&(b+="#"+this.anchor);return b},toProxifiedString:function(){if(this.pocurl)return this.pocurl;if("undefined"==typeof ibmConfig)return this.toString();var a=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.PROXY_URL);if(!a)return this.toString();a+="/";if(window.location.protocol==this.scheme&&this._equalsServer(window.location.hostname)&&
- (window.location.port==this.port||"http:"==this.scheme&&""==window.location.port&&"80"==this.port||"https:"==this.scheme&&""==window.location.port&&"443"==this.port||"http:"==this.scheme&&"80"==window.location.port&&""==this.port||"https:"==this.scheme&&"443"==window.location.port&&""==this.port))return this.toString();a="https:"==this.scheme?a+("https/"+this.server+("443"!=this.port&&""!=this.port?":"+this.port:"")):a+("http/"+this.server+("80"!=this.port&&""!=this.port?":"+this.port:""));a+="/";
- ""!=this.path&&(a+=com.ibm.mm.enabler.utils.Misc.encodePath(this.path));com.ibm.mm.enabler.utils.Misc.isEmpty(this.parameters)||(a+="?"+dojo.objectToQuery(this.parameters));""!=this.anchor&&(a+="#"+this.anchor);return a},toString:function(a){if(this.pocurl)return this.pocurl;var b="";""!=this.server&&(b+=this.scheme+"//"+this.server,""!=this.port&&(b="http:"==this.scheme&&"80"==this.port?b+"":"https:"==this.scheme&&"443"==this.port?b+"":b+(":"+this.port)));b+="/";""!=this.path&&(b+=com.ibm.mm.enabler.utils.Misc.encodePath(this.path,
- a));com.ibm.mm.enabler.utils.Misc.isEmpty(this.parameters)||(b+="?"+(a?this._parametersToQuery(this.parameters):dojo.objectToQuery(this.parameters)));""!=this.anchor&&(b+="#"+this.anchor);return b},_parametersToQuery:function(a){var b="",c=function(a){b+=d+"="+a+"&"},d;for(d in a)dojo.isArray(a[d])?dojo.forEach(a[d],c):c(a[d]);b.lastIndexOf("&")===b.length-1&&(b=b.substr(0,b.length-1));return b},_isAbsolute:function(){return this._absoluteURL},_extractScheme:function(a){if(0===a.indexOf("/"))return window.location.protocol;
- var b=a.indexOf("://");if(-1==b)return this._absoluteURL=!1,window.location.protocol;this._absoluteURL=!0;return a.substring(0,b+1)},_extractServer:function(a){var b=a.indexOf(this.scheme),c="";0===b?(c=a.indexOf("/",b+this.scheme.length+2),c=(-1!=c?a.substring(b+this.scheme.length+2,c):a.substring(b+this.scheme.length+2)).split(":")[0]):(a=window.location.hostname,c=this._isIPv6(a)?"["+a+"]":a);return c},_extractPort:function(a){var b=a.indexOf(this.server),c="";if(0<=b){var d=a.indexOf("/",b),b=
- (-1!=d?a.substring(b,d):a.substring(b)).split(":");1<b.length&&(c=b[1])}""==c&&(c=0===a.indexOf("/")?window.location.port:"");return c},_extractPath:function(a){var b=0;0===a.indexOf(this.scheme)&&(b=this.scheme.length+2);var c="",b=a.indexOf("/",b),d=a.indexOf("?"),e=a.lastIndexOf("#");0<=d?c=a.substring(b+1,d):0<=e&&-1!=b?c=a.substring(b+1,e):-1!=b&&(c=a.substring(b+1));return c},_extractQuery:function(a){var b={},a=a.split("?");1<a.length&&(b=dojo.queryToObject(a[1].split("#")[0]));return b},_extractAnchor:function(a){var b=
- "",a=a.split("#");1<a.length&&(b=a[a.length-1]);return b},_isIPv6:function(a){return-1!=a.indexOf(":")},_equalsServer:function(a){return this.server==(this._isIPv6(a)?"["+a+"]":a)}});dojo.declare("com.ibm.mm.enabler.utils.URLHelperImpl",com.ibm.mashups.enabler.utils.URLHelper,{rewriteURL:function(a){return(new com.ibm.mm.enabler.utils.HttpUrl(a)).toProxifiedString()}});com.ibm.mashups.enabler.utils.URLHelper=new com.ibm.mm.enabler.utils.URLHelperImpl;com.ibm.mm.enabler.utils.URLHelper=com.ibm.mashups.enabler.utils.URLHelper;
- dojo.declare("com.ibm.mm.enabler.services.ConfigObjectExtendedImpl",[com.ibm.mm.enabler.services.ConfigObjectDefaultImpl],{constructor:function(a,b){this.valuesArray=null;this.provider=a;this.configService=b},_getValue:function(a,b){this.valuesArray||this._loadConfigData(a);return this.valuesArray[b]},_getValueDeferred:function(a,b){return new com.ibm.mm.enabler.DeferredImpl(this,function(b,d,e){var f=b.getFinishedCallback();if(this.valuesArray)this.valuesArray[e]&&f&&f(this.valuesArray[e],com.ibm.mm.enabler.model.HttpStatusCodes.HTTP_OK,
- b.getFinishedCallbackParameters());else{dojo.require("com.ibm.mashups.enabler.xml.XPath");dojo.require("com.ibm.mashups.enabler.model.url.ModelUrlFactory");dojo.require("com.ibm.mm.enabler.services.ModelRestServiceRequest");var g=ibmConfig["ConfigProvider."+a];if("undefined"!=typeof g||null!==g)a=g;g=com.ibm.mashups.enabler.model.url.ModelUrlFactory.createModelURL(com.ibm.mashups.enabler.model.url.ModelUrlFactory.CONFIG_URL,this);g.setSchemeSpecificPart("/"+a+"/*");var m=this;(new com.ibm.mm.enabler.services.ModelRestServiceRequest(g,
- null,null,!1,d)).read(function(a,d){m.valuesArray||(m.valuesArray={});var g=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("//atom:entry/atom:content/preferences/root/node/map/*",d,m.ns);if(g&&0<g.length)for(var h=0,k=g.length;h<k;h++){var n=g[h].getAttribute("key"),r=g[h].getAttribute("value");m.valuesArray[n]=r}m.valuesArray[e]&&f&&f(m.valuesArray[e],com.ibm.mm.enabler.model.HttpStatusCodes.HTTP_OK,b.getFinishedCallbackParameters())})}return this.valuesArray&&this.valuesArray[e]},b)},_loadConfigData:function(a){dojo.require("com.ibm.mashups.enabler.xml.XPath");
- dojo.require("com.ibm.mashups.enabler.model.url.ModelUrlFactory");dojo.require("com.ibm.mm.enabler.services.ModelRestServiceRequest");var b=ibmConfig["ConfigProvider."+a];if("undefined"!=typeof b||null!==b)a=b;var c={},b=com.ibm.mashups.enabler.model.url.ModelUrlFactory.createModelURL(com.ibm.mashups.enabler.model.url.ModelUrlFactory.CONFIG_URL,this);b.setSchemeSpecificPart("/"+a+"/*");var d=this;(new com.ibm.mm.enabler.services.ModelRestServiceRequest(b,null,null,!1,!0)).read(function(a,b){var g=
- com.ibm.mashups.enabler.xml.XPath.evaluateXPath("//atom:entry/atom:content/preferences/root/node/map/*",b,d.ns);if(g&&0<g.length)for(var m=0;m<g.length;m++){var p=g[m].getAttribute("key"),h=g[m].getAttribute("value");c[p]=h}});this.valuesArray=c}});dojo.declare("com.ibm.mashups.enabler.strategy.Strategy",null,{});dojo.declare("com.ibm.mashups.enabler.model.Model",null,{setStrategy:function(){},getStrategies:function(){},getStrategy:function(){},addStrategy:function(){},removeStrategy:function(){}});
- dojo.declare("com.ibm.mashups.enabler.strategy.NoCacheStrategy",com.ibm.mashups.enabler.strategy.Strategy,{_apply:function(a){a.setHeader("Pragma","no-cache");a.setHeader("Cache-Control","no-cache");a.setHeader("If-Modified-Since","Thu, 1 Jan 1970 00:00:00 GMT")}});dojo.declare("com.ibm.mm.enabler.model.ModelImpl",com.ibm.mashups.enabler.model.Model,{strategy:null,constructor:function(){this.modelMessages=dojo.i18n.getLocalization("com.ibm.mm.enabler","modelMessages")},setStrategy:function(a){null===
- a||"undefined"==typeof a?this.strategy=null:com.ibm.mm.enabler.utils.Misc.isInstanceOf(a,Array)?0<a.length&&(this.strategy=[],dojo.forEach(a,function(a){this.strategy.push(a);this._preprocessStrategy(a)},this)):(this.strategy=[a],this._preprocessStrategy(a))},getStrategies:function(){return this.strategy||[]},addStrategy:function(a){if(null===a||"undefined"==typeof a)throw Error(this.modelMessages.E_PARAM_ISNULL_0);null===this.strategy&&(this.strategy=[]);this._preprocessStrategy(a);for(var b=0,c=
- this.strategy.length;b<c;b++)if(this.strategy[b].declaredClass&&a instanceof dojo.getObject(this.strategy[b].declaredClass))return this.strategy[b]=a,b;return this.strategy.push(a)-1},removeStrategy:function(a){if(null===a||"undefined"==typeof a)throw Error(this.modelMessages.E_PARAM_ISNULL_0);this.strategy&&(dojo.isString(a)&&(a=this._getIndexOfStrategyByType(a)),!isNaN(a)&&(a<this.strategy.length&&0<=a)&&this.strategy.splice(a,1+a))},getStrategy:function(a){return this.strategy?dojo.isString(a)?
- this._findStrategyByType(a):!isNaN(a)&&a<this.strategy.length&&0<=a?this.strategy[a]:null:null},_findStrategyByType:function(a){a=this._getIndexOfStrategyByType(a);return 0<=a?this.strategy[a]:null},_getIndexOfStrategyByType:function(a){if(this.strategy)for(var b=0,c=this.strategy.length;b<c;b++)if(this.strategy[b].declaredClass&&a==this.strategy[b].declaredClass)return b;return-1},_preprocessStrategy:function(a){com.ibm.mm.enabler.utils.Misc.isInstanceOf(a,com.ibm.mashups.enabler.strategy.NoCacheStrategy)&&
- dojo.isFunction(this.invalidate)&&this.invalidate()}});dojo.declare("com.ibm.mm.enabler.services.ModelRestServiceRequest",null,{REQUEST_METHOD_POST:"POST",REQUEST_METHOD_PUT:"PUT",REQUEST_METHOD_DELETE:"DELETE",POST_ACTION_HEADER:"X-Method-Override",MODIFICATION_COOKIE:"modified.id",constructor:function(a,b,c,d,e){com.ibm.mm.enabler.services.ModelRestServiceRequestStatic.getXRequestDigest()&&a.setParameter("digest",com.ibm.mm.enabler.services.ModelRestServiceRequestStatic.getXRequestDigest());this._feedURI=
- a.toProxifiedString();this._handleAs=(this._textOnly=d)?"text":"xml";this._sync=e;this._formNode=b;this._formFilter=c;this._config=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME);this._headers={};this.logoutVerificationForRaw=!1;this._sync||(this._sync=!1)},setHandleAs:function(a){this._handleAs="atom"==a?"xml":a},setHeader:function(a,b){this._headers[a]=b},enableLogoutVerificationForRawRetrieval:function(){this.logoutVerificationForRaw=
- !0},create:function(a,b,c){this._updateCookie();var d=this;dojo.rawXhrPost({url:this._feedURI,headers:{"Content-Type":"application/atom+xml; charset=utf-8"},load:function(a,f){var g=f.xhr,m=a,p=g.getResponseHeader("X-Request-Digest");null!==p&&com.ibm.mm.enabler.services.ModelRestServiceRequestStatic.setXRequestDigest(p);p=g.getResponseHeader("Content-Type");"undefined"!=typeof p&&null!==p&&0<=p.indexOf("text/html")?d._doLogin():(dojo.isIE&&(m=dojox.xml.parser.parse(g.responseText)),b(com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_LOAD,
- m,g,c))},error:function(a,f){var g=f.xhr;401==g.status?d._doLogin():b(com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_ERROR,null,g,c)},sync:this._sync,postData:a.toString(),handleAs:this._handleAs})},read:function(a,b){this._textOnly?this._retrieveRawFeed(a,b):this._retrieve(a,b)},update:function(a,b,c){this._updateCookie();var d=this,e={url:this._feedURI,load:function(a,e){var f=e.xhr,g=f.getResponseHeader("X-Request-Digest");null!==g&&com.ibm.mm.enabler.services.ModelRestServiceRequestStatic.setXRequestDigest(g);
- g=f.getResponseHeader("Content-Type");"undefined"!=typeof g&&null!==g&&0<=g.indexOf("text/html")?d._doLogin():dojo.partial(b)(com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_LOAD,a,f,c)},error:function(a,e){var f=e.xhr;401==f.status?d._doLogin():dojo.partial(b)(com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_ERROR,null,f,c)},sync:this._sync,handleAs:this._handleAs},f={"Content-Type":"application/atom+xml; charset=utf-8"},g=com.ibm.mashups.enabler.io.XHRMultipartFactory.create().isTransaction();
- !0===com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.TUNNEL_MODE)&&(!g||this._sync)?(f[this.POST_ACTION_HEADER]=this.REQUEST_METHOD_PUT,e.headers=f,e.postData=a,dojo.rawXhrPost(e)):(e.putData=a,e.headers=f,dojo.rawXhrPut(e))},remove:function(a,b){this._updateCookie();var c=this,d={url:this._feedURI,load:function(d,e){var m=com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_LOAD,
- p=d,h=e.xhr,k=h.getResponseHeader("X-Request-Digest");null!==k&&com.ibm.mm.enabler.services.ModelRestServiceRequestStatic.setXRequestDigest(k);k=h.getResponseHeader("Content-Type");"undefined"!=typeof k&&null!==k&&0<=k.indexOf("text/html")?c._doLogin():(dojo.isIE&&(p=dojox.xml.parser.parse(h.responseText)),a(m,p,h,b))},error:function(d,e){var m=e.xhr;401==m.status?c._doLogin():a(com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_ERROR,null,m,b)},sync:this._sync,handleAs:this._handleAs},
- e={"Content-Type":"application/atom+xml"};!0===com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.TUNNEL_MODE)?(e[this.POST_ACTION_HEADER]=this.REQUEST_METHOD_DELETE,d.headers=e,dojo.rawXhrPost(d)):(d.headers=e,dojo.xhrDelete(d))},_retrieveRawFeed:function(a,b){var c=this;dojo.xhrGet({url:this._feedURI,headers:this._headers,load:function(d,e){var f=e.xhr.getResponseHeader("X-Request-Digest");
- null!==f&&com.ibm.mm.enabler.services.ModelRestServiceRequestStatic.setXRequestDigest(f);c.logoutVerificationForRaw&&!f?c._doLogin():a(com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_LOAD,d,e.xhr,b)},error:function(d,e){401==e.xhr.status?c._doLogin():a(com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_ERROR,d,e.xhr,b)},sync:this._sync,handleAs:this._handleAs})},_retrieve:function(a,b){var c="xml";dojo.isIE&&(c="text");var d=this,c={url:this._feedURI,content:{},headers:this._headers,
- load:function(c,e){var m=e.xhr,p=m.getResponseHeader("X-Request-Digest");null!==p&&com.ibm.mm.enabler.services.ModelRestServiceRequestStatic.setXRequestDigest(p);p=m.getResponseHeader("Content-Type");"undefined"!=typeof p&&null!==p&&0<=p.indexOf("text/html")?d._doLogin():dojo.isIE?(p=com.ibm.mm.enabler.utils.Dom.createDocument(c),a(com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_LOAD,p,m,b)):a(com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_LOAD,c,m,b)},error:function(c,
- e){var m=e.xhr;if(401==m.status)d._doLogin();else if(dojo.isIE){var p=null;try{c&&(p=com.ibm.mm.enabler.utils.Dom.createDocument(c))}catch(h){}a(com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_ERROR,p,m,b)}else a(com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_ERROR,c,m,b)},sync:this._sync,handleAs:c},e="Get";this._formNode&&(c.form=this._formNode,e="Post");this._formFilter&&(c.formFilter=this._formFilter);dojo["xhr"+e](c)},_updateCookie:function(){var a=new Date,b={};
- b.path=this._config.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTEXT_ROOT);dojo.cookie(this.MODIFICATION_COOKIE,a.getTime(),b)},_doLogin:function(){dojo.require("com.ibm.mashups.enabler.model.state.NavigationStateModelFactory");dojo.require("com.ibm.mashups.enabler.model.state.UrlGeneratorFactory");var a=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel();com.ibm.mashups.enabler.model.state.UrlGeneratorFactory.getURLGenerator().getUrl(a,function(a){a&&
- (top.location.href=a)},{nohash:"true"})},toString:function(){return this._feedURI}});com.ibm.mm.enabler.services.ModelRestServiceRequestStatic={xRequestDigest:null,getXRequestDigest:function(){null===this.xRequestDigest&&ibmConfig["com.ibm.resolver.digest"]&&(this.xRequestDigest=ibmConfig["com.ibm.resolver.digest"]);return this.xRequestDigest},setXRequestDigest:function(a){this.xRequestDigest=a},invalidateXRequestDigest:function(){var a=(new Date).getTime();this.setXRequestDigest(a);var b={},c=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME);
- b.path=c.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTEXT_ROOT);dojo.cookie("modified.id",a,b)}};com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_LOAD="load";com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_ERROR="error";dojo.declare("com.ibm.mm.enabler.services.XHRModelHeaderExtensionImpl",null,{constructor:function(){this.originalDojoXHR=dojo.xhr;dojo.xhr=dojo.hitch(this,function(a,b,c){b.headers||(b.headers={});b.headers["X-IBM-XHR"]="true";return this.originalDojoXHR(a,
- b,c)})}});com.ibm.mm.enabler.services.XHRModelHeaderExtension=new com.ibm.mm.enabler.services.XHRModelHeaderExtensionImpl;dojo.declare("com.ibm.mm.enabler.endpoints.XHREndpointExtensionImpl",null,{constructor:function(){this.originalDojoXHR=dojo.xhr;dojo.xhr=dojo.hitch(this,function(a,b,c){var d=com.ibm.mm.enabler.EndpointUtils.checkForEndpoints(b.url),d=d||null;null!==d&&(b.url=d);return this.originalDojoXHR(a,b,c)})}});com.ibm.mm.enabler.endpoints.XHREndpointExtension=new com.ibm.mm.enabler.endpoints.XHREndpointExtensionImpl;
- dojo.declare("com.ibm.mm.enabler.services.ConfigServiceExtendedImpl",[com.ibm.mm.enabler.services.ConfigServiceDefaultImpl],{constructor:function(){},_getConfigObject:function(a){if(!ibmConfig["CO_"+a]){var b=new com.ibm.mm.enabler.services.ConfigObjectExtendedImpl(a,this);ibmConfig["CO_"+a]=b}return ibmConfig["CO_"+a]},_getConfigProviderNames:function(){dojo.require("com.ibm.mashups.enabler.model.url.ModelUrlFactory");var a=[];a.push("all");var b=com.ibm.mashups.enabler.model.url.ModelUrlFactory.createModelURL(com.ibm.mashups.enabler.model.url.ModelUrlFactory.CONFIG_URL,
- this);b.setSchemeSpecificPart("/*");b.setParameter("rep","compact");var c=this;(new com.ibm.mm.enabler.services.ModelRestServiceRequest(b,null,null,!1,!0)).read(function(b,e){var f=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("//atom:entry/atom:id",e,c.ns);if(f&&0<f.length)for(var g=0,m=f.length;g<m;g++){var p=com.ibm.mm.enabler.utils.Dom.textContent(f[g]),h=p.indexOf("/",9),p=p.substring(8,h).trim(),k;for(k in ibmConfig)ibmConfig[k]===p&&(p=k.substring(15));a.push(p)}});return a}});com.ibm.mashups.services.ServiceManager.setService("configService",
- "com.ibm.mm.enabler.services.ConfigServiceExtendedImpl");dojo.declare("com.ibm.mashups.enabler.model.ServiceDocumentModel",null,{SERVICE_NAVIGATION:"navigation",SERVICE_SPACE_NAVIGATION:"space-navigation",SERVICE_SHARED_NAVIGATION:"shared-navigation",SERVICE_CONTENT:"content",SERVICE_CATALOG:"catalog",SERVICE_RESOURCE:"resource",SERVICE_WIDGET:"widget",SERVICE_THEME:"theme",SERVICE_USER:"user",SERVICE_MODEL:"model",SERVICE_MULTIPART:"multipart",SERVICE_HUFFMAN:"huffman",SERVICE_SITEMAP:"sitemap",
- SERVICE_SITEMAP_COMMITHANDLER:"commit-handler",SERVICE_COMPOSITE:"composite-applications",SERVICE_SPACE:"application",SERVICE_SPACE_FAVORITE:"application-favorite",SERVICE_TEMPLATE:"template",SERVICE_CONFIG:"config",SERVICE_FILESTORE:"filestore",SERVICE_WEBDAV:"webdav",invalidate:function(){},getModelCollections:function(){},getMashupsCollections:function(){},getCollectionData:function(){}});dojo.declare("com.ibm.mm.enabler.model.ServiceDocumentModelImpl",com.ibm.mashups.enabler.model.ServiceDocumentModel,
- {SERVICE_NAVIGATION:"navigation",SERVICE_SPACE_NAVIGATION:"space-navigation",SERVICE_SHARED_NAVIGATION:"shared-navigation",SERVICE_CONTENT:"content",SERVICE_CATALOG:"catalog",SERVICE_RESOURCE:"resource",SERVICE_WIDGET:"widget",SERVICE_THEME:"theme",SERVICE_USER:"user",SERVICE_MODEL:"model",SERVICE_MULTIPART:"multipart",SERVICE_HUFFMAN:"huffman",SERVICE_SITEMAP:"sitemap",SERVICE_SITEMAP_COMMITHANDLER:"commit-handler",SERVICE_COMPOSITE:"composite-applications",SERVICE_SPACE:"application",SERVICE_SPACE_FAVORITE:"application-favorite",
- SERVICE_TEMPLATE:"template",SERVICE_CONFIG:"config",SERVICE_FILESTORE:"filestore",SERVICE_WEBDAV:"webdav",constructor:function(){this.prefix="service";this.ns={atom:"http://www.w3.org/2005/Atom",app:"http://www.w3.org/2007/app",service:"http://www.ibm.com/xmlns/prod/sw/model/service/1.0"};this.max_version=this.xmlDataAsString=this.xmlData=null;this.cache=[]},getInstance:function(){var a=com.ibm.mm.enabler.model.ServiceDocumentModelImpl._instance;return a?a:com.ibm.mm.enabler.model.ServiceDocumentModelImpl._instance=
- new com.ibm.mm.enabler.model.ServiceDocumentModelImpl},invalidate:function(){this.max_version=this.xmlData=null},_loadAhead:function(){dojo.require("com.ibm.mashups.enabler.model.url.ModelUrlFactory");ibmConfig.servicedocument&&this.xmlDataAsString!=ibmConfig.servicedocument&&(this.xmlData=null);if(!this.xmlData){if(ibmConfig.servicedocument)this.xmlData=dojox.xml.parser.parse(ibmConfig.servicedocument),this.xmlDataAsString=ibmConfig.servicedocument;else{var a;ibmConfig.serviceDocumentUrl?a=new com.ibm.mm.enabler.utils.HttpUrl(ibmConfig.serviceDocumentUrl):
- (a=com.ibm.mashups.enabler.model.url.ModelUrlFactory.createModelURL("service",null),a.setNodes([{value:"collection",isID:!1}]));(new com.ibm.mm.enabler.services.ModelRestServiceRequest(a,null,null,!1,!0)).read(dojo.hitch(this,function(a,c){a==com.ibm.mm.enabler.services.ModelRestServiceRequest.XHR_STATUS_LOAD&&(this.xmlData=c)}))}this._fillCache()}},_fillCache:function(){this.max_version=null;ibmConfig.servicedocument_version_max&&(this.max_version=parseInt(ibmConfig.servicedocument_version_max.replace(/\./g,
- ""),10));var a,b,c,d=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("//app:collection",this.xmlData,this.ns);a=0;for(b=d.length;a<b;++a)(c=this._processCollection(a,d[a]))&&(this.cache[this.cache.length]=c);d=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("//service:collection",this.xmlData,this.ns);a=0;for(b=d.length;a<b;++a)(c=this._processCollection(a,d[a]))&&(this.cache[this.cache.length]=c)},getModelCollections:function(){this._loadAhead();for(var a=[],b=0,c=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("//atom:category[@term='enabler-ns-base']",
- this.xmlData,this.ns),d=0,e=c.length;d<e;++d){var f=c[d].parentNode,g=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("//atom:category[not (@term='enabler-ns-base' or @term='enabler-ns-model' or @term='enabler-ns-ext' or @term='enabler-ns-creationcontext' or @term='mashups')]",f,this.ns);if(g&&0<g.length){for(var m=[],p=0,h=g.length;p<h;++p)g[p].parentNode==f&&m.push(g[p].getAttribute("term"));m.sort();this._isDuplicate(a,m)||(a[b]=m,b++)}}return a},_isDuplicate:function(a,b){for(var c=!1,d=0;d<a.length;d++)if(a[d].length==
- b.length){for(var e=!0,f=0;f<b.length;f++)if(a[d][f]!=b[f]){e=!1;break}if(e){c=!0;break}}return c},getMashupsCollections:function(){this._loadAhead();for(var a=[],b=0,c=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("//atom:category[@term='mashups']",this.xmlData,this.ns),d=0,e=c.length;d<e;++d){var f=c[d].parentNode,g=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("//atom:category[not (@term='enabler-ns-base' or @term='enabler-ns-model' or @term='enabler-ns-ext' or @term='enabler-ns-creationcontext' or @term='mashups')]",
- f,this.ns);if(g&&0<g.length){for(var m=[],p=0,h=g.length;p<h;++p)g[p].parentNode==f&&m.push(g[p].getAttribute("term"));m.sort();this._isDuplicate(a,m)||(a[b]=m,b++)}}return a},getCollectionData:function(a){this._loadAhead();var b={};this.xmlData=this.xmlData||null;if(!this.xmlData)return b;b=[];b=dojo.isArray(a)?a:[a];return b=this._getCachedValue(b)},_getCachedValue:function(a){var b=[],c,d,e,f,g;c=0;for(d=this.cache.length;c<d;c++){var m=this.cache[c].id,p=0;j=0;for(e=m.length;j<e;j++){"mashups"==
- m[j]&&(p+=500);f=0;for(g=a.length;f<g;f++)m[j]==a[f]&&(p+=1E3)}e=parseInt(this.cache[c].version.replace(/\./g,""),10);p+=e;this.max_version&&e>this.max_version&&(p=-1E3);b[c]=p}d=-1;p=1E3;c=0;for(a=b.length;c<a;c++)b[c]>p&&(d=c,p=b[c]);return-1==d?null:this.cache[d]},_processCollection:function(a,b){var c={},d=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("app:categories//atom:category[@term]",b,this.ns),e=[];if(d)for(var f=0,g=d.length;f<g;f++){var m=d[f].getAttribute("term");0!==m.indexOf("enabler-ns-")&&
- e.push(m)}c.id=e;c.url=b.getAttribute("href");c.version=com.ibm.mm.enabler.utils.Dom.getAttributeWithNS(b,"service:version","version",this.ns.service);c.version||(c.version="1.0");c.template=com.ibm.mm.enabler.utils.Dom.getAttributeWithNS(b,"service:template","template",this.ns.service);c.idprefix="id";e={};if(d=com.ibm.mashups.enabler.xml.XPath.evaluateEntry("app:categories/atom:category[@term='enabler-ns-base']",b,this.ns))e.base=d.getAttribute("scheme"),-1==e.base.indexOf("/mashups/")&&(c.idprefix=
- "oid");if(d=com.ibm.mashups.enabler.xml.XPath.evaluateEntry("app:categories/atom:category[@term='enabler-ns-model']",b,this.ns))e.model=d.getAttribute("scheme");if(d=com.ibm.mashups.enabler.xml.XPath.evaluateEntry("app:categories/atom:category[@term='enabler-ns-ext']",b,this.ns))e.ext=d.getAttribute("scheme");(d=com.ibm.mashups.enabler.xml.XPath.evaluateEntry("app:categories/atom:category[@term='enabler-ns-creationcontext']",b,this.ns))&&(e["creation-context"]=d.getAttribute("scheme"));c.namespaces=
- e;if(d=com.ibm.mashups.enabler.xml.XPath.evaluateEntry("app:accept",b,this.ns))c.accept=d.firstChild.nodeValue;return c}});com.ibm.mm.enabler.model.ServiceDocumentModel=com.ibm.mm.enabler.model.ServiceDocumentModelImpl.prototype.getInstance();com.ibm.mashups.enabler.model.ServiceDocumentModel=com.ibm.mm.enabler.model.ServiceDocumentModel;dojo.declare("com.ibm.mashups.enabler.Commitable",null,{isDirty:function(){return!1},commit:function(){}});dojo.declare("com.ibm.mashups.enabler.DefaultLocalized",
- null,{getDefaultLocale:function(){},getDefaultTitle:function(){},getDefaultDescription:function(){}});dojo.declare("com.ibm.mashups.enabler.Iterator",null,{hasNext:function(){},next:function(){},size:function(){},setCursorPosition:function(){},getCursorPosition:function(){}});dojo.declare("com.ibm.mashups.enabler.DeferredIterator",[com.ibm.mashups.enabler.Deferred,com.ibm.mashups.enabler.Iterator],{setForEachCallback:function(){}});dojo.declare("com.ibm.mm.enabler.DeferredIteratorImpl",[com.ibm.mashups.enabler.DeferredIterator,
- com.ibm.mm.enabler.DeferredImpl],{setForEachCallback:function(a,b){this.foreachCallback=a;this.foreachCallbackParameters=b;return this},setForeachCallback:function(a,b){return this.setForEachCallback(a,b)},getForeachCallback:function(){return this.foreachCallback},getForeachCallbackParameters:function(){return this.foreachCallbackParameters},nextFinish:function(a){dojo.isFunction(this.getForeachCallback())&&dojo.partial(this.getForeachCallback())(a,this.getForeachCallbackParameters())},start:function(a){for(;this.hasNext(this,
- a);)this.next(this,a)}});dojo.declare("com.ibm.mashups.enabler.DeferredOperation",[com.ibm.mashups.enabler.Deferred],{OPERATION_GET:"GET",OPERATION_CREATE:"CREATE",OPERATION_MODIFY:"MODIFY",OPERATION_DELETE:"DELETE",setOperationCallback:function(){}});com.ibm.mashups.enabler.DeferredOperation.OPERATION_GET="GET";com.ibm.mashups.enabler.DeferredOperation.OPERATION_CREATE="CREATE";com.ibm.mashups.enabler.DeferredOperation.OPERATION_MODIFY="MODIFY";com.ibm.mashups.enabler.DeferredOperation.OPERATION_DELETE=
- "DELETE";dojo.declare("com.ibm.mm.enabler.model.HttpStatusCodesImpl",null,{HTTP_CONTINUE:"100",HTTP_SWITCHING_PROTOCOLS:"101",HTTP_OK:"200",HTTP_CREATED:"201",HTTP_BAD_REQUEST:"400",HTTP_NOT_FOUND:"404",HTTP_REQUEST_TIMEOUT:"408",HTTP_INTERNAL_SERVER_ERROR:"500",HTTP_SERVICE_UNAVAILABLE:"503"});com.ibm.mm.enabler.model.HttpStatusCodes=new com.ibm.mm.enabler.model.HttpStatusCodesImpl;dojo.declare("com.ibm.mm.enabler.DeferredOperationImpl",[com.ibm.mashups.enabler.DeferredOperation,com.ibm.mm.enabler.DeferredImpl],
- {operationCallback:null,operationCallbackParameters:null,setOperationCallback:function(a,b){this.operationCallback=a;this.operationCallbackParameters=b;return this},getOperationCallback:function(){return this.operationCallback},getOperationCallbackParameters:function(){return this.operationCallbackParameters},finishOperation:function(a,b,c){dojo.isFunction(this.getOperationCallback())&&(dojo.isOpera&&0===c&&(c=com.ibm.mm.enabler.model.HttpStatusCodes.HTTP_NOT_FOUND),dojo.partial(this.getOperationCallback())(a,
- b,c,this.getOperationCallbackParameters()))}});dojo.declare("com.ibm.mashups.enabler.DirtyFlagProvider",null,{isDirty:function(){},setDirty:function(){},setClean:function(){},addDirtyCallback:function(){},removeDirtyCallback:function(){}});dojo.declare("com.ibm.mm.enabler.DirtyFlagProviderImpl",com.ibm.mashups.enabler.DirtyFlagProvider,{_dirty:!1,setDirty:function(){this._setDirty()},_setDirty:function(){var a=!1===this._dirty;this._dirty=!0;this._dirtyCallbacks&&dojo.forEach(this._dirtyCallbacks,
- function(b){if((a||b.alwaysFire)&&dojo.isFunction(b.fn))dojo.hitch(b.ctx||null,b.fn)(b.args)},this)},setClean:function(){this._setClean()},_setClean:function(){this._dirty=!1},isDirty:function(){return this._dirty},_isDirty:function(){return this._dirty},addDirtyCallback:function(a,b,c,d){this._addDirtyCallback(a,b,c,d)},_addDirtyCallback:function(a,b,c,d){this._dirtyCallbacks||(this._dirtyCallbacks=[]);this._dirtyCallbacks.push({ctx:a,fn:b,args:c,alwaysFire:!!d})},removeDirtyCallback:function(a){this._removeDirtyCallback(a)},
- _removeDirtyCallback:function(a){if(this._dirtyCallbacks)for(var b=this._dirtyCallbacks.length;0<b;b--)if(a===this._dirtyCallbacks[b-1].fn){this._dirtyCallbacks.splice(b-1,1);break}}});dojo.declare("com.ibm.mashups.enabler.Discardable",null,{discard:function(){}});dojo.declare("com.ibm.mashups.enabler.Identifiable",null,{getID:function(){},getUniqueName:function(){}});dojo.declare("com.ibm.mashups.enabler.Invalidatable",null,{invalidate:function(){}});dojo.declare("com.ibm.mashups.enabler.Locator",
- null,{find:function(){}});dojo.declare("com.ibm.mashups.enabler.ListModel",[com.ibm.mashups.enabler.model.Model,com.ibm.mashups.enabler.Locator],{iterator:function(){}});dojo.declare("com.ibm.mashups.enabler.ListModelController",com.ibm.mashups.enabler.ListModel,{create:function(){},confirmCreate:function(){},insert:function(){},confirmInsert:function(){},remove:function(){},confirmRemove:function(){}});dojo.declare("com.ibm.mashups.enabler.Localized",null,{getLocales:function(){},getTitle:function(){},
- getTitles:function(){},getDescription:function(){},getDescriptions:function(){}});dojo.declare("com.ibm.mashups.enabler.ModifiableLocalized",com.ibm.mashups.enabler.Localized,{setTitle:function(){},confirmSetTitle:function(){},removeTitle:function(){},confirmRemoveTitle:function(){},removeTitles:function(){},confirmRemoveTitles:function(){},setDescription:function(){},confirmSetDescription:function(){},removeDescription:function(){},confirmRemoveDescription:function(){},removeDescriptions:function(){},
- confirmRemoveDescriptions:function(){}});dojo.declare("com.ibm.mashups.enabler.Representation",com.ibm.mashups.enabler.Identifiable,{getID:function(){},getURL:function(){},getMimeType:function(){}});dojo.declare("com.ibm.mm.enabler.RepresentationImpl",com.ibm.mashups.enabler.Representation,{constructor:function(a,b){this.url=a;this.type=b},getID:function(){return this.type},getURL:function(){return this.url},getMimeType:function(){return this.type}});dojo.declare("com.ibm.mashups.enabler.RepresentationProvider",
- null,{getAlternateModel:function(){}});dojo.declare("com.ibm.mm.enabler.RepresentationModelImpl",[com.ibm.mashups.enabler.ListModel,com.ibm.mm.enabler.DeferredIteratorImpl],{constructor:function(a){this.loadedNodes={};this.entries=[];this.cursor=0;this.strategy=this.num=this.start=this.size=null;if(a&&0<a.length){this.size=a.length;for(var b=0;b<a.length;b++){var c=a[b],d=c.getAttribute("href"),e=c.getAttribute("type"),c=e,d=new com.ibm.mm.enabler.RepresentationImpl(d,e);this.entries[b]=c;this.loadedNodes[c]=
- d}}},find:function(a){return new com.ibm.mm.enabler.DeferredImpl(this,this._find,a)},_find:function(a,b,c){return this._load(c,a,b)},start:function(a){for(;this._hasNext(this,a)&&this._next(this,a););},hasNext:function(){return this._hasNext(null,!0)},_hasNext:function(a,b){(null===this.start||this.cursor<this.start||this.cursor>=this.start+this.num&&this.size>this.cursor)&&this._loadAhead(a,b);return this.size>this.cursor},next:function(){return this._next(null,!0)},_next:function(a,b){return this._hasNext(a,
- b)?this.loadedNodes[this.entries[this.cursor++]]:null},size:function(){return this.size},setCursorPosition:function(a){this.cursor=a},getCursorPosition:function(){return this.cursor},setStrategy:function(a){this.strategy=com.ibm.mm.enabler.utils.Misc.isInstanceOf(a,Array)?a[0]:a},_load:function(a,b){a in this.loadedNodes&&b&&b.finish(this.loadedNodes[a],com.ibm.mm.enabler.model.HttpStatusCodes.HTTP_OK);return this.loadedNodes[a]},_loadAhead:function(){}});dojo.declare("com.ibm.mm.enabler.RepresentationProviderImpl",
- com.ibm.mashups.enabler.RepresentationProvider,{constructor:function(){this.serviceJson=com.ibm.mm.enabler.model.ServiceDocumentModel.getCollectionData(com.ibm.mm.enabler.model.ServiceDocumentModel.SERVICE_NAVIGATION);var a=com.ibm.mm.enabler.model.NameSpaceFactory;this.r_ns=dojo.delegate(this.serviceJson.namespaces,a.getNameSpaces([a.NS_ATOM,a.NS_XML]));this.XPATH="atom:link"},getAlternateModel:function(){var a=[],b=com.ibm.mashups.enabler.xml.XPath.evaluateXPath(this.XPATH,this.xmlData,this.r_ns);
- if(b&&0<b.length)for(var c=0,d=b.length;c<d;c++){var e=b[c],f=e.getAttribute("rel"),g=com.ibm.mm.enabler.utils.Dom.getAttributeWithNS(e,"ext:rel","rel",this.r_ns.ext);""==g&&(g=null);if((!f||"alternate"==f)&&!g)a[a.length]=e}return new com.ibm.mm.enabler.RepresentationModelImpl(a)}});dojo.declare("com.ibm.mashups.enabler.ResourceLocator",com.ibm.mashups.enabler.Locator,{findResourceUrl:function(){},findResourceURL:function(){}});dojo.declare("com.ibm.mashups.enabler.SubmittableForm",com.ibm.mashups.enabler.Identifiable,
- {getURL:function(){},getMethod:function(){},submit:function(){}});dojo.declare("com.ibm.mm.enabler.SubmittableFormImpl",com.ibm.mashups.enabler.SubmittableForm,{constructor:function(a,b,c){this.url=a;this.method=b;this.formId=c},getURL:function(){return this.url},getMethod:function(){return this.method},submit:function(){return new com.ibm.mm.enabler.DeferredImpl(this,this._submit)},_submit:function(a){dojo.io.iframe.send({url:this.url,method:this.method,handleAs:"text",form:document.getElementsByName(this.formId)[0],
- load:function(b){a&&a.finish(b,com.ibm.mm.enabler.model.HttpStatusCodes.HTTP_CREATED)},error:function(b){a&&a.finish(b,com.ibm.mm.enabler.model.HttpStatusCodes.HTTP_NOT_FOUND)}})}});dojo.declare("com.ibm.mashups.enabler.SubmittableFormProvider",null,{getSubmittableForm:function(){}});dojo.declare("com.ibm.mashups.enabler.model.url.ModelUrl",null,{constructor:function(){},setNodes:function(){},setSchemeSpecificPart:function(){},getSchemeSpecificPart:function(){return null},addParameter:function(){},
- setParameter:function(){},getParameter:function(){return null},getParameters:function(){return null},getAbsoluteURL:function(){return null},getProxifiedAbsoluteURL:function(){return null},getModelURI:function(){return null}});dojo.declare("com.ibm.mashups.enabler.model.url.ModelUrlFactory",null,{NAVIGATION_URL:"nav",LAYOUT_URL:"layout",SHARED_NAVIGATION_URL:"sharednav",FRAGMENT_URL:"fragment",FRAGMENT_MEDIA_URL:"fragment-media",USER_URL:"user",THEME_URL:"theme",THEME_MEDIA_URL:"theme-media",CATALOG_URL:"cat",
- CONFIG_URL:"config",SPACE_URL:"space",SPACE_FAVORITE_URL:"space-favorite",AC_URL:"ac",AI_URL:"ai",TEMPLATE_URL:"template",WIDGET_URL:"widget",EVENT_URL:"event",SUBMODEL_MEMBER:"member",SUBMODEL_ROLE:"role",SUBMODEL_ACCESS:"access",SUBMODEL_RESOURCE:"resource",RESOURCE_URL:"resource-service",constructor:function(){},createModelUrl:function(a,b){return new com.ibm.mashups.enabler.model.url.ModelUrl(a,b)},createModelURL:function(a,b){return new com.ibm.mashups.enabler.model.url.ModelUrl(a,b)},getModelUrl:function(a,
- b){return new com.ibm.mashups.enabler.model.url.ModelUrl(a,b)},getModelURL:function(a,b){return new com.ibm.mashups.enabler.model.url.ModelUrl(a,b)}});dojo.declare("com.ibm.mm.enabler.model.url.BaseModelUrl",[com.ibm.mashups.enabler.model.url.ModelUrl],{modelSchema:null,schemeSpecific:null,isMediaUrl:!1,httpUrl:null,VALUE:"value",IS_ID:"isID",SUBMODEL:"submodel",constructor:function(){this.nodes=[];this.prefix=null;this.subModelSchemeMap={};this.subModelSchemeMap[com.ibm.mashups.enabler.model.url.ModelUrlFactory.SUBMODEL_RESOURCE]=
- "resource";this.subModelSchemeMap[com.ibm.mashups.enabler.model.url.ModelUrlFactory.SUBMODEL_ROLE]="role";this.subModelSchemeMap[com.ibm.mashups.enabler.model.url.ModelUrlFactory.SUBMODEL_MEMBER]="member";this.subModelSchemeMap[com.ibm.mashups.enabler.model.url.ModelUrlFactory.SUBMODEL_ACCESS]="access"},_loadPrefix:function(){this.prefix||(this.serviceJson=com.ibm.mm.enabler.model.ServiceDocumentModel.getCollectionData(com.ibm.mm.enabler.model.ServiceDocumentModel.SERVICE_NAVIGATION),this.prefix=
- this.serviceJson.idprefix)},setPrimaryNode:function(a,b,c){var d={};d.value=a;d.isID=!1===b?b:!0;d.subModel=c;this.nodes[0]=d;this._updateURI()},setSecondaryNode:function(a,b,c){var d={};d.value=a;d.isID=!1===b?b:!0;d.subModel=c;this.nodes[1]=d;this._updateURI()},setNodes:function(a){this.nodes=a;for(var b=0;b<a.length;b++)a[b].isID=!1===a[b].isID?a[b].isID:!0;this._updateURI()},setSchemeSpecificPart:function(a){this.nodes=[];this.schemeSpecific=a;this._updateURI()},getSchemeSpecificPart:function(){if(this.schemeSpecific)return this.schemeSpecific;
- var a="";this.isMediaUrl&&(a="/");if(!this.nodes)return a;var b,c;if(this.isMediaUrl)for(b=0;b<this.nodes.length;b++)c=this.nodes[b],c.isID&&!this.prefix&&this._loadPrefix(),0<b&&(a=b<this.nodes.length-1?a+"@":a+"/"),a+=c.value;else for(b=0;b<this.nodes.length;b++)c=this.nodes[b],c.isID&&!this.prefix&&this._loadPrefix(),""!=a&&(a+="@"),c.subModel&&(a+=this.subModelSchemeMap[c.subModel]+":"),c.isID&&(a+=this.prefix+":"),a+=c.value;return a},_updateURI:function(){var a=this.modelSchema+":"+this.getSchemeSpecificPart();
- this.httpUrl.setParameter("uri",a)},addParameter:function(a,b){this.httpUrl.addParameter(a,b)},setParameter:function(a,b){this.httpUrl.setParameter(a,b)},getParameter:function(a){return this.httpUrl.getParameter(a)},getParameters:function(){return this.httpUrl.getParameters()},getAbsoluteURL:function(){return this.httpUrl.toString()},getProxifiedAbsoluteURL:function(){return this.httpUrl.toProxifiedString()},getModelURI:function(){return this.httpUrl.getParameter("uri")},toProxifiedString:function(){return this.httpUrl.toProxifiedString()}});
- dojo.declare("com.ibm.mm.enabler.model.url.SchemeBasedModelUrlImpl",[com.ibm.mm.enabler.model.url.BaseModelUrl],{constructor:function(a,b){this.modelSchema=a;this.model=b;var c=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME),d;d=""+c.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTEXT_ROOT);c=c.getValue(com.ibm.mashups.enabler.services.ConfigConstants.ANONYMOUS_USER)?c.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTENTHANDLER_PUBLIC):
- c.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTENTHANDLER_PRIVATE);this.httpUrl=new com.ibm.mm.enabler.utils.HttpUrl(d+c);this.httpUrl.setParameter("uri",this.modelSchema)}});dojo.declare("com.ibm.mm.enabler.model.url.SchemeBasedModelMediaUrlImpl",[com.ibm.mm.enabler.model.url.SchemeBasedModelUrlImpl],{constructor:function(){this.isMediaUrl=!0}});dojo.declare("com.ibm.mm.enabler.model.url.ThemeResourceUrlImpl",[com.ibm.mm.enabler.model.url.BaseModelUrl],{constructor:function(a,b){this.modelSchema=
- a;this.model=b;this.httpUrl=new com.ibm.mm.enabler.utils.HttpUrl("/");this.httpUrl.setParameter("uri",this.modelSchema)},_updateURI:function(){var a,b;2==this.nodes.length?(b=this.nodes[0].value,a=this.nodes[1].value,b=this.model.find(b).start()._getBaseUrl(),this.httpUrl=new com.ibm.mm.enabler.utils.HttpUrl(b+a)):3==this.nodes.length?(b=this.nodes[0].value,a=this.nodes[2].value,b=this.model.find(b).start()._getBaseUrl(),this.httpUrl=new com.ibm.mm.enabler.utils.HttpUrl(b+a)):this.httpUrl=new com.ibm.mm.enabler.utils.HttpUrl("/")}});
- dojo.declare("com.ibm.mm.enabler.model.url.StringBasedModelUrlImpl",[com.ibm.mm.enabler.model.url.BaseModelUrl],{constructor:function(a){com.ibm.mm.enabler.model.url.StringBasedModelUrlImpl.CONTEXT_ROOT||(com.ibm.mm.enabler.model.url.StringBasedModelUrlImpl.CONTEXT_ROOT=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTEXT_ROOT),com.ibm.mm.enabler.model.url.StringBasedModelUrlImpl.PRIVATE_HANDLER=
- com.ibm.mm.enabler.model.url.StringBasedModelUrlImpl.CONTEXT_ROOT+com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTENTHANDLER_PRIVATE),com.ibm.mm.enabler.model.url.StringBasedModelUrlImpl.PUBLIC_HANDLER=com.ibm.mm.enabler.model.url.StringBasedModelUrlImpl.CONTEXT_ROOT+com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTENTHANDLER_PUBLIC));
- if(0===a.indexOf("?")){var b;b=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.ANONYMOUS_USER)?com.ibm.mm.enabler.model.url.StringBasedModelUrlImpl.PUBLIC_HANDLER:com.ibm.mm.enabler.model.url.StringBasedModelUrlImpl.PRIVATE_HANDLER;a=""+b+a}this.httpUrl=new com.ibm.mm.enabler.utils.HttpUrl(a)}});dojo.declare("com.ibm.mm.enabler.model.url.ModelUrlFactoryImpl",[com.ibm.mashups.enabler.model.url.ModelUrlFactory],
- {WEBDAV_URL:"webdav",constructor:function(){this.schemeMap={};this.schemeMap[this.NAVIGATION_URL]="nm";this.schemeMap[this.SHARED_NAVIGATION_URL]="snm";this.schemeMap[this.FRAGMENT_URL]="fragment";this.schemeMap[this.FRAGMENT_MEDIA_URL]="fragment-media";this.schemeMap[this.USER_URL]="um";this.schemeMap[this.THEME_URL]="theme";this.schemeMap[this.THEME_MEDIA_URL]="theme-media";this.schemeMap[this.CATALOG_URL]="catalog";this.schemeMap[this.CONFIG_URL]="config";this.schemeMap[this.SPACE_URL]="space";
- this.schemeMap[this.SPACE_FAVORITE_URL]="space-favorite";this.schemeMap[this.AC_URL]="ac";this.schemeMap[this.AI_URL]="ai";this.schemeMap[this.TEMPLATE_URL]="template";this.schemeMap[this.LAYOUT_URL]="lm";this.schemeMap.service="service";this.schemeMap[this.WEBDAV_URL]="dav:mmdav";this.schemeMap[this.WIDGET_URL]="wm";this.schemeMap[this.EVENT_URL]="ce";this.schemeMap[this.RESOURCE_URL]="resource-service"},createModelUrl:function(a,b){return this.createModelURL(a,b)},createModelURL:function(a,b){var c=
- com.ibm.mashups.enabler.model.url.ModelUrlFactory.schemeMap[a];return!c?null:a==this.THEME_MEDIA_URL?new com.ibm.mm.enabler.model.url.ThemeResourceUrlImpl(c,b):a==this.FRAGMENT_MEDIA_URL?new com.ibm.mm.enabler.model.url.SchemeBasedModelMediaUrlImpl(c,b):new com.ibm.mm.enabler.model.url.SchemeBasedModelUrlImpl(c,b)},getModelUrl:function(a,b){return this.getModelURL(a,b)},getModelURL:function(a,b){return new com.ibm.mm.enabler.model.url.StringBasedModelUrlImpl(a,b)}});com.ibm.mm.enabler.model.UrlFactory=
- new com.ibm.mm.enabler.model.url.ModelUrlFactoryImpl;com.ibm.mashups.enabler.model.url.ModelUrlFactory=com.ibm.mm.enabler.model.UrlFactory;dojo.declare("com.ibm.mm.enabler.SubmittableFormProviderImpl",com.ibm.mashups.enabler.SubmittableFormProvider,{constructor:function(){},getSubmittableForm:function(a,b,c){var d=null;"spaceForm"==a?(d=new com.ibm.mashups.enabler.model.url.ModelUrlFactory.createModelURL(com.ibm.mashups.enabler.model.url.ModelUrlFactory.SPACE_URL,null),d.setNodes([{value:"collection",
- isID:!1}]),d.setParameter("mode","import"),d.setParameter("mime-type","text/html"),d=d.toProxifiedString(),d=new com.ibm.mm.enabler.SubmittableFormImpl(d,"post",a)):"pageForm"==a?(c=com.ibm.mm.enabler.model.ServiceDocumentModel.getCollectionData(com.ibm.mm.enabler.model.ServiceDocumentModel.SERVICE_RESOURCE),d=new com.ibm.mashups.enabler.model.url.ModelUrlFactory.getModelURL(c.url,this),d.setParameter("mode","import"),d.setParameter("mime-type","text/html"),b&&d.setParameter("spaceId",b),d=d.toProxifiedString(),
- d=new com.ibm.mm.enabler.SubmittableFormImpl(d,"post",a)):"spacePageForm"==a&&(d=new com.ibm.mashups.enabler.model.url.ModelUrlFactory.createModelURL(com.ibm.mashups.enabler.model.url.ModelUrlFactory.SPACE_URL,null),d.setNodes([{value:"collection",isID:!1}]),d.setParameter("mode","import"),d.setParameter("mime-type","text/html"),b&&d.setParameter("spaceId",b),a=null,c&&(a=c),d=d.toProxifiedString(),d=new com.ibm.mm.enabler.SubmittableFormImpl(d,"post",a));return d}});dojo.declare("com.ibm.mashups.enabler.TimeStamped",
- null,{getCreated:function(){},getLastModified:function(){}});dojo.declare("com.ibm.mashups.enabler.Transformable",null,{getXml:function(){},setXml:function(){}});dojo.declare("com.ibm.mm.enabler.TransformableImpl",[com.ibm.mashups.enabler.Transformable,com.ibm.mm.enabler.DirtyFlagProviderImpl],{constructor:function(){},getXml:function(){return this.xmlData},setXml:function(a,b){this.xmlData=a;this._resetCachedRawID&&this._resetCachedRawID();b||this._setDirty()}});dojo.declare("com.ibm.mashups.enabler.TreeModel",
- [com.ibm.mashups.enabler.model.Model,com.ibm.mashups.enabler.Locator],{getRoot:function(){},hasChildren:function(){},getChildren:function(){},getParent:function(){}});dojo.declare("com.ibm.mashups.enabler.TreeModelController",com.ibm.mashups.enabler.TreeModel,{create:function(){},confirmCreate:function(){},insert:function(){},confirmInsert:function(){},remove:function(){},confirmRemove:function(){}});dojo.declare("com.ibm.mashups.enabler.io.DynamicResolver",null,{SERVICE_NAME:"dynamicResolver",register:function(){},
- unregister:function(){}});com.ibm.mashups.enabler.io.DynamicResolver.SERVICE_NAME="dynamicResolver";dojo.declare("com.ibm.mm.enabler.io.XHRWrapper",null,{constructor:function(a,b,c,d,e){this.ioArgs=a;this.xhr=a.xhr;this.readyState=a.xhr.readyState;this.responseText=b;this.responseXML=a.xhr.responseXML;this.status=c;this.statusText=a.xhr.statusText;this.contentType=d;this.partHeaders=e},getAllResponseHeaders:function(){return this.xhr.getAllResponseHeaders()},getInterface:function(){return this.xhr.getInterface()},
- getResponseHeader:function(a){var b=a+"";return this.partHeaders[b]?this.partHeaders[b]:"content-type"==b.toLowerCase()?this.contentType:this.xhr.getResponseHeader(a)}});dojo.declare("com.ibm.mm.enabler.io.DynamicResolver",com.ibm.mashups.enabler.io.DynamicResolver,{constructor:function(){this._plugins=[];var a=this,b=dojo.xhr;dojo.xhr=function(){return(a.getResolver.apply(a,arguments)||b).apply(this,arguments)}},_buildDfdFn:function(a,b,c){var d=b[a];return d?function(a){return d.call(b,a,c)}:null},
- resolve:function(a,b,c,d){var c=null,e=!1,f=new dojo.Deferred,g={args:d,url:com.ibm.mm.enabler.EndpointUtils.checkForEndpoints(d.url)||d.url,handleAs:d.handleAs||"text",xhr:{readyState:4,responseXML:null,statusText:""}};f.addCallback(this._buildDfdFn("load",d,g)).addErrback(this._buildDfdFn("error",d,g)).addBoth(this._buildDfdFn("handle",d,g));g.xhr=new com.ibm.mm.enabler.io.XHRWrapper(g,"",200,"text",{});try{c=a(g.url,b),g.xhr.status=200,c&&(g.xhr.responseText=c,"xml"===d.handleAs&&"string"===typeof c&&
- (g.xhr.responseXML=com.ibm.mm.enabler.utils.Dom.createDocument(c)))}catch(m){g.xhr.status=500,c=m,g.xhr.responseText=m.toString(),e=!0}f[e?"errback":"callback"](c);return f},_embedValidation:function(a,b){var c=this;return function(d,e,f){return c.resolve(a,b,d,e,f)}},getResolver:function(a,b){if(a&&"get"==a.toLowerCase())for(var c=0;c<this._plugins.length;c++){var d=this._plugins[c],e=d[1](b.url);if(e)return this._embedValidation(d[2],e)}return null},register:function(a,b,c,d){this._plugins[d?"unshift":
- "push"]([a,b,c])},unregister:function(a){for(var b=0;b<this._plugins.length;b++)if(a===this._plugins[b][0]){this._plugins.splice(b,1);break}}});com.ibm.mashups.services.ServiceManager.setService(com.ibm.mashups.enabler.io.DynamicResolver.SERVICE_NAME,"com.ibm.mm.enabler.io.DynamicResolver");dojo.declare("com.ibm.mashups.enabler.io.XHRMultipart",null,{constructor:function(){},startTransaction:function(){},endTransactionDeferred:function(){},endTransaction:function(){},suspendTransaction:function(){},
- resumeTransaction:function(){},isTransaction:function(){return!1}});dojo.declare("com.ibm.mm.enabler.ServiceDocConsumer",null,{_noop:function(){},_initServiceDoc:function(){this._initServiceDoc=this._noop}});dojo.declare("com.ibm.mm.enabler.encode.huffman.ZEncoder",null,{HEX_CHARS:"0123456789ABCDEF".split(""),UNSAFE_CHARS:'$&+,/:;=?@ <>#%{}|\\^~[]`"Z',constructor:function(){},isUnsafeChar:function(a){return-1<this.UNSAFE_CHARS.indexOf(a)||32>=a.charCodeAt(0)||123<=a.charCodeAt(0)?!0:!1},zEncode:function(a){for(var b=
- "",c=0;c<a.length;++c)var d=a.charAt(c),b=this.isUnsafeChar(d)?b+this.zEncodeChar(d):b+d;return b},zEncodeChar:function(a){return"Z"+this.byteToHex(a.charCodeAt(0))},byteToHex:function(a){return this.HEX_CHARS[Math.floor(a/16)]+this.HEX_CHARS[a%16]},zDecode:function(a){var b="";if(-1!=a.indexOf("Z"))for(var c=0,d=a.length;c<d;c++)if("Z"==a.charAt(c)){var e="0x"+a.substr(c+1,2),c=c+2;try{var f=parseInt(e,16),b=b.concat(String.fromCharCode(f))}catch(g){}}else b=b.concat(a.substr(c,1));else b=a;return b}});
- com.ibm.mm.enabler.encode.huffman.ZEncoder=new com.ibm.mm.enabler.encode.huffman.ZEncoder;dojo.declare("com.ibm.mm.enabler.encode.huffman.HuffmanURL",null,{URL_ALPHABET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_!",constructor:function(){},_encodeTokens:function(a,b,c){for(var d=c.length,e=0;e<d;++e)this._addBits(a,b[c[e]].prefix);return this._encodeStream(a)},_encodeStream:function(a){var b=4*a.dwords.length;0<a.bits&&(a.dwords.push(a.dword),b+=a.bits+7>>3,a.bits=0);return this._encodeBase64(a.dwords,
- 0,b)},_initStream:function(a){a.dword=0;a.mask=1;a.bits=0;a.dwords=[];return a},_addBits:function(a,b){for(var c=a.mask,d=a.dword,e=a.bits,f=b.length,g=0;0<f;){for(var m=Math.min(f,32-e),p=0;p<m;++p)1==b[g+p]&&(d|=c),c<<=1;e+=m;f-=m;g+=m;32==e&&(a.dwords.push(d),e=0,c=1,d=0)}a.mask=c;a.bits=e;a.dword=d},_addBit:function(a,b){1==b&&(a.dword|=a.mask);a.mask<<=1;a.bits++;32==a.bits&&(a.dwords.push(a.dword),a.dword=0,a.mask=1,a.bits=0)},_encodeBase64:function(a,b,c){for(var d=this.URL_ALPHABET,e=b>>2,
- f=b&3,b=a[e++],g,m,p,h,k="";0<c;c-=3){switch(f){case 0:g=b>>2&63;m=b<<4&48|b>>12&15;p=b>>6&60|b>>22&3;h=b>>16&63;f=3;break;case 1:g=b>>10&63;m=b>>4&48|b>>20&15;p=b>>14&60|b>>30&3;h=b>>24&63;f=0;b=a[e++];break;case 2:f=a[e++];g=b>>18&63;m=b>>12&48|b>>28&15;p=b>>22&60|f>>6&3;h=f&63;b=f;f=1;break;case 3:f=a[e++],g=b>>26&63,m=b>>20&48|f>>4&15,p=f<<2&60|f>>14&3,h=f>>8&63,b=f,f=2}switch(c){case 1:h=p=64;break;case 2:h=64}k+=d.charAt(g);k+=d.charAt(m);k+=d.charAt(p);k+=d.charAt(h)}return k},_decodeBase64:function(a){for(var b=
- this.URL_ALPHABET,c=a.length/4,d=0,e=[],f=0;f<c;f++){var g=0;indexC1=b.indexOf(a.charAt(d++));indexC2=b.indexOf(a.charAt(d++));indexC3=b.indexOf(a.charAt(d++));64==indexC3&&g++;indexC4=b.indexOf(a.charAt(d++));64==indexC4&&g++;c1=indexC1<<2|indexC2>>4;c2=(indexC2&15)<<4|indexC3>>2;c3=(indexC3&3)<<6|indexC4;e.push(c1);switch(g){case 0:e.push(c2);e.push(c3);break;case 1:e.push(c2)}}return e},_frequencyCompare:function(a,b){return a.frequency-b.frequency},_initTree:function(a,b,c){b.left&&b.right?(this._addBit(a,
- 1),this._initTree(a,b.left,c.concat(0)),this._initTree(a,b.right,c.concat(1))):(this._addBit(a,0),b.prefix=c,a.tokens.push(b.name));return a},_dumpTokens:function(){},_buildTree:function(a){var b={},c=a.length,d,e;for(e=c-1;0<=e;--e)c=a[e],(d=b[c])?d.frequency++:(d={frequency:1,name:c},b[c]=d);e=[];for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&e.push(b[d]);for(e.sort(this._frequencyCompare);1<e.length;)c=e.shift(),d=e.shift(),e.push({frequency:c.frequency+d.frequency,left:c,right:d}),e.sort(this._frequencyCompare);
- d=this._initTree(this._initStream({tokens:[]}),e.shift(),[]);this._dumpTokens(d,b);var f=this._encodeStream(d),c=d.tokens.length;for(e=0;e<c;++e)f+="/"+com.ibm.mm.enabler.encode.huffman.ZEncoder.zEncode(d.tokens[e]);return f+="/"+this._encodeTokens(this._initStream({}),b,a)},_buildTreeFromRegex:function(a,b){for(var c=RegExp(b,"g"),d=[],e;e=c.exec(a);)d.push(e.index);d[0]&&d.unshift(0);d[d.length-1]!=a.length&&d.push(a.length);c=[];for(e=1;e<d.length;++e)c.push(a.substring(d[e-1],d[e]));return this._buildTree(c)},
- createRawSchemeSpecificPartFromTokens:function(a){return this._buildTree(a)},createRawSchemeSpecificPartFromRegex:function(a,b){return this._buildTreeFromRegex(a,b)},getDataFromHuffmanTree:function(a){return this._restoreData(a)},_restoreData:function(a){if(!a)return null;var b=a.indexOf("/"),c=a.lastIndexOf("/");if(0<=b&&0<=c){var d=this._decodeBase64(a.substring(0,b)),b=a.substring(b+1,c).split("/"),a=this._decodeBase64(a.substring(c+1));encodedTokens=this._decodeTokens(b);d=this._readStructure(this._convertBitToChar(d),
- encodedTokens);a=this._convertBitToChar(a);for(c="";0<a.length;)c=this._buildData(c,a,d);return c}return null},_buildData:function(a,b,c){for(var d=!1,e=null;!d;){e=b.shift();if("undefined"==typeof e){e=null;break}(e=this._getNode(e,c))&&e.token&&e.token?d=!0:e||(d=!0);c=e}d&&e&&(a=a.concat(e.token));return a},_getNode:function(a,b){var c=null,c=1==a?b.right:b.left;return!c?null:c},_convertBitToChar:function(a){for(var b=[],c=0,d=0;d<a.length;d++)for(var e=a[d],f=0;8>f;f++)c=e&1,b.push(c),e>>=1;return b},
- _readStructure:function(a,b){var c={};if(1==a.shift())c.left=this._readStructure(a,b),c.right=this._readStructure(a,b);else{var d=b.shift();c.token=d}return c},_decodeTokens:function(a){var b=[],c;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(com.ibm.mm.enabler.encode.huffman.ZEncoder.zDecode(a[c]));return b}});com.ibm.mm.enabler.encode.huffman.HuffmanURL=new com.ibm.mm.enabler.encode.huffman.HuffmanURL;dojo.declare("com.ibm.mm.enabler.ArrayMap",null,{constructor:function(){this.entries=
- [];this.keys={}},values:function(){return this.entries},put:function(a,b){var c=this.keys[a];"undefined"!=typeof c&&null!==c?this.entries[c]=b:(c=this.entries.length,this.entries.push(b),this.keys[a]=c)},getKey:function(a){if(a<this.entries.length)for(var b in this.keys){if(Object.prototype.hasOwnProperty.call(this.keys,b)){var c=this.keys[b];if(null!==c&&c==a)return c}}else return null},getValue:function(a){return a<this.entries.length?this.entries[a]:null},get:function(a){a=this.keys[a];return"undefined"!=
- typeof a&&null!==a?this.entries[a]:null},remove:function(a){var b=this.keys[a];"undefined"!=typeof b&&null!==b&&(this.entries.splice(b,1),this.keys[a]=null);return b},size:function(){return this.entries.length},keySet:function(){var a=[];com.ibm.mm.enabler.utils.Misc.forIn(this.keys,function(b,c){a.push(c)});return a}});dojo.declare("com.ibm.mm.enabler.io.XHRMultipartImpl",[com.ibm.mashups.enabler.io.XHRMultipart,com.ibm.mm.enabler.ServiceDocConsumer],{DYN_RES:com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.io.DynamicResolver.SERVICE_NAME),
- statics:{semaphore:0,digest:null,suspendedXhr:null},constructor:function(){this.method="POST";this.partsArray=null;var a=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME);this.correlateHosts=a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.MULTIPART_CORRELATE_HOSTS);this.correlatedHosts=null;this.cacheQueries=!1;var b=a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.MULTIPART_CACHE_QUERIES);"undefined"!==typeof b&&
- (null!==b&&!0===b)&&(this.cacheQueries=!0);this.privateUrl=a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTEXT_ROOT)+a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTENTHANDLER_PRIVATE);this.publicUrl=a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTEXT_ROOT)+a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTENTHANDLER_PUBLIC);this.doSiteMap=!0;this.urlMaxLength=2E3;this.boundary="{EB2F8DA2-5B2C-F66A-CDD0-A2D42143F5AC}";this.newL="\r\n";
- this.sep="--";this.startB=this.newL+this.sep+this.boundary+this.newL;this.endB=this.sep+this.boundary+this.sep+this.newL;this.headerRegx=RegExp(this.newL+"s*([^\r]*)s*","mg");this.headerPartsRegx=/\s*([^:]*):\s*(.+)/;this.boundaryRegx=/boundary\s*=\s*\"?([^\"]*)\"?/;this.replaceDigest=this.multipartParts=!1;this.digest=null},_initServiceDoc:function(){this.inherited("_initServiceDoc",arguments);if(this.doMultipart=com.ibm.mashups.enabler.io.XHRMultipartFactory.isMultipartEnabled())this.serviceMPJson=
- com.ibm.mm.enabler.model.ServiceDocumentModel.getCollectionData([com.ibm.mm.enabler.model.ServiceDocumentModel.SERVICE_MODEL,com.ibm.mm.enabler.model.ServiceDocumentModel.SERVICE_MULTIPART]),this.serviceSMJson=com.ibm.mm.enabler.model.ServiceDocumentModel.getCollectionData([com.ibm.mm.enabler.model.ServiceDocumentModel.SERVICE_MODEL,com.ibm.mm.enabler.model.ServiceDocumentModel.SERVICE_HUFFMAN]),this.serviceCHJson=com.ibm.mm.enabler.model.ServiceDocumentModel.getCollectionData([com.ibm.mm.enabler.model.ServiceDocumentModel.SERVICE_MODEL,
- com.ibm.mm.enabler.model.ServiceDocumentModel.SERVICE_SITEMAP_COMMITHANDLER])},_partHandler:function(a,b,c,d){dojo.hitch(a,function(){try{com.ibm.mm.enabler.utils.Misc.isInstanceOf(b,Error)?this.error&&this.error(b,c,d):400<=c.xhr.status?this.error&&this.error(Error(c.xhr.status+": "+d.URI),c,d):this.load&&this.load(b,c,d),this.handle&&this.handle(b,c,d)}catch(a){try{this.error&&this.error(b,c,d)}catch(f){}}})()},_handleMultiPartResponse:function(a,b,c,d,e){var f=e.xhr.getResponseHeader("Content-Type"),
- g=f.match(c.boundaryRegx);if(!g)throw Error("No boundary specified in Content-Type response header");var g=g[1],m=g.indexOf(";");-1!=m&&(g=g.substring(0,m));d=d.split(RegExp(c.newL+c.sep+g,"mg"));g=null;b&&(g=new com.ibm.mm.enabler.io.XHRMultipartImpl,g.startTransaction());var m=1,p;for(p in a)if(Object.prototype.hasOwnProperty.call(a,p))for(var h=a[p],k=0,n=h.length;k<n;k++){var q=h[k],s=d[m++],r={},w=null,v=null,f=null;for(c.headerRegx.lastIndex=0;null!==(w=c.headerRegx.exec(s))&&0<w[1].length;)if(-1!=
- w[1].indexOf(":")&&-1==w[1].indexOf("digest=")){var x=w[1].match(c.headerPartsRegx);r[x[1]]=x[2];"X-Status-Code"==x[1]?v=x[2]:"Content-Type"==x[1]&&(f=x[2])}w=s=dojo.string.trim(s.substr(c.headerRegx.lastIndex+c.newL.length));s="xml"==q.handleAs?com.ibm.mm.enabler.utils.Dom.createDocument(s):dojo.contentHandlers[q.handleAs]({responseText:s});v=parseInt(v,10);f=new com.ibm.mm.enabler.io.XHRWrapper(e,w,v,f,r);v=e.xhr;e.xhr=f;c._partHandler(q,s,e,r);e.xhr=v}b&&g.endTransactionDeferred().start()},_multiPartXhr:function(a,
- b,c,d){var e="",f=null,g;for(g in c)if(Object.prototype.hasOwnProperty.call(c,g))for(var m in c[g])if(Object.prototype.hasOwnProperty.call(c[g],m)){var p=c[g][m];p.handleAs=p.handleAs?p.handleAs.toLowerCase():"text";var f="",h;for(h in p.headers)Object.prototype.hasOwnProperty.call(p.headers,h)&&(f+=h+": "+p.headers[h]+this.newL);e+=this.startB+f+this.newL;p.data&&1<p.data.length?e+=p.data+this.newL:p.postData&&1<p.postData.length?e+=p.postData+this.newL:p.putData&&1<p.putData.length&&(e+=p.putData+
- this.newL)}e+=this.endB;"PUT"!=a.toUpperCase()&&(a="POST");var k=this,n,b=dojo.mixin({},b,{load:function(a,b){k._handleMultiPartResponse(c,d,k,a,b);n=b.xhr.status},error:function(a,b){dojo.forEach(c,function(c){for(var d=0,e=c.length;d<e;d++)k._partHandler(c[d],a,b,null)});n=b.xhr.status},headers:{"Content-type":'multipart/mixed; boundary="'+k.boundary+'"'},handleAs:"text",form:null,content:null,postData:null,putData:null});b[a.toLowerCase()+"Data"]=e;dojo.xhr(a,b,!0);return n},suspendTransaction:function(){0!==
- this.statics.semaphore&&!this.statics.suspendedXhr&&(this.statics.suspendedXhr=dojo.xhr,dojo.xhr=this.statics.oldXhr)},resumeTransaction:function(){0!==this.statics.semaphore&&this.statics.suspendedXhr&&(dojo.xhr=this.statics.suspendedXhr,this.statics.suspendedXhr=null)},startTransaction:function(){this._initServiceDoc();this.doMultipart&&(this._acquire(),1<this.statics.semaphore||(this.correlateHosts?this.correlatedHosts=new com.ibm.mm.enabler.ArrayMap:this.partsArray=[],this.statics.oldXhr=dojo.xhr,
- dojo.xhr=dojo.hitch(this,function(a,b,c){var d;if(b.sync)return d=this.statics.oldXhr(a,b,c);if(d=this.DYN_RES.getResolver.apply(this.DYN_RES,arguments))return d=d.apply(this,arguments);d=new com.ibm.mm.enabler.utils.HttpUrl(b.url);var e=d.getParameter("uri");this.doSiteMap&&"GET"!=a?this.doSiteMap=!1:this.doSiteMap&&(!this.cacheQueries&&"GET"==a&&e&&null!==e)&&(this.doSiteMap=!1);b.method=a;this.correlateHosts?(e=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.PROXY_URL),
- d=d.server,null!==e&&(e+="/",0===b.url.indexOf(e)&&(d=b.url.indexOf("/",e.length),d=b.url.substring(0,d))),e=this.correlatedHosts.get(d),e||(e=[],this.correlatedHosts.put(d,e)),this._addToPartsArray(e,b)):this._addToPartsArray(this.partsArray,b)})))},isTransaction:function(){return 0<this.statics.semaphore},_encodeUrl:function(a,b){return b?escape(a).replace(/\+/g,"%2B").replace(/%20/g,"+").replace(/\*/g,"%2A").replace(/\//g,"%2F").replace(/@/g,"%40").replace(/%21/g,"!"):escape(a).replace(/\+/g,"%2B").replace(/%20/g,
- "+").replace(/\*/g,"%2A").replace(/\//g,"%2F").replace(/@/g,"%40")},_createHuffmanUrl:function(a){a=this._createSiteMap(a);a=com.ibm.mm.enabler.encode.huffman.HuffmanURL.createRawSchemeSpecificPartFromRegex(a,"[/ ]");this._initServiceDoc();-1!=this.serviceSMJson.template.indexOf("{uri_code}")?(a=this._encodeUrl(a,!0),a=this.serviceSMJson.template.replace(/\{uri_code\}/,a)):a=this.serviceSMJson.template.replace(/\{code\}/,a);return a=this._updateDigest(a)},_loadResources:function(a){var b;if(this.doSiteMap){var c=
- this._createHuffmanUrl(a);if(c.length>this.urlMaxLength)b=this._doMultipartPOSTRequest(this.method,a,this.multipartParts);else{var d=this;xhrArgs={url:c,load:function(c,f){d._handleMultiPartResponse(a,d.multipartParts,d,c,f);b=f.xhr.status},error:function(c,f){dojo.forEach(a,function(a){for(var b=0,p=a.length;b<p;b++)d._partHandler(a[b],c,f,null)});b=f.xhr.status},handleAs:"text",sync:!0};dojo.xhrGet(xhrArgs)}}else b=this._doMultipartPOSTRequest(this.method,a,this.multipartParts);return b},endTransaction:function(a,
- b,c){if(this.doMultipart&&(this._release(),!(0<this.statics.semaphore))){dojo.xhr=this.statics.oldXhr;if(this.correlateHosts){var a=this.correlatedHosts.values(),d;for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&this._loadResources(a[d])}else{if(0===this._assocArraySize(this.partsArray))return;this._loadResources(this.partsArray)}b&&b(c)}},endTransactionDeferred:function(a){"undefined"!==typeof a&&!0===a&&(this.multipartParts=!0);return new com.ibm.mm.enabler.DeferredOperationImpl(this,this._endTransaction)},
- _endTransaction:function(a){if(this.doMultipart&&(this._release(),!(0<this.statics.semaphore))){dojo.xhr=this.statics.oldXhr;if(this.correlateHosts){var b=this.correlatedHosts.values(),c;for(c in b)Object.prototype.hasOwnProperty.call(b,c)&&this._loadResources(b[c])}else{if(0===this._assocArraySize(this.partsArray))return;this._loadResources(this.partsArray)}a&&(a=a.getOperationCallback())&&a(id,com.ibm.mashups.enabler.DeferredOperation.OPERATION_GET,xhr.status,myDeferred.getOperationCallbackParameters())}},
- _doMultipartPOSTRequest:function(a,b,c){var d=this._processMultipartBody(b);this._initServiceDoc();return this._multiPartXhr(a,d?{url:this.serviceCHJson.url,sync:!0}:{url:this.serviceMPJson.url,sync:!0},b,c)},_assocArraySize:function(a){var b=0,c;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&b++;return b},_addToPartsArray:function(a,b){var c=a[b.url];c?c[c.length]=b:(a[b.url]=[],a[b.url][0]=b)},_acquire:function(){this.statics.semaphore++},_release:function(){this.statics.semaphore--},_createPocURI:function(a){var b=
- a.url,c=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.PROXY_URL),c=c+"/http/";if(0===b.indexOf(c)){var d="http://",e=b.indexOf("/",c.length+1);-1<e?(d+=unescape(b.substring(c.length,e)),d+=b.substring(e)):d="http://"+b.substring(c.length);b=d}c=new com.ibm.mm.enabler.utils.HttpUrl(b);(b=this._extractDigest(c,b))?(null===this.digest&&!1===this.replaceDigest?this.replaceDigest=
- !0:b!==this.digest&&(this.replaceDigest=!1),this.digest=b):(this.digest="",this.replaceDigest=!1);if(a.content)for(var f in a.content)Object.prototype.hasOwnProperty.call(a.content,f)&&c.addParameter(f,a.content[f]);f="";f=c.isProxyNeeded()?c.toString():(a=a.method?a.method.toLowerCase():null)&&("post"==a||"put"==a||"delete"==a)?c.getParameter("uri"):"res:"+c.toServerRelativeString();return f},_processMultipartBody:function(a){var b=!1,c;for(c in a)if(Object.prototype.hasOwnProperty.call(a,c))for(var d in a[c])if(Object.prototype.hasOwnProperty.call(a[c],
- d)){var e=a[c][d],f=this._createPocURI(e);e.headers=dojo.mixin({},e.headers,{"X-Method-Override":e.method,"Content-ID":f});"GET"!==e.method&&(b=!0)}return b},_createSiteMap:function(a){var b='<mashup:sitemap xmlns:mashup="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0.2/mashup-sitemap">',c;for(c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var d=a[c][0];d.handleAs=d.handleAs?d.handleAs.toLowerCase():"text";d=this._createPocURI(d).replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");
- b+='<mashup:entry uri="'+d+'" mode="download"/>'}return b+"</mashup:sitemap>"},_extractDigest:function(a,b){var c,d=a.getParameter("digest");d?c=d:(d=b.indexOf("digest!"),0<d&&(d+=7,c=b.indexOf("/",d),c=b.substring(d,c)));return c},_updateDigest:function(a){if(!this.replaceDigest)return a;var b,c=a.indexOf("digest!");0<c?(c+=7,b=a.indexOf("/",c),b=a.substring(c,b)):b||(c=a.indexOf("digest="),0<c&&(c+=7,b=a.indexOf("&",c),b=-1===b?a.substring(c):a.substring(c,b)));c=a;b&&(c=a.replace(b,this.digest));
- return c}});dojo.declare("com.ibm.mashups.enabler.io.XHRMultipartFactory",null,{create:function(){},isMultipartEnabled:function(){},isMultipartApplicationWidgets:function(){}});dojo.declare("com.ibm.mm.enabler.io.XHRMultipartFactoryImpl",[com.ibm.mashups.enabler.io.XHRMultipartFactory,com.ibm.mm.enabler.ServiceDocConsumer],{constructor:function(){this._init=!1;this.serviceMPJson=null;this.doMultipart=!1;var a=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.PAGE_LOAD_OPTIMIZATION_APP_WIDGETS);
- this.multipartAppWidgets=!1;if("undefined"==typeof a||null===a||!0===a)this.multipartAppWidgets=!0},_initServiceDoc:function(){this.inherited("_initServiceDoc",arguments);dojo.exists("com.ibm.mm.enabler.model.ServiceDocumentModel")&&(this.serviceMPJson=com.ibm.mm.enabler.model.ServiceDocumentModel.getCollectionData([com.ibm.mm.enabler.model.ServiceDocumentModel.SERVICE_MODEL,com.ibm.mm.enabler.model.ServiceDocumentModel.SERVICE_MULTIPART]));this.serviceMPJson&&this.serviceMPJson.url&&(this.doMultipart=
- !0)},create:function(){return new com.ibm.mm.enabler.io.XHRMultipartImpl},isMultipartEnabled:function(){if(!this._init){this._init=!0;var a=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.MULTIPART_ENABLED);6!=dojo.isIE&&a&&this._initServiceDoc()}return this.doMultipart},isMultipartApplicationWidgets:function(){return this.multipartAppWidgets}});com.ibm.mashups.enabler.io.XHRMultipartFactory=
- new com.ibm.mm.enabler.io.XHRMultipartFactoryImpl;dojo.require("com.ibm.mm.enabler.io.XHRMultipartFactoryImpl");dojo.declare("com.ibm.mashups.enabler.model.state.Accessor",null,{});dojo.declare("com.ibm.mashups.enabler.model.state.PageAccessor",[com.ibm.mashups.enabler.model.state.Accessor],{getPageID:function(){},setPageID:function(){},confirmSetPageID:function(){return!0}});dojo.declare("com.ibm.mm.enabler.model.state.PageAccessorImpl",[com.ibm.mashups.enabler.model.state.PageAccessor],{constructor:function(a,
- b){this.navStateModel=a;b&&(this.spaceid=b)},getPageID:function(){var a=this.navStateModel._state;return!a?null:this.spaceid?a.pageselection&&a.pageselection[this.spaceid]?a.pageselection[this.spaceid].value:null:a.pid?a.pid.value:null},setPageID:function(a){var b=this.navStateModel._state;b||(this.navStateModel._state={},b=this.navStateModel._state);if(a){var c=(new Date).getTime();b.pid=b.pid?b.pid:{};b.pid.value=a;b.pid.params=b.pid.params?b.pid.params:{};b.pid.params.lm=c;this.spaceid&&(b.pageselection||
- (b.pageselection={}),b.pageselection[this.spaceid]||(b.pageselection[this.spaceid]={}),b.pageselection[this.spaceid].value=a,b.pageselection[this.spaceid].params=b.pageselection[this.spaceid].params?b.pageselection[this.spaceid].params:{},b.pageselection[this.spaceid].params.lm=c)}else b.pid=null,this.spaceid&&b.pageselection&&b.pageselection[this.spaceid]&&(b.pageselection[this.spaceid]=null);this.navStateModel.setDirty(!0,"pid")}});dojo.declare("com.ibm.mashups.enabler.model.state.SpaceAccessor",
- [com.ibm.mashups.enabler.model.state.Accessor],{getSpaceID:function(){},setSpaceID:function(){},confirmSetSpaceID:function(){return!0}});dojo.declare("com.ibm.mm.enabler.model.state.SpaceAccessorImpl",[com.ibm.mashups.enabler.model.state.SpaceAccessor],{constructor:function(a){this.navStateModel=a},getSpaceID:function(){var a=this.navStateModel._state;return!a?null:a.sid&&a.sid.value?a.sid.value:null},_setSpaceIDInternal:function(a){var b=this.navStateModel._state;b||(this.navStateModel._state={},
- b=this.navStateModel._state);var c=(new Date).getTime();"undefined"==typeof a?b.sid={}:(b.sid=b.sid?b.sid:{},b.sid.value=a,b.sid.params=b.sid.params?b.sid.params:{},b.sid.params.lm=c);b.pid&&(b.pid=null)},setSpaceID:function(a){this._setSpaceIDInternal(a);this.navStateModel.setDirty(!0,"sid")}});dojo.declare("com.ibm.mashups.enabler.model.state.WidgetAccessor",[com.ibm.mashups.enabler.model.state.Accessor],{constructor:function(){},getWidgetID:function(){},getWidgetStateValues:function(){},getWidgetState:function(){},
- setWidgetState:function(){},confirmSetWidgetState:function(){return!0},setWidgetState:function(){},confirmSetWidgetState:function(){return!0},removeWidgetState:function(){},confirmRemoveWidgetState:function(){return!0},getWidgetStateNames:function(){},getWidgetMode:function(){},setWidgetMode:function(){},confirmSetWidgetMode:function(){return!0},getWindowState:function(){},setWindowState:function(){},confirmSetWindowState:function(){return!0},getSize:function(){},setSize:function(){},confirmSetSize:function(){return!0},
- MIN:"minimize",MAX:"maximize",NORMAL:"normal"});dojo.declare("com.ibm.mm.enabler.model.state.WidgetAccessorImpl",[com.ibm.mashups.enabler.model.state.WidgetAccessor],{constructor:function(a,b){this.navStateModel=a;this.wid=b;this.uniqueWid=this._getUniqueWid();this.widgetNavStateNode=a._find(this.WIDGET_PREFIX+this.navStateModel.DELIMITER+this.uniqueWid);this.wid!=this.uniqueWid&&!this.widgetNavStateNode&&(this.widgetNavStateNodeFallback=a._find(this.WIDGET_PREFIX+this.navStateModel.DELIMITER+this.wid))},
- WIDGET_PREFIX:"wparams",WIDTH:"w",HEIGHT:"h",WINDOWSTATE:"st",SYSTEMSTATE:"rp",CUSTOMSTATE:"cp",VALUE:"value",PARAMS:"params",MODE:"md",RP:{w:"w",h:"h",st:"st",md:"md"},VIEW:"view",getWidgetID:function(){return this.wid},_getUniqueWid:function(){return this.navStateModel._getUniqueWid(this.wid)},getWidgetStateSet:function(){var a=null;if(!this.widgetNavStateNode&&!this.widgetNavStateNodeFallback)return null;var b=this.widgetNavStateNode;b||(b=this.widgetNavStateNodeFallback);(b=b.getRef())&&b[this.VALUE]&&
- b[this.VALUE][this.CUSTOMSTATE]&&(a=b[this.VALUE][this.CUSTOMSTATE]);a&&!dojo.isString(a)&&(a=dojo.toJson(a));return a},_createWidgetNavStateNode:function(){var a=this.navStateModel.create({key:this.uniqueWid}),b=this.navStateModel._find(this.WIDGET_PREFIX);b||(b=this.navStateModel.create({key:this.WIDGET_PREFIX}),this.navStateModel.insert(b,this.navStateModel._getRoot()),b=this.navStateModel._find(this.WIDGET_PREFIX));this.navStateModel.insert(a,b);return a=this.navStateModel._find(this.WIDGET_PREFIX+
- this.navStateModel.DELIMITER+this.uniqueWid)},setWidgetStateSet:function(a){var b=null;if(dojo.isString(a))try{a=dojo.fromJson(a)}catch(c){}this.widgetNavStateNode||(this.widgetNavStateNode=this._createWidgetNavStateNode());var d=this.widgetNavStateNode.getRef();d.params=d.params?d.params:{};d.params.lm=(new Date).getTime();d&&d[this.VALUE]&&d[this.VALUE][this.CUSTOMSTATE]&&(b=dojo.clone(d[this.VALUE][this.CUSTOMSTATE]));d[this.VALUE]=d[this.VALUE]?d[this.VALUE]:{};var e=a;b&&(!dojo.isString(b)&&
- !dojo.isString(a))&&(e=dojo.mixin(b,a));d[this.VALUE][this.CUSTOMSTATE]=e;this.navStateModel.setDirty(!0);return this},_getWidgetSystemState:function(a){var b=null;if(!this.widgetNavStateNode&&!this.widgetNavStateNodeFallback)return null;var c=this.widgetNavStateNode;c||(c=this.widgetNavStateNodeFallback);if((c=c.getRef())&&c[this.VALUE]&&c[this.VALUE][this.SYSTEMSTATE])(c=c[this.VALUE][this.SYSTEMSTATE])&&c[a]&&(b=c[a]);return b},_setWidgetSystemState:function(a,b){this.widgetNavStateNode||(this.widgetNavStateNode=
- this._createWidgetNavStateNode());var c=this.widgetNavStateNode.getRef();c.params=c.params?c.params:{};c.params.lm=(new Date).getTime();var d=null;c[this.VALUE]=c[this.VALUE]?c[this.VALUE]:{};c[this.VALUE][this.SYSTEMSTATE]=c[this.VALUE][this.SYSTEMSTATE]?c[this.VALUE][this.SYSTEMSTATE]:{};d=c[this.VALUE][this.SYSTEMSTATE];d[a]=b;this.navStateModel.setDirty(!0);return this},getWidgetState:function(a){a=this._getWidgetStateValue(a)||null;if(!a)return null;dojo.isString(a)||(a=dojo.toJson(a));return a},
- _getWidgetStateValue:function(a){if(!a)return null;if(a&&"cp"==a)return this.getWidgetStateSet();if(this.RP[a])return this._getWidgetSystemState(a);var b=null;if(!this.widgetNavStateNode&&!this.widgetNavStateNodeFallback)return null;var c=this.widgetNavStateNode;c||(c=this.widgetNavStateNodeFallback);if((c=c.getRef())&&c[this.VALUE]&&c[this.VALUE][this.CUSTOMSTATE]){c=c[this.VALUE][this.CUSTOMSTATE];if(dojo.isString(c))return null;c&&c[a]&&(b=c[a])}return b},getWidgetStateValues:function(a){a=this._getWidgetStateValue(a)||
- null;if(!a)return null;if(dojo.isString(a)){var b=[];b.push(a);return b}return a},getWidgetStateNames:function(){var a=[];if(!this.widgetNavStateNode&&!this.widgetNavStateNodeFallback)return null;var b=this.widgetNavStateNode;b||(b=this.widgetNavStateNodeFallback);if((b=b.getRef())&&b[this.VALUE]&&b[this.VALUE][this.CUSTOMSTATE]){b=b[this.VALUE][this.CUSTOMSTATE];if(dojo.isString(b))return null;if(b)for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&b[c]&&a.push(c)}return 0===a.length?null:
- a},setWidgetState:function(a,b){if(!a||!b)return null;if(a&&"cp"==a)return this.setWidgetStateSet(b);var c=!1;dojo.isArray(b)&&1<=b.length&&dojo.isString(b[0])&&(c=!0);c||dojo.isString(b)&&(c=!0);if(!c)return null;if(this.RP[a])return this._setWidgetSystemState(a,b);if(a&&"cp"==a)return this.setWidgetStateSet(b);this.widgetNavStateNode||(this.widgetNavStateNode=this._createWidgetNavStateNode());c=this.widgetNavStateNode.getRef();c.params=c.params?c.params:{};c.params.lm=(new Date).getTime();var d=
- null;c[this.VALUE]=c[this.VALUE]?c[this.VALUE]:{};c[this.VALUE][this.CUSTOMSTATE]=c[this.VALUE][this.CUSTOMSTATE]?c[this.VALUE][this.CUSTOMSTATE]:{};d=c[this.VALUE][this.CUSTOMSTATE];d[a]=b;this.navStateModel.setDirty(!0);return this},removeWidgetState:function(a){if(!a)return!1;if(this.RP[a])return this._removeWidgetSystemState(a);if(!this.widgetNavStateNode)return!1;var b=this.widgetNavStateNode.getRef();b.params=b.params?b.params:{};b.params.lm=(new Date).getTime();return a&&"cp"==a?b&&b[this.VALUE]&&
- b[this.VALUE][this.CUSTOMSTATE]?(b[this.VALUE][this.CUSTOMSTATE]=null,this.navStateModel.setDirty(!0),!0):!1:b&&b[this.VALUE]&&b[this.VALUE][this.CUSTOMSTATE]&&(b=b[this.VALUE][this.CUSTOMSTATE])&&b[a]?(b[a]=null,this.navStateModel.setDirty(!0),!0):!1},_removeWidgetSystemState:function(a){if(!a||!this.widgetNavStateNode)return!1;var b=this.widgetNavStateNode.getRef();b.params=b.params?b.params:{};b.params.lm=(new Date).getTime();return b&&b[this.VALUE]&&b[this.VALUE][this.SYSTEMSTATE]&&(b=b[this.VALUE][this.SYSTEMSTATE])&&
- b[a]?(b[a]=null,this.navStateModel.setDirty(!0),!0):!1},getWindowState:function(){return rc=this._getWidgetSystemState(this.WINDOWSTATE)},setWindowState:function(a){a&&(a==this.MIN||a==this.MAX||a==this.NORMAL)&&this._setWidgetSystemState(this.WINDOWSTATE,a)},getWidgetMode:function(){return this._getWidgetSystemState(this.MODE)},setWidgetMode:function(a){return a?(this._setWidgetSystemState(this.MODE,a),this):null},getSize:function(){var a={},b=this._getWidgetSystemState(this.HEIGHT),c=this._getWidgetSystemState(this.WIDTH);
- b&&(a[this.HEIGHT]=b);c&&(a[this.WIDTH]=c);return!a[this.HEIGHT]&&!a[this.WIDTH]?null:a},setSize:function(a,b){a&&this._setWidgetSystemState(this.WIDTH,a);b&&this._setWidgetSystemState(this.HEIGHT,b);return this}});dojo.declare("com.ibm.mashups.enabler.model.state.PageModeAccessor",[com.ibm.mashups.enabler.model.state.Accessor],{VIEW:"view",EDIT:"edit",getPageMode:function(){},setPageMode:function(){},confirmSetPageMode:function(){return!0}});com.ibm.mashups.enabler.model.state.PageModeAccessor.VIEW=
- "view";com.ibm.mashups.enabler.model.state.PageModeAccessor.EDIT="edit";dojo.declare("com.ibm.mm.enabler.model.state.PageModeAccessorImpl",[com.ibm.mashups.enabler.model.state.PageModeAccessor],{constructor:function(a){this.navStateModel=a},getPageMode:function(){var a=this.navStateModel._getPageMode();return!a?null:a},setPageMode:function(a){a&&this.navStateModel._setPageMode(a)}});dojo.declare("com.ibm.mashups.enabler.model.state.ShareableParameterSetAccessor",[com.ibm.mashups.enabler.model.state.Accessor],
- {getId:function(){},getScope:function(){},getAllNames:function(){},setItemValue:function(){},confirmSetItemValue:function(){return!0},removeItem:function(){},confirmRemoveItem:function(){return!0},getItemValue:function(){},registerListener:function(){},removeListener:function(){},confirmRemoveListener:function(){return!0}});dojo.declare("com.ibm.mm.enabler.model.state.ShareableParameterSetAccessorImpl",[com.ibm.mashups.enabler.model.state.ShareableParameterSetAccessor],{DELETE_TOKEN:"DELETE_TOKEN",
- TYPE_NEW:"newItem",TYPE_UPDATE:"changedValue",TYPE_REMOVE:"removedItem",constructor:function(a,b,c){this.scope=c?c:com.ibm.mm.enabler.model.state.ShareableParameterSetAccessorImpl.GLOBAL_SCOPE;this.name=b;this.navStateModel=a;this.navStateNode=a._find("sparams"+this.navStateModel.DELIMITER+b+this.navStateModel.DELIMITER+this.scope)},_createNavStateNode:function(){var a,b=this.navStateModel._find("sparams");b||(a=this.navStateModel.create({key:"sparams"}),this.navStateModel.insert(a,this.navStateModel._getRoot()),
- b=this.navStateModel._find("sparams"));a=this.navStateModel._find(this.name);a||(a=this.navStateModel.create({key:this.name}),this.navStateModel.insert(a,b),a=this.navStateModel._find("sparams"+this.navStateModel.DELIMITER+this.name));b=this.navStateModel.create({key:this.scope});this.navStateModel.insert(b,a);return b=this.navStateModel._find("sparams"+this.navStateModel.DELIMITER+this.name+this.navStateModel.DELIMITER+this.scope)},getId:function(){return this.name},getScope:function(){return this.scope},
- getAllNames:function(){if(!this.navStateNode)return null;var a=[],b=this.navStateNode.getRef();if(b&&b[this.navStateModel.VALUE])for(var c in b[this.navStateModel.VALUE])if(b[this.navStateModel.VALUE].hasOwnProperty(c)){var d=b[this.navStateModel.VALUE][c][this.navStateModel.VALUE];d&&d!=this.DELETE_TOKEN&&a.push(c)}return a},setItemValue:function(a,b){this.navStateNode||(this.navStateNode=this._createNavStateNode());var c=this.navStateNode.getRef();c.params=c.params?c.params:{};c.params.lm=(new Date).getTime();
- c.value=c.value?c.value:{};var d={};if(c.value[a]){if(c.value[a]){var e=dojo.clone(c.value[a].value);c.value[a].value=b;c.value[a].params=c.value[a].params?c.value[a].params:{};c.value[a].params._isDirty?(d=c.value[a].params._change,d.type==this.TYPE_NEW?d.newVal=b:d.type==this.TYPE_UPDATE?d.newVal=b:d.type==this.TYPE_REMOVE&&(d.type=d.oldVal?this.TYPE_UPDATE:this.TYPE_NEW,d.newVal=b)):(d.type=this.TYPE_UPDATE,d.oldVal=e,d.newVal=b,d.alias=a,c.value[a].params._change=d);c.value[a].params._isDirty=
- !0}}else c.value[a]={},c.value[a].value=b,c.value[a].params=c.value[a].params?c.value[a].params:{},c.value[a].params._isDirty=!0,d.alias=a,d.type=this.TYPE_NEW,d.newVal=b,c.value[a].params._change=d;this.navStateModel.setDirty(!0);return!0},removeItem:function(a){if(!this.navStateNode)return!1;var b=this.navStateNode.getRef();b.params=b.params?b.params:{};b.params.lm=(new Date).getTime();if(b&&b[this.navStateModel.VALUE])if(b[this.navStateModel.VALUE][a]){var c=b[this.navStateModel.VALUE][a],d=dojo.clone(c.value);
- c.value=this.DELETE_TOKEN;c.params=c.params?c.params:{};var e={};c.params._isDirty?(e=c.params._change,e.type==this.TYPE_NEW?delete b[this.navStateModel.VALUE][a]:e.type==this.TYPE_UPDATE&&(e.type=this.TYPE_REMOVE,e.newVal=null,delete e.oldVal)):(e.type=this.TYPE_REMOVE,e.alias=a,e.oldVal=d,c.params._change=e,c.params._isDirty=!0);this.navStateModel.setDirty(!0)}else return!1;return!0},getItemValue:function(a){if(!this.navStateNode)return null;var b=this.navStateNode.getRef();return b&&b[this.navStateModel.VALUE]&&
- b[this.navStateModel.VALUE][a]&&(a=b[this.navStateModel.VALUE][a][this.navStateModel.VALUE])&&a!=this.DELETE_TOKEN?a:null},registerListener:function(a){this.navStateNode||(this.navStateNode=this._createNavStateNode());var b=this.navStateNode.getRef(),c=b[this.navStateModel.PARAMS];c||(b[this.navStateModel.PARAMS]={},c=b[this.navStateModel.PARAMS]);c._listeners||(c._listeners={});b=this.navStateModel._generateListenerId();c._listeners[b]=a;return b},removeListener:function(a){if(!this.navStateNode)return null;
- var b=this.navStateNode.getRef()[this.navStateModel.PARAMS];return b&&b._listeners&&(b=b._listeners,b[a])?(b[a]=null,delete b[a],!0):!1},_setItems:function(a){for(var b in a)a[b]&&a[b]==this.DELETE_TOKEN?this.removeItem(b):a[b]&&this.setItemValue(b,a[b])}});com.ibm.mm.enabler.model.state.ShareableParameterSetAccessorImpl.GLOBAL_SCOPE="global";dojo.declare("com.ibm.mashups.enabler.model.state.LayoutContainerAccessor",[com.ibm.mashups.enabler.model.state.Accessor],{constructor:function(){},getID:function(){},
- getSize:function(){},setSize:function(){},confirmSetSize:function(){return!0}});dojo.declare("com.ibm.mm.enabler.model.state.LayoutContainerAccessorImpl",[com.ibm.mashups.enabler.model.state.LayoutContainerAccessor],{constructor:function(a,b,c){this.navStateModel=a;this.cid=b;this.pid=c;b=this.navStateModel.DELIMITER;c=this.LAYOUT_PREFIX;c+=b+this.pid;(this.layoutNavStateNode=a._find(c))?(c+=b+this.VALUE+b+this.cid,this.layoutContainerNavStateNode=a._find(c)):this.layoutContainerNavStateNode=null},
- LAYOUT_PREFIX:"lcparams",WIDTH:"w",SYSTEMSTATE:"rp",VALUE:"value",PARAMS:"params",MODE:"md",RP:{w:"w"},getID:function(){return this.cid},_getLayoutContainerSystemState:function(a){var b=null;if(!this.layoutContainerNavStateNode)return null;var c=this.layoutContainerNavStateNode.getRef();c&&c[this.VALUE]&&c[this.VALUE][this.SYSTEMSTATE]&&(c=c[this.VALUE][this.SYSTEMSTATE])&&c[a]&&(b=c[a]);return b},_setLayoutContainerSystemState:function(a,b){var c;this.layoutContainerNavStateNode||(this.layoutContainerNavStateNode=
- this._createLayoutContainerNavStateNode());c=this.layoutNavStateNode.getRef();c.params=c.params?c.params:{};c.params.lm=(new Date).getTime();c=this.layoutContainerNavStateNode.getRef();var d=null;c[this.VALUE]=c[this.VALUE]?c[this.VALUE]:{};c[this.VALUE][this.SYSTEMSTATE]=c[this.VALUE][this.SYSTEMSTATE]?c[this.VALUE][this.SYSTEMSTATE]:{};d=c[this.VALUE][this.SYSTEMSTATE];d[a]=b;this.navStateModel.setDirty(!0);return this},_createLayoutNavStateNode:function(){var a=this.navStateModel.create({key:this.pid}),
- b=this.navStateModel._find(this.LAYOUT_PREFIX);b||(b=this.navStateModel.create({key:this.LAYOUT_PREFIX}),this.navStateModel.insert(b,this.navStateModel._getRoot()),b=this.navStateModel._find(this.LAYOUT_PREFIX));this.navStateModel.insert(a,b);return a=this.navStateModel._find(this.LAYOUT_PREFIX+this.navStateModel.DELIMITER+this.pid)},_createLayoutContainerNavStateNode:function(){this.layoutNavStateNode||(this.layoutNavStateNode=this._createLayoutNavStateNode());var a=this.layoutNavStateNode.getRef();
- a[this.VALUE]=a[this.VALUE]?a[this.VALUE]:{};var a=this.navStateModel.DELIMITER,b=this.LAYOUT_PREFIX+a+this.pid+a+this.VALUE,c=this.navStateModel.create({key:this.cid}),d=this.navStateModel._find(b);this.navStateModel.insert(c,d);return c=this.navStateModel._find(b+a+this.cid)},getSize:function(){var a={},b=this._getLayoutContainerSystemState(this.WIDTH);return b?(a[this.WIDTH]=b,a):null},setSize:function(a){a&&this._setLayoutContainerSystemState(this.WIDTH,a);return this}});dojo.declare("com.ibm.mashups.enabler.model.state.LayoutAccessor",
- [com.ibm.mashups.enabler.model.state.Accessor],{constructor:function(){},getTemplateURL:function(){},setTemplateURL:function(){},getContainerAccessor:function(){},removeAll:function(){}});dojo.declare("com.ibm.mm.enabler.model.state.LayoutAccessorImpl",[com.ibm.mashups.enabler.model.state.LayoutAccessor],{constructor:function(a,b){this.navStateModel=a;this.pid=b;this.path=this.LAYOUT_PREFIX+this.navStateModel.DELIMITER+this.pid;this.layoutNavStateNode=null},LAYOUT_PREFIX:"lcparams",WIDGET_PREFIX:"wparams",
- VALUE:"value",TEMPLATE_URL:"templateURL",SYSTEMSTATE:"rp",WIDTH:"w",HEIGHT:"h",_getLayoutState:function(a){var b=null;if(!this.layoutNavStateNode&&(this.layoutNavStateNode=this.navStateModel._find(this.path),!this.layoutNavStateNode))return null;var c=this.layoutNavStateNode.getRef();c&&c[a]&&(b=c[a]);return b},_setLayoutState:function(a,b){var c;this.layoutNavStateNode||(this.layoutNavStateNode=this.navStateModel._find(this.path),this.layoutNavStateNode||(this.layoutNavStateNode=this._createLayoutNavStateNode()));
- c=this.layoutNavStateNode.getRef();c.params=c.params?c.params:{};c.params.lm=(new Date).getTime();c[a]=b;this.navStateModel.setDirty(!0);return this},_createLayoutNavStateNode:function(){var a=this.navStateModel.create({key:this.pid}),b=this.navStateModel._find(this.LAYOUT_PREFIX);b||(b=this.navStateModel.create({key:this.LAYOUT_PREFIX}),this.navStateModel.insert(b,this.navStateModel._getRoot()),b=this.navStateModel._find(this.LAYOUT_PREFIX));this.navStateModel.insert(a,b);return a=this.navStateModel._find(this.path)},
- getTemplateURL:function(){return this._getLayoutState(this.TEMPLATE_URL)},setTemplateURL:function(a){return this._setLayoutState(this.TEMPLATE_URL,a)},removeAll:function(a){var b=this.navStateModel.DELIMITER;if(a&&this.navStateModel._find(this.WIDGET_PREFIX)){var c,d;for(c=0;c<a.length;c++)if(d=this.navStateModel._find(this.WIDGET_PREFIX+b+a[c]+b+this.VALUE+b+this.SYSTEMSTATE))d=d.getRef(),delete d[this.WIDTH],delete d[this.HEIGHT],this.navStateModel.setDirty(!0)}this.layoutNavStateNode&&(this.navStateModel.remove(this.layoutNavStateNode),
- this.navStateModel.setDirty(!0),delete this.layoutNavStateNode);return this},getContainerAccessor:function(a){return new com.ibm.mm.enabler.model.state.LayoutContainerAccessorImpl(this.navStateModel,a,this.pid)}});dojo.declare("com.ibm.mashups.enabler.model.state.AccessorFactory",null,{getPageAccessor:function(){},getSpaceAccessor:function(){},getWidgetAccessor:function(){},getPageModeAccessor:function(){},getShareableParameterSetAccessor:function(){},getLayoutAccessor:function(){}});dojo.declare("com.ibm.mm.enabler.model.state.AccessorFactoryImpl",
- [com.ibm.mashups.enabler.model.state.AccessorFactory],{constructor:function(){},getPageAccessor:function(a,b){return new com.ibm.mm.enabler.model.state.PageAccessorImpl(a,b)},getPageModeAccessor:function(a){return new com.ibm.mm.enabler.model.state.PageModeAccessorImpl(a)},getSpaceAccessor:function(a){return new com.ibm.mm.enabler.model.state.SpaceAccessorImpl(a)},getWidgetAccessor:function(a,b){return new com.ibm.mm.enabler.model.state.WidgetAccessorImpl(a,b)},getShareableParameterSetAccessor:function(a,
- b,c){return new com.ibm.mm.enabler.model.state.ShareableParameterSetAccessorImpl(a,b,c)},getLayoutAccessor:function(a,b){return new com.ibm.mm.enabler.model.state.LayoutAccessorImpl(a,b)}});com.ibm.mashups.enabler.model.state.AccessorFactory=new com.ibm.mm.enabler.model.state.AccessorFactoryImpl;dojo.declare("com.ibm.mashups.enabler.model.state.NavigationStateModel",null,{ONNAVSTATEUPDATED:"com.ibm.mashups.enabler.model.state.onNavStateUpdated",startTransaction:function(){},commitTransaction:function(){},
- discardTransaction:function(){},isTransaction:function(){return!1},commit:function(){return new com.ibm.mashups.enabler.Deferred},discard:function(){},dispose:function(){}});dojo.declare("com.ibm.mashups.enabler.services.IdentificationService",null,{createClientID:function(){},attachClientID:function(){},releaseClientID:function(){},isClientID:function(){},isServerID:function(){},isAlienID:function(){},attachServerID:function(){},resolveID:function(){},resolveIdentifiable:function(){}});dojo.declare("com.ibm.mm.enabler.utils.UtilsImpl",
- null,{constructor:function(){this.serviceJson=null},_lazyInit:function(){if(!this.serviceJson){this.xmlDom=com.ibm.mm.enabler.utils.Dom.createDocument();this.serviceJson=com.ibm.mm.enabler.model.ServiceDocumentModel.getCollectionData(com.ibm.mm.enabler.model.ServiceDocumentModel.SERVICE_NAVIGATION);this.prefix=this.serviceJson.idprefix;var a=com.ibm.mm.enabler.model.NameSpaceFactory;this.ns=dojo.delegate(this.serviceJson.namespaces,a.getNameSpaces([a.NS_ATOM]))}},createNode:function(a,b){this._lazyInit();
- return com.ibm.mm.enabler.utils.Dom.createElement(this.xmlDom,a,b)},createLinkNode:function(a,b,c){c=this.createNode("atom:link",c);c.setAttribute("href",a);c.setAttribute("rel",b);return c},createExtLinkNode:function(a,b,c){this._lazyInit();var d=this.createNode("atom:link",this.ns[com.ibm.mm.enabler.model.NameSpaceFactory.NS_ATOM]);d.setAttribute("href",a);b&&d.setAttribute("rel",b);com.ibm.mm.enabler.utils.Dom.setAttributeWithNS(this.xmlDom,d,"ext:rel","rel",this.ns.ext,c);return d},getIdFromExtUri:function(a,
- b){this._lazyInit();var c=null,d=com.ibm.mm.enabler.utils.Dom.getAttributeWithNS(b,"ext:uri","uri",this.ns.ext);d&&(c=d.indexOf("@"),-1!=c&&(d=d.slice(0,c)),c=d,d=c.lastIndexOf(":"),-1!=d&&(c=c.slice(d+1)),d=c.toUpperCase().lastIndexOf("%3A"),-1!=d&&(c=c.slice(d+3)),d=c.lastIndexOf("/"),-1!=d&&(c=c.slice(d+1)));return c},getHrefFromIdentifiable:function(a){return a&&"function"==typeof a._getParameters?a._getParameters().href:null},getIdFromIdentifiable:function(a){return com.ibm.mm.enabler.utils.Misc.isInstanceOf(a,
- com.ibm.mashups.enabler.Identifiable)?a.getID():dojo.isString(a)?dojo.string.trim(a):a},setAttributeWithNS:function(a,b,c,d){this._lazyInit();com.ibm.mm.enabler.utils.Dom.setAttributeWithNS(this.xmlDom,a,b,null,c,d)},createFeed:function(a,b,c,d){var e="",f;for(f in d)Object.prototype.hasOwnProperty.call(d,f)&&(e+="xmlns:"+f+'="'+d[f]+'" ');return'<?xml version="1.0" encoding="UTF-8"?>\n<atom:feed '+e+" >\n<atom:title>"+b+"</atom:title>\n<atom:id>"+a+"</atom:id>\n<atom:updated>"+(new Date).toGMTString()+
- "</atom:updated>\n"+c+"</atom:feed>"}});com.ibm.mm.enabler.utils.Utils=new com.ibm.mm.enabler.utils.UtilsImpl;com.ibm.mm.enabler.IdentifiableHelper.ID_MATCHER=/^(.*?)(%3a)?([ \.\w_\-]*)(@.*?)?$/i;com.ibm.mm.enabler.IdentifiableHelper.getID=function(a){return(a=a.match(com.ibm.mm.enabler.IdentifiableHelper.ID_MATCHER))?a[3]:""};com.ibm.mm.enabler.IdentifiableHelper.replaceID=function(a,b,c){c=com.ibm.mm.enabler.IdentifiableHelper.getID(c);a=a.match(com.ibm.mm.enabler.IdentifiableHelper.ID_MATCHER);
- return b+":"+c+(a?a[4]||"":"")};com.ibm.mm.enabler.utils.Atom={_FEED:"atom:feed",_ENTRY:"atom:entry",_LINK:"atom:link",_ID:"atom:id",_NEXT_LINK:"atom:link[@rel='next']",_EDIT_LINK:"atom:link[@rel='edit']",_REPLIES_LINK:"atom:link[@rel='replies']",_REPLIES_LINK_HREF:"atom:link[@rel='replies']/@href",_IN_REPLY_TO_LINK:"thr:in-reply-to",_IN_REPLY_TO_LINK_HREF:"thr:in-reply-to/@href",createEntry:function(a,b,c){var d={},e=com.ibm.mm.enabler.model.NameSpaceFactory,f=e.getNameSpaces([e.NS_ATOM]),e=com.ibm.mm.enabler.utils.Utils.createNode("atom:entry",
- f.atom),g=com.ibm.mm.enabler.utils.Utils.createNode("atom:id",f.atom);e.appendChild(g);var m=com.ibm.mm.enabler.utils.Utils.createNode("atom:title",f.atom);a&&com.ibm.mm.enabler.utils.Dom.textContent(m,a);e.appendChild(m);a=com.ibm.mm.enabler.utils.Utils.createNode("atom:updated",f.atom);com.ibm.mm.enabler.utils.Dom.textContent(a,(new Date).toGMTString());e.appendChild(a);a=com.ibm.mm.enabler.utils.Utils.createNode("atom:content",f.atom);a.setAttribute("type","application/xml");e.appendChild(a);b&&
- c&&(b=com.ibm.mm.enabler.utils.Utils.createNode(b,c),a.appendChild(b),d.modelElement=b);d.entryElement=e;d.idElement=g;return d}};dojo.declare("com.ibm.mm.enabler.persistence.xml.IdentifiableXmlImpl",[com.ibm.mashups.enabler.Identifiable,com.ibm.mm.enabler.DirtyFlagProviderImpl,com.ibm.mm.enabler.ServiceDocConsumer],{constructor:function(){this.modelMessages=dojo.i18n.getLocalization("com.ibm.mm.enabler","modelMessages");this._resetCachedRawID();this._addDirtyCallback(this,this._resetCachedRawID,
- null,!0)},_cachedRawIdToken:{},_resetCachedRawID:function(){this._cachedRawID=this._cachedRawIdToken},_cachedRawID:null,_initServiceDoc:function(){this.inherited("_initServiceDoc",arguments);var a=com.ibm.mm.enabler.model.ServiceDocumentModel.getCollectionData(com.ibm.mm.enabler.model.ServiceDocumentModel.SERVICE_NAVIGATION),b=com.ibm.mm.enabler.model.NameSpaceFactory;this.id_ns=dojo.delegate(a.namespaces,b.getNameSpaces([b.NS_ATOM,b.NS_THR,b.NS_XML,b.NS_OPENSEARCH,b.NS_XHTML,b.NS_APP]));this.id_prefix=
- a.idprefix},getID:function(){var a=this._getRawID();return a?com.ibm.mm.enabler.IdentifiableHelper.getID(a):a},_getRawID:function(){this._initServiceDoc();if(this._cachedRawID===this._cachedRawIdToken){var a=null,b=com.ibm.mashups.enabler.xml.XPath.evaluateString(com.ibm.mm.enabler.utils.Atom._ID,this.xmlData,this.id_ns);b&&(a=dojo.string.trim(b));this._cachedRawID=a}return this._cachedRawID},equals:function(a){return com.ibm.mm.enabler.utils.Utils.getIdFromIdentifiable(this)==com.ibm.mm.enabler.utils.Utils.getIdFromIdentifiable(a)},
- setID:function(a){this._initServiceDoc();var b=this._getRawID(),a=com.ibm.mm.enabler.IdentifiableHelper.replaceID(b||"",this.id_prefix,a);a!=b&&this._setRawID(a)},_setRawID:function(a){this._initServiceDoc();var a=a||"",b=com.ibm.mashups.enabler.xml.XPath.evaluateEntry(com.ibm.mm.enabler.utils.Atom._ID,this.xmlData,this.id_ns);if(b){var c=this._getRawID();a!=c&&(com.ibm.mm.enabler.utils.Dom.textContent(b,a),this._setDirty(),this._cachedRawID=dojo.string.trim(a))}else throw Error(dojo.string.substitute(this.modelMessages.E_ELEMENT_NOT_FOUND_2,
- [com.ibm.mm.enabler.utils.Atom._ID,this.toString()]));},getUniqueName:function(){this._initServiceDoc();var a=null,b=com.ibm.mashups.enabler.xml.XPath.evaluateEntry(com.ibm.mm.enabler.utils.Atom._ID,this.xmlData,this.id_ns);b&&(a=com.ibm.mm.enabler.utils.Dom.getAttributeWithNS(b,"ext:uniquename","uniquename",this.id_ns.ext));return a||""}});dojo.declare("com.ibm.mm.enabler.IdentifierImpl",com.ibm.mm.enabler.persistence.xml.IdentifiableXmlImpl,{_id:null,_params:null,constructor:function(a,b){dojo.isString(a)?
- this._id=a:this.xmlData=a;this._params=b},setID:function(a){this._id?this._id=a:this.inherited(arguments)},getID:function(){return this._id?com.ibm.mm.enabler.IdentifiableHelper.getID(this._id):this.inherited(arguments)},_getParameters:function(){return this._params},_getRawID:function(){return this._id?this._id:this.inherited(arguments)},_setRawID:function(a){if(!this._id){var b=com.ibm.mashups.enabler.xml.XPath.evaluateEntry(com.ibm.mm.enabler.utils.Atom._ID,this.xmlData,this.id_ns);b&&com.ibm.mm.enabler.utils.Dom.textContent(b,
- a)}}});dojo.declare("com.ibm.mm.enabler.services.IdentificationServiceImpl",[com.ibm.mashups.enabler.services.IdentificationService],{constructor:function(){this.clientIds={};this.clientServerMap={};var a=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.SERVER_OBJECT_ID_FORMAT);a||(a="M[A-F0-9]+$");this.serverOidRegExp=RegExp(a)},createClientID:function(){for(;;){var a=dojox.uuid.generateRandomUuid().replace(/-/g,
- "_");if(!(a in this.clientIds))return this.clientIds[a]=null,a}return null},attachClientID:function(a){this.clientIds[a]=null},releaseClientID:function(a){a=com.ibm.mm.enabler.utils.Utils.getIdFromIdentifiable(a);this.isClientID(a)&&(delete this.clientIds[a],delete this.clientServerMap[a])},isClientID:function(a){return a in this.clientIds},isServerID:function(a){return this.serverOidRegExp.test(a)},isAlienID:function(a){return!this.isServerID(a)&&!this.isClientID(a)},attachServerID:function(a,b){var c=
- com.ibm.mm.enabler.utils.Utils.getIdFromIdentifiable(a),d=com.ibm.mm.enabler.utils.Utils.getIdFromIdentifiable(b);this.clientServerMap[c]=d},resolveID:function(a){a=com.ibm.mm.enabler.utils.Utils.getIdFromIdentifiable(a);return a in this.clientServerMap?this.clientServerMap[a]:a},resolveIdentifiable:function(a){return new com.ibm.mm.enabler.IdentifierImpl(this.resolveID(a))}});com.ibm.mashups.enabler.services.IdentificationService=new com.ibm.mm.enabler.services.IdentificationServiceImpl;dojo.declare("com.ibm.mashups.enabler.model.state.NavigationStateProcessor",
- null,{encodeWidgetIdentifier:function(){},decodeWidgetIdentifier:function(){},decode:function(){},encode:function(){},generateUrl:function(){},generateURL:function(){},preprocess:function(){},dispose:function(){},postprocess:function(){}});dojo.declare("com.ibm.mm.enabler.model.state.CookieManager",null,{constructor:function(){this._dirty=!1;this.cookiePath=window.location.pathname},COOKIE_PREFIX:"digest.ignore.state.",disposeState:function(){if(!0!==ibmConfig["com.ibm.mashups.embedding.isActive"]){var a=
- this._getCookieID();a&&dojo.cookie(a)&&(dojo.isIE?dojo.cookie(a,null,{expires:-1}):dojo.cookie(a,null,{expires:-1,path:this.cookiePath}));this._state&&delete this._state;this._dirty=!1}},_getCookieID:function(){if(!this._cookieID){var a=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.USER);if(!a||a&&"null"==a)return null;this._cookieID=this.COOKIE_PREFIX+a}return this._cookieID},
- _init:function(){this._getCookieID()?(dojo.cookie.isSupported()&&(dojo.cookie(this._getCookieID())&&dojo.fromJson(dojo.cookie(this._getCookieID())))&&(this._state=dojo.fromJson(dojo.cookie(this._getCookieID()))),this._state||(this._state={})):this._state={}},getState:function(a){this._state||this._init();return!a?this._state:this._state[a]?this._state[a]:null},setState:function(a,b){this._state||(this._state={});this._state[a]=b;this._dirty=!0},removeState:function(a){this._state[a]&&(delete this._state[a],
- this._dirty=!0)},commit:function(){!0!==ibmConfig["com.ibm.mashups.embedding.isActive"]&&this._dirty&&(this._getCookieID()&&dojo.cookie.isSupported()&&(dojo.isIE?dojo.cookie(this._getCookieID(),dojo.toJson(this._state),{expires:3652}):dojo.cookie(this._getCookieID(),dojo.toJson(this._state),{expires:3652,path:this.cookiePath})),this._dirty=!1)}});com.ibm.mashups.enabler.model.state.CookieManager=new com.ibm.mm.enabler.model.state.CookieManager;dojo.declare("com.ibm.mashups.iwidget.model.Factory",
- null,{constructor:function(){},getGlobalWidgetModel:function(){}});dojo.declare("com.ibm.mm.iwidget.Constants",null,{constructor:function(){},WIDGETEVENT_PREFIX:"widgetevents.",WILDCARD_PREFIX:"*.",mode:{VIEW:"view",EDIT:"edit",PERSONALIZE:"personalize",CONFIG:"config",HELP:"help"},mode_view:"view",mode_edit:"edit",mode_help:"help",event:{TITLE:"title",DESCRIPTION:"description"},ATTRIBUTES:"attributes",IDESCRIPTOR:"idescriptor",USERPROFILE:"userprofile",windowstate:{NORMAL:"normal",MINIMIZE:"minimize",
- MAXIMIZE:"maximize"},status:{SUCCESS:200,TIMEOUT:408,NOTFOUND:404,INTERROR:500,OTHER:303},changeType:{CHANGEDVALUE:"changedValue",NEWITEM:"newItem",REMOVEDITEM:"removedItem"},iDescriptorItems:{title:"title",name:"name",description:"description",defaultHeight:"defaultHeight",defaultWidth:"defaultWidth",displayLocale:"displayLocale",mode:"mode",author:"author",email:"email",website:"website",version:"version",icon:"icon",windowState:"windowState",messageLocale:"messageLocale",availableMessageLocales:"availableMessageLocales",
- thumbnail:"thumbnail"},IW_PREFIX:"iw-",IW_DEFINITION_TYPE:"iwidget",OSGADGET_DEFINITION_TYPE:"os-gadget",CSSCLASS_INSTANCE:{iwWidget:"iWidget",iwOSGadget:"OSGadget",iwSandbox:"Sandbox",iwDefinition:"Definition",iwEventDescription:"EventDescription",iwPayloadType:"PayloadType",iwHandled:"Handled",iwPublished:"Published",iwDescription:"Description",iwTitle:"Title",iwEvent:"Event",iwDescRef:"DescRef",iwGlobalid:"Globalid",iwHandler:"Handler",iwNewWire:"NewWire",iwRemoveWire:"RemoveWire",iwReadOnly:"ReadOnly",
- iwItemSet:"ItemSet",iwItem:"Item",iwValue:"Value",iwContent:"Content",iwReceivedEvent:"ReceivedEvent",iwSourceEvent:"SourceEvent",iwTargetEvent:"TargetEvent",iwMappedName:"MappedName",iwStandalone:"Standalone"},CSSCLASS_PREFIXED_INSTANCE:{},CSSCLASS_PERSONALIZED:"mm-Personalized",RESOURCE:{src:"src",id:"id",globalid:"globalid",mimeType:"mimeType",callback:"callback",version:"version",blockInit:"blockInit",skipLoad:"skipLoad"},EVENTS:{onLoad:"onLoad",onUnLoad:"onUnload",onModeChanged:"onModeChanged",
- onItemSetChanged:"onItemSetChanged",unloadWidget:"/enabler/unloadWidget",unSubscribeWire:"/enabler/unSubscribeWire",modeChanged:"modeChanged",onSizeChanged:"onSizeChanged",onNavStateChanged:"onNavStateChanged",onAttributeSaved:"com.ibm.mashups.iwidget.onAttributeSaved",onWindowStateChanged:"onWindowStateChanged",onIncompleteEventDescription:"onIncompleteEventDescription"},eventservice:{type:{MAIN:"MAIN",IFRAME:"IFRAME"}}});com.ibm.mm.iwidget.Constants=new com.ibm.mm.iwidget.Constants;for(var n in com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE)Object.prototype.hasOwnProperty.call(com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE,
- n)&&(com.ibm.mm.iwidget.Constants.CSSCLASS_PREFIXED_INSTANCE[n]=com.ibm.mm.iwidget.Constants.IW_PREFIX+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE[n]);iwConstants=com.ibm.mm.iwidget.Constants;dojo.declare("com.ibm.mashups.iwidget.widget.WireProvider",null,{constructor:function(){},getWires:function(){}});dojo.declare("com.ibm.mashups.iwidget.IEventDescription",null,{constructor:function(){},alias:"",name:"",type:"",handlingFn:"",getDescription:function(){return null},lang:"",isHandled:!1,isPublished:!1,
- getAttribute:function(){return null},setAttribute:function(){}});dojo.declare("com.ibm.mm.iwidget.IEventDescriptionImpl",com.ibm.mashups.iwidget.IEventDescription,{constructor:function(a,b,c,d,e,f,g){if(dojo.isString(a)){var m={};m.name=a;(b=b||null)?(m.handlingFn=b,m.isHandled=!0,m.isPublished=!1):m.isPublished=!0;if(c=c||null)m.type=c;f=f||null;m.lang=f?f:"en";m.attributes={};m.localizedAttributes={};if(e=e||null)m.attributes.aliases=e;if(g=g||null)m.localizedAttributes=g;d&&(m.localizedAttributes[m.lang]||
- (m.localizedAttributes[m.lang]={}),m.localizedAttributes[m.lang].description=d);this._internalJsonObj=m}else this._internalJsonObj=a;this.initPredefinedFields(this._internalJsonObj)},initPredefinedFields:function(a){this.name=a.name;this.type=a.type;this.lang=a.lang;this.handlingFn=a.handlingFn;this.isHandled=a.isHandled;this.isPublished=a.isPublished},getDescription:function(a){return this._getLocalizedAttribute("description",a)},getTitle:function(a){return this._getLocalizedAttribute("title",a)},
- _getLocalizedAttribute:function(a,b){var c=null,d=null,d=com.ibm.mashups.enabler.context.Factory.getLocalizedContext(b,this.lang).getLocale(this);this.localemapping&&this.localemapping[d]&&(d=this.localemapping[d]);this._internalJsonObj.localizedAttributes&&(d=this._internalJsonObj.localizedAttributes[d])&&(c=d[a]);c||(c=this[a]);"undefined"==typeof c&&(c=null);return c},setOnRemoveWire:function(a){if("undefined"==typeof a||null===a)a="onRemoveWire";"undefined"==typeof this._internalJsonObj.attributes&&
- (this._internalJsonObj.attributes={});this._internalJsonObj.attributes.onRemoveWire=a;return this},getOnRemoveWire:function(){return "undefined"!=typeof this._internalJsonObj.attributes&&this._internalJsonObj.attributes.onRemoveWire?this._internalJsonObj.attributes.onRemoveWire:null},setOnNewWire:function(a){if("undefined"==typeof a||null===a)a="onNewWire";"undefined"==typeof this._internalJsonObj.attributes&&(this._internalJsonObj.attributes={});this._internalJsonObj.attributes.onNewWire=a;return this},
- getOnNewWire:function(){return "undefined"!=typeof this._internalJsonObj.attributes&&this._internalJsonObj.attributes.onNewWire?this._internalJsonObj.attributes.onNewWire:null},getLocales:function(){var a=[],b={};if(this._internalJsonObj.localizedAttributes)for(var c in this._internalJsonObj.localizedAttributes)if(Object.prototype.hasOwnProperty.call(this._internalJsonObj.localizedAttributes,c)){a.push(c);var d=com.ibm.mm.enabler.utils.LocaleHelper.normalizeLocale(c);d!=c&&(b[d]=c)}this.localemapping=
- b;return a},toString:function(){var a=this.toJson();return dojo.toJson(a)},_getInternalJsonObj:function(){return this._internalJsonObj},toJson:function(){var a={},b;for(b in this._internalJsonObj)Object.prototype.hasOwnProperty.call(this._internalJsonObj,b)&&(a[b]="handlingFn"==b&&dojo.isFunction(this._internalJsonObj[b])?"HANDLEFN":dojo.clone(this._internalJsonObj[b]));return a},clone:function(){var a=dojo.toJson(this._internalJsonObj);return a?new com.ibm.mm.iwidget.IEventDescriptionImpl(dojo.fromJson(a)):
- null},getAttribute:function(a,b){if(!a)return null;if(b)return this._getLocalizedAttribute(a,b);if(this._internalJsonObj.attributes&&"undefined"!=typeof this._internalJsonObj.attributes[a])return this._internalJsonObj.attributes[a];if(this._internalJsonObj.localizedAttributes&&this._internalJsonObj.localizedAttributes[this.lang]){var c=this._internalJsonObj.localizedAttributes[this.lang][a];if(c)return c}return null},setAttribute:function(a,b,c){if(!a||"undefined"==typeof b)return null;if(!c)return"undefined"==
- typeof this._internalJsonObj.attributes&&(this._internalJsonObj.attributes={}),this._internalJsonObj.attributes[a]=b,null===b&&delete this._internalJsonObj.attributes[a],this;this._internalJsonObj.localizedAttributes[c]||(this._internalJsonObj.localizedAttributes[c]={});this._internalJsonObj.localizedAttributes[c][a]=b;null===b&&delete this._internalJsonObj.localizedAttributes[c][a];return this},copyRuntimeProperties:function(a){!this.handlingFn&&a.handlingFn&&(this.handlingFn=a.handlingFn);!this._internalJsonObj.handlingFn&&
- a._internalJsonObj.handlingFn&&(this._internalJsonObj.handlingFn=a._internalJsonObj.handlingFn);"undefined"==typeof this._internalJsonObj.attributes&&(this._internalJsonObj.attributes={});for(name in a._internalJsonObj.attributes)this._internalJsonObj.attributes[name]||(this._internalJsonObj.attributes[name]=a._internalJsonObj.attributes[name])}});dojo.declare("com.ibm.mashups.iwidget.widget.EventProvider",null,{constructor:function(){},getWidgetPublishedEvents:function(){},getWidgetHandledEvents:function(){},
- getPublicEvent:function(){}});dojo.declare("com.ibm.mashups.iwidget.widget.Properties",null,{constructor:function(){},getItemValue:function(){},getAllNames:function(){return null},getItemLocales:function(){},isReadOnly:function(){}});dojo.declare("com.ibm.mm.iwidget.widget.PropertiesImpl",com.ibm.mashups.iwidget.widget.Properties,{DELETE_TOKEN:"com.ibm.mm.iwidget.widget.DELETE_TOKEN",TYPE_NEW:"newItem",TYPE_UPDATE:"updatedValue",TYPE_REMOVE:"removedItem",constructor:function(a,b){this._defaultProperties=
- b;this._items={};a&&(this._items=a);this._localizedItems={};this.DEFAULT_LOCALE=ibmConfig[com.ibm.mashups.enabler.services.ConfigConstants.DEFAULT_LOCALE];this.DEFAULT_LOCALE||(this.DEFAULT_LOCALE="en")},_getItemDefaultLocale:function(a){var b=null;this._items[a]&&this._items[a].defaultLocale&&(b=this._items[a].defaultLocale);b||(b=null);return b},getLocalizedItemValue:function(a,b){if(a&&b){if(!(a in this._items)&&!this._defaultProperties)return null;var c=this._items[a],d=null;if(!c.values)return null;
- var e=[],f;for(f in c.values)Object.prototype.hasOwnProperty.call(c.values,f)&&e.push(f);e=com.ibm.mm.enabler.utils.LocaleHelper.matchLocale(b,e);for(f in c.values)if(e==com.ibm.mm.enabler.utils.LocaleHelper.normalizeLocale(f)){d=c.values[f];break}return d==this.DELETE_TOKEN?null:d}},getItemValue:function(a,b){if(!(a in this._items)&&!this._defaultProperties)return null;if(!(a in this._items))return this._defaultProperties.getItemValue(a,b);var c=this._items[a],d=null;if(("undefined"==typeof b||null===
- b)&&"undefined"!=typeof c.value&&null!==c.value)return c.value==this.DELETE_TOKEN?null:c.value;if(!c.values)return null;var e=[],f;for(f in c.values)Object.prototype.hasOwnProperty.call(c.values,f)&&e.push(f);var g;if(b)for(f in g=com.ibm.mm.enabler.utils.LocaleHelper.matchLocale(b,e),c.values)if(g==com.ibm.mm.enabler.utils.LocaleHelper.normalizeLocale(f)){d=c.values[f];break}if(c.defaultLocale&&null===d)for(f in g=com.ibm.mm.enabler.utils.LocaleHelper.matchLocale(c.defaultLocale,e),c.values)if(g==
- com.ibm.mm.enabler.utils.LocaleHelper.normalizeLocale(f)){d=c.values[f];break}if(this.DEFAULT_LOCALE&&null===d)for(f in g=com.ibm.mm.enabler.utils.LocaleHelper.matchLocale(this.DEFAULT_LOCALE,e),c.values)if(g==com.ibm.mm.enabler.utils.LocaleHelper.normalizeLocale(f)){d=c.values[f];break}if(null===d)for(var m in c.values)if(Object.prototype.hasOwnProperty.call(c.values,m)){d=c.values[m];break}return d==this.DELETE_TOKEN?null:d},getItemLocales:function(a){var b=[];if(a in this._items&&this._items[a].values)for(var c in this._items[a].values)Object.prototype.hasOwnProperty.call(this._items[a].values,
- c)&&b.push(c);return 0===b.length?null:b},getAllNames:function(){var a=[];this._defaultProperties&&(a=this._defaultProperties.getAllNames());for(var b={},c=0;c<a.length;c++)b[a[c]]=null;for(var d in this._items)this._items[d]&&this._items[d]._change&&this._items[d]._change.changeType==this.TYPE_REMOVE?d in b&&delete b[d]:b[d]=null;var a=[],e;for(e in b)Object.prototype.hasOwnProperty.call(b,e)&&a.push(e);return a},isReadOnly:function(a){var b=this._items[a];return this._defaultProperties&&this_defaultProperties.isReadOnly(a)||
- b&&b.readOnly}});dojo.declare("com.ibm.mashups.iwidget.widget.PropertiesProvider",null,{constructor:function(){},getIDescriptorItems:function(){},getAttributes:function(){}});dojo.declare("com.ibm.mashups.iwidget.widget.IWidgetDefinition",[com.ibm.mashups.iwidget.widget.EventProvider,com.ibm.mashups.iwidget.widget.PropertiesProvider],{constructor:function(){},getSupportedModes:function(){},toSpecObject:function(){}});dojo.declare("com.ibm.mm.iwidget.widget.IWidgetDefinitionDefaultImpl",com.ibm.mashups.iwidget.widget.IWidgetDefinition,
- {namespaces:{iw:"http://www.ibm.com/xmlns/prod/iWidget"},reservedAttributes:{iScope:"iScope",supportedModes:"supportedModes",id:"id",allowInstanceContent:"allowInstanceContent",lang:"language",xml_lang:"_xml_lang",xmlns_iw:"_xmlns_iw",supportedWindowStates:"supportedWindowStates",xml_base:"_xml_base",sandbox:"sandbox"},constructor:function(a,b,c){this.widgetDef=a;b&&(this.xmlStr=b);c&&(this.specObject=c,this._specObjectToWidgetDef())},getXmlBase:function(){return this.widgetDef.xmlBase?this.widgetDef.xmlBase:
- null},getAllowInstanceContent:function(){return this.widgetDef.allowInstanceContent},getResources:function(){this.resources||(this.resources=[]);return this.resources},getIScope:function(){return this.widgetDef.iScope},getWidgetEvents:function(){return this.widgetDef.widgetEvents},getMarkupByMode:function(a){return this.widgetDef.markup?(a||(a="view"),this.widgetDef.markup[a]):null},setMarkupByMode:function(a,b){return this.widgetDef.markup?(a||(a="view"),this.widgetDef.markup[a]=b,this):null},_getManagedItemSetListener:function(a){return!a||
- a!=iwConstants.ATTRIBUTES&&a!=iwConstants.IDESCRIPTOR?null:this.widgetDef.itemSetsArr&&(a=this.widgetDef.itemSetsArr[a])&&a.onItemSetChanged?a.onItemSetChanged:null},_getManagedItemSetItems:function(a,b){var c={};if(this.widgetDef.itemSetsArr){var d=this.widgetDef.itemSetsArr[a];if(d)for(var e in d.items)Object.prototype.hasOwnProperty.call(d.items,e)&&(c[e]=d.items[e])}if(b=b||null)for(var f in b)Object.prototype.hasOwnProperty.call(b,f)&&(d=b[f],"undefined"!=typeof d&&null!==d&&(e={readOnly:!1},
- e.value=d,e.id=f,c[f]=e));return new com.ibm.mm.iwidget.widget.PropertiesImpl(c)},getAttributes:function(){this.attributeProperties||(this.attributeProperties=this._getManagedItemSetItems(iwConstants.ATTRIBUTES,this.widgetDef.simpleAttributes));return this.attributeProperties},getIDescriptorItems:function(){this.idescriptorProperties||(this.idescriptorProperties=this._getManagedItemSetItems(iwConstants.IDESCRIPTOR,this.widgetDef.iDescriptor));return this.idescriptorProperties},getAllItemSetNames:function(){var a=
- [];if(!this.widgetDef.itemSetsArr)return a;for(var b in this.widgetDef.itemSetsArr)if(Object.prototype.hasOwnProperty.call(this.widgetDef.itemSetsArr,b)){var c=this.widgetDef.itemSetsArr[b];"undefined"!=typeof c&&(b!=iwConstants.ATTRIBUTES&&b!=iwConstants.IDESCRIPTOR)&&a.push(c.id)}return a},getItemSet:function(a){if("attributes"==a)return this.getAttributes();a=this.widgetDef.itemSetsArr[a]||null;return!a?null:a},getWidgetId:function(){return this.widgetDef.id},getWidgetName:function(){return this.widgetDef.id},
- getPayloadDefs:function(){return null},getPayloadDef:function(){return null},getPayloadDefNames:function(){return[]},getSupportedModes:function(){var a=this.widgetDef.supportedModes;return!a?null:a.split(" ")},getSupportedWindowStates:function(){var a=this.widgetDef.supportedWindowStates;return!a?null:a.split(" ")},getDefaultLanguage:function(){return this.widgetDef.lang},getMarkup:function(){return this.widgetDef.markup},_specObjectToWidgetDef:function(){this.widgetDef={};if(null!==this.specObject){var a=
- this.specObject._id;a||(a=this.specObject._name);this.widgetDef.id=null;this.widgetDef.name=null;a&&(this.widgetDef.id=a,this.widgetDef.name=a);this.widgetDef.allowInstanceContent=!1;if((a=this.specObject._allowInstanceContent)&&"true"==a)this.widgetDef.allowInstanceContent=!0;a=this.specObject._iScope;this.widgetDef.iScope=null;a&&(this.widgetDef.iScope=a);(a=this.specObject._supportedModes)||(a="view");this.widgetDef.supportedModes=a;(a=this.specObject._supportedWindowStates)||(a="normal");this.widgetDef.supportedWindowStates=
- a;a=this.specObject._lang;a||(a=this.specObject._xml_lang);a||(a="en");this.widgetDef.lang=a;if(a=this.specObject._xml_base)this.widgetDef.xmlBase=a;var a=iwConstants.iDescriptorItems,b={},c;for(c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var d=a[c],e=this.specObject["_"+d];"undefined"==typeof e&&(e=null);b[d]=e}this.widgetDef.iDescriptor=b;c={};var a={},f;for(f in this.specObject)Object.prototype.hasOwnProperty.call(this.specObject,f)&&0===f.indexOf("_")&&(b=f,b=b.substr(1),0!==b.indexOf("on")&&
- !iwConstants.iDescriptorItems[b]&&!this.reservedAttributes[b]?c[b]=this.specObject[f]:0===b.indexOf("on")&&(a[b]=this.specObject[f]));this.widgetDef.simpleAttributes=c;this.widgetDef.widgetEvents=a;this.widgetDef.markup=this._extractMarkupFromSpecObject();f=this._extractItemSetsFromSpecObject(this.widgetDef);null!==f&&(this.widgetDef.itemSetsArr=f);this.widgetDef.publicEvents=this._extractEventsFromSpecObject();this.widgetDef.resources=this._extractResourcesFromSpecObject();this.widgetDef.eventDescriptions=
- this._extractEventDescFromSpecObject()}},_extractMarkupFromSpecObject:function(){var a=this.specObject.contents,b={},c;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&a[c]&&(b[c]={},a[c]._uri&&(b[c].uri=a[c]._uri),a[c].value&&(b[c].content=a[c].value));return b},_extractItemSetsFromSpecObject:function(a){var b=this.specObject.itemSets;if(b){var c={},d={},e;for(e in b)if(Object.prototype.hasOwnProperty.call(b,e)){var f=b[e],g=e,m=f._onItemSetChanged,p=f._private,h=!0;p&&"false"==p&&(h=!1);p=
- f._alias?f._alias:null;m={id:g,onItemSetChanged:m,isPrivate:h};p&&(m.alias=p);m.items={};var f=f.items,k;for(k in f)if(Object.prototype.hasOwnProperty.call(f,k)){var n=f[k],q=!1;(p=n._readOnly)&&"true"==p&&(q=!0);var p=n._id,s=n._alias?n._alias:null,r=n._value,w=n._lang;w||(w=n._xml_lang);var v={};v.id=p;s&&(v.alias=s);v.readOnly=q;w&&(v.defaultLocale=w);"undefined"!=typeof r&&(null!==r&&!w)&&(v.value=r);"undefined"!=typeof r&&(null!==r&&w)&&(v.values={},v.values[w]=r);var n=n.alts,x;for(x in n)Object.prototype.hasOwnProperty.call(n,
- x)&&(q=x,s=n[x]._value,v.values||(v.values={}),v.values[q]=s,w&&(q==w&&v.value)&&delete v.value);m.items[p]=v}!0===h?c[g]=m:d[g]=m}a.shareableItemSetsArr=d;return c}return null},_extractEventsFromSpecObject:function(){var a=this.specObject.events,b={};if(a&&0!==a.length)for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var d=a[c],e={},f;for(f in d)if(Object.prototype.hasOwnProperty.call(d,f)){var g=f;0===f.indexOf("_")&&(g=g.substr(1));var m=d[f];"eventDescName"==g&&(g="description");"handled"==
- g&&(g="isHandled");"published"==g&&(g="isPublished");m&&(e[g]=m)}b[e.id]=e}return b},_extractResourcesFromSpecObject:function(){var a=[],b=this.specObject.resources,c=0;if(b&&0!==b.length)for(var d in b)if(Object.prototype.hasOwnProperty.call(b,d)){var e=b[d],f={},g=e._id;g||(g=e._globalid);f[iwConstants.RESOURCE.id]=g?g:null;g=e._src;g||(g=e._uri);f[iwConstants.RESOURCE.src]=g;f[iwConstants.RESOURCE.version]=e._version?e._version:null;f[iwConstants.RESOURCE.callback]=e._callback?e._callback:null;
- f[iwConstants.RESOURCE.mimeType]=e._mimeType?e._mimeType:null;f[iwConstants.RESOURCE.blockInit]=e._blockInit?e._blockInit:null;f[iwConstants.RESOURCE.globalid]=e._globalid?e._globalid:null;f[iwConstants.RESOURCE.skipLoad]=e._skipLoad?e._skipLoad:null;a[c]=f;c++}return a},_extractPayloadDefsFromSpecObject:function(){var a=this.specObject.payloadDefs,b;for(b in a)Object.prototype.hasOwnProperty.call(a,b)},_extractEventDescFromSpecObject:function(){var a={},b=this.specObject.eventDescriptions;if(b&&
- 0!==b.length)for(var c in b)if(Object.prototype.hasOwnProperty.call(b,c)){var d=b[c],e={},f=c;e.id=f;e.payloadType=d._payloadType;e.description=d._description;e.title=d._title;e.descriptionURI=d._descriptionURI?d._descriptionURI:null;var g=d._lang;g||(g=d._xml_lang);g&&(e.lang=g);var d=d.alts,m;for(m in d)if(Object.prototype.hasOwnProperty.call(d,m)){var g=d[m],p={};p.description=g._description;p.title=g._title;p.descriptionURI=g._descriptionURI?aNode_descriptionURI:null;e.descriptions||(e.descriptions=
- {});e.descriptions[m]=p}a[f]=e}return a},toSpecObject:function(){return this.specObject?this.specObject:{}}});com.ibm.mm.iwidget.widget.IWidgetDefinitionImpl=com.ibm.mm.iwidget.widget.IWidgetDefinitionDefaultImpl;ibmConfig.enablerLayerModules&&0<=dojo.indexOf(ibmConfig.enablerLayerModules,"iWidget")&&dojo.require("com.ibm.mm.iwidget.widget.IWidgetDefinitionExtendedImpl");dojo.declare("com.ibm.mashups.iwidget.widget.ModifiableProperties",[com.ibm.mashups.iwidget.widget.Properties],{constructor:function(){},
- setItemValue:function(){},removeItem:function(){},removeItemValue:function(){}});dojo.declare("com.ibm.mm.iwidget.widget.ModifiablePropertiesImpl",[com.ibm.mashups.iwidget.widget.ModifiableProperties,com.ibm.mm.iwidget.widget.PropertiesImpl],{constructor:function(){this._dirty=!1},_buildChange:function(a,b,c,d,e){var f=a._dirty;f||(a._dirty=!0);var g=a._change?a._change:{};g.id=b;e?f&&g.changeType&&g.changeType==this.TYPE_NEW?(a._dirty=!1,delete a._change):f?g.changeType=this.TYPE_REMOVE:(a._change.changeType=
- this.TYPE_REMOVE,a._change.oldVal=c):(f&&g.changeType?(g.changeType!=this.TYPE_NEW&&(g.changeType=this.TYPE_UPDATE),g.newVal=d):(c&&(g.oldVal=c),d&&(g.newVal=d),g.changeType=c?this.TYPE_UPDATE:this.TYPE_NEW),a._change=g)},setItemValue:function(a,b,c,d){if(!a||!b||a in this._items&&this._defaultProperties&&this._defaultProperties.isReadOnly(a))return null;var e={},f={};if(!d||d&&""==d)return a in this._items?(e={},f={},this._items[a].values?(e=dojo.clone(this._items[a].values),this._items[a].value&&
- (e[""]=this._items[a].value),f=dojo.clone(this._items[a].values)):this._items[a].value&&(e[""]=this._items[a].value),f[""]=b,this._items[a].value=b,this._buildChange(this._items[a],a,e,f)):(e={},e.id=a,e.value=b,e.readOnly=!!c,this._items[a]=e,f={},f[""]=b,this._items[a]=this._items[a]?this._items[a]:{},this._buildChange(this._items[a],a,null,f)),this._items[a]._dirty&&(this._dirty=!0),this;d=d.replace(/-/g,"_");if(a in this._items)return e={},this._items[a].values&&(e=dojo.clone(this._items[a].values)),
- this._items[a].values[d]=b,f=dojo.clone(this._items[a].values),this._items[a].value&&(e[""]=this._items[a].value,f[""]=this._items[a].value),this._items[a].readOnly=c,this._buildChange(this._items[a],a,e,b),this._items[a]._dirty&&(this._dirty=!0),this;e={values:{}};e.values[d]=b;e.id=a;e.readOnly=!!c;this._items[a]=e;f=dojo.clone(e.values);this._buildChange(this._items[a],a,null,f);this._items[a]._dirty&&(this._dirty=!0);return this},removeItem:function(a){if(this._defaultProperties&&this._defaultProperties.isReadOnly(a))throw"The specified item ["+
- a+"] is readOnly!";var b={},b=!1;if(a in this._items){if(this._items[a]._dirty){this._items[a].value=this.DELETE_TOKEN;this._items[a].values=this.DELETE_TOKEN;b=this._items[a]._change?this._items[a]._change:{};if(b.changeType==this.TYPE_NEW)return delete this._items[a],this;b.changeType=this.TYPE_REMOVE}else{var c={};this._items[a].values&&(c=dojo.clone(this._items[a].values));this._items[a].value&&(c[""]=this._items[a].value);this._items[a].value=this.DELETE_TOKEN;this._items[a].values=this.DELETE_TOKEN;
- b={};b.changeType=this.TYPE_REMOVE;b.itemName=a;b.oldVal=c;this._items[a]._change=b;this._items[a]._dirty=!0}b=!0}return b?(this._dirty=!0,this):null},removeItemValue:function(a,b){b||(b="");if(this._defaultProperties&&this._defaultProperties.isReadOnly(a))throw"The specified item ["+a+"] is readOnly!";var c=b.replace(/-/g,"_"),d=!1,e={};if(a in this._items)if(this._items[a]._dirty){e=this._items[a]._change?this._items[a]._change:{};if(e.changeType==this.TYPE_REMOVE)return null;e.changeType==this.TYPE_NEW?
- (""==c&&(this._items[a].value&&this._items[a].value!=this.DELETE_TOKEN)&&(delete this._items[a].value,this._items[a]._change.newVal[""]&&delete this._items[a]._change.newVal[""],d=!0),""!=c&&this._items[a].values[c]&&(delete this._items[a].values[c],this._items[a]._change.newVal[c]&&delete this._items[a]._change.newVal[c],d=!0),this._isEmpty(this._items[a]._change.newVal)&&(delete this._items[a]._dirty,delete this._items[a]._change)):(""==c&&(this._items[a].value&&this._items[a].value!=this.DELETE_TOKEN)&&
- (delete this._items[a].value,this._items[a]._change.newVal[""]&&delete this._items[a]._change.newVal[""],d=!0),this._items[a].values[c]&&(delete this._items[a].values[c],this._items[a]._change.newVal[c]&&delete this._items[a]._change.newVal[c],d=!0))}else{var f={};""==c&&this._items[a].value&&(e={},e.id=a,f={},this._items[a].values?(e.changeType=this.TYPE_UPDATE,f=dojo.clone(this._items[a].values),f[""]=this._items[a][""],e.oldVal=f,e.newVal=dojo.clone(this._items[a].values)):(e.changeType=this.TYPE_REMOVE,
- f[""]=this._items[a][""],e.oldVal=f),delete this._items[a].value,this._items[a]._change=e,d=this._items[a]._dirty=!0);c in this._items[a].values&&(e={},e.id=a,this._items[a].value?(e.changeType=this.TYPE_UPDATE,f=dojo.clone(this._items[a].values),f[""]=this._items[a][""],e.oldVal=f,e.newVal=dojo.clone(this._items[a].values),e.newVal[""]=this._items[a].value,delete e.newVal[c],delete this._items[a].value):(f=dojo.clone(this._items[a].values),delete this._items[a].values[c],this._isEmpty(this._items[a].values)?
- e.changeType=this.TYPE_REMOVE:(e.changeType=this.TYPE_UPDATE,e.newVal=dojo.clone(this._items[a].values)),e.oldVal=f),this._items[a]._change=e,d=this._items[a]._dirty=!0)}return d?(this._dirty=!0,this):null},_isDirty:function(){return this._dirty},_setDirty:function(a){this._dirty=a},_isItemDirty:function(a){if(!a)return!1;var b=!1;this._items[a]&&(b=this._items[a]._dirty);return b},_setItemDirty:function(a,b){a&&this._items[a]&&(this._items[a]._dirty=b,"undefined"!=typeof b&&!b&&(delete this._items[a]._dirty,
- delete this._items[a]._change),this._items[a].values&&this._items[a].values==this.DELETE_TOKEN&&delete this._items[a].values,this._items[a].value&&this._items[a].value==this.DELETE_TOKEN&&delete this._items[a].value,!this._items[a].value&&!this._items[a].values&&delete this._items[a])},_getInternalItemValue:function(a){return this._items[a]?this._items[a]:null},_isEmpty:function(a){return com.ibm.mm.enabler.utils.Misc.isEmpty(a)},_getRequiredValue:function(a,b){if(!a)return null;if(dojo.isString(a))return a;
- if(b)return a[b]?a[b]:null;var c=null,d=0,e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&(""==e&&(c=a[e]),d++);return c&&1==d?c:a},_updateProperties:function(a){this._items=dojo.mixin(this._items,a);this._dirty=!0},toJson:function(){return this._items}});dojo.declare("com.ibm.mashups.iwidget.widget.ModifiablePropertiesProvider",null,{constructor:function(){},getIDescriptorItems:function(){},getAttributes:function(){}});dojo.declare("com.ibm.mashups.iwidget.widget.ModifiableWireProvider",
- com.ibm.mashups.iwidget.widget.WireProvider,{constructor:function(){},addWire:function(){},removeWire:function(){}});dojo.declare("com.ibm.mashups.iwidget.widget.IWidgetInstance",[com.ibm.mashups.iwidget.widget.ModifiablePropertiesProvider,com.ibm.mashups.iwidget.widget.ModifiableWireProvider],{constructor:function(){}});dojo.declare("com.ibm.mm.iwidget.UtilsDefaultImpl",null,{constructor:function(){},widgetClassRE:/(mm:|mm_|iw-)iWidget/,findElementByAttribute:function(a,b,c,d,e){if(!c.childNodes)return!1;
- if("class"==a)return dojo.query("."+b,c).forEach(function(a){d.push(a)}),0!==d.length;if("query"==a)return dojo.query(b,c).forEach(function(a){d.push(a)}),0!==d.length;if(c.getElementsByTagName)for(var f=c.getElementsByTagName("*"),g=0,m=f.length;g<m;g++){var p=f[g];if(p&&p.getAttribute&&p.getAttribute(a)==b&&(d.push(p),!e))return!0}return"id"==a?(dojo.query("#"+b,c).forEach(function(a){d.push(a)}),0!==d.length):!1},getClass:function(a){var b=a.getAttribute("class");return b=b?b:a.getAttribute("className")},
- checkParentElement:function(a,b){if(a){var c=a.parentNode;if(c)return c.className&&c.className.match(b)?c.id:this.checkParentElement(c,b)}return null},getWidgetParent:function(a,b){dojo.isString(a)&&(a=dojo.byId(a));b||(b=this.widgetClassRE);return this.checkParentElement(a,b)},getParents:function(a,b){var c=a.getParent();c&&(b.push(c),this.getParents(c,b))},getModelID:function(a){var b=ibmConfig[com.ibm.mashups.enabler.services.ConfigConstants.ID_PREFIX];b&&dojo.isString(a)&&0===a.indexOf(b)&&(a=
- a.substring(b.length));return a},getMarkupID:function(a){var b=ibmConfig[com.ibm.mashups.enabler.services.ConfigConstants.ID_PREFIX];b&&dojo.isString(a)&&(a=b+a);return a},stripHashPrefix:function(a){if(dojo.isString(a)){var b=a.indexOf("#");if(-1!==b)return a.substr(1+b)}return a},_getWidgetTitle:function(){return null}});ibmConfig.enablerLayerModules&&0<=dojo.indexOf(ibmConfig.enablerLayerModules,"iWidget")?dojo.require("com.ibm.mm.iwidget.UtilsExtended"):com.ibm.mm.iwidget.Utils=new com.ibm.mm.iwidget.UtilsDefaultImpl;
- dojo.declare("com.ibm.mm.iwidget.widget.IWidgetInstanceDefaultImpl",com.ibm.mashups.iwidget.widget.IWidgetInstance,{constructor:function(a,b,c){this.wrapper=a;this.rootElement=b;this.id=c;this.ns=b.className.substr(0,3);a=[];com.ibm.mm.iwidget.Utils.findElementByAttribute("query","> ."+(this.ns+"Definition"),this.rootElement,a,!1);a&&0<a.length&&(a=a[0].getAttribute("href"),"undefined"!=typeof a&&null!==a&&(this.widgetXMLUrl=a))},_destroy:function(){this.rootElement&&(this.rootElement=null)},getDefaultViewContent:function(){if(this.defaultViewContent)return this.defaultViewContent;
- var a=this.ns+"Content",b=null,c=dojo.query("> ."+a+"."+iwConstants.mode_view,this.rootElement);c&&(b=c[0]);b||(c=dojo.query("> ."+a,this.rootElement))&&(b=c[0]);return b?this.defaultViewContent=b.innerHTML:null},getWidgetEvents:function(){if(this.widgetEvents)return this.widgetEvents;for(var a={},b=this.rootElement.attributes,c=0;c<b.length;c++){var d=b[c];if(null!==d.name&&0===d.name.indexOf("on")){var e=this.rootElement.getAttribute(d.name);"undefined"!=typeof e&&null!==e&&(a[d.name]=e)}}return this.widgetEvents=
- a},_addWire:function(){},_removeWire:function(){},addWire:function(){},removeWire:function(){},_getPublicEvents:function(){return null},getWires:function(){return[]},getWireModel:function(){return null},getAttributes:function(){if(!this.attributeProperties){var a=this.getItemSets()[iwConstants.ATTRIBUTES],b={};if(a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);this.attributeProperties=new com.ibm.mm.iwidget.widget.ModifiablePropertiesImpl(b)}return this.attributeProperties},
- getIDescriptorItems:function(){if(!this.idescriptorProperties){var a=this.getItemSets()[iwConstants.IDESCRIPTOR],b={};if(a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);this.idescriptorProperties=new com.ibm.mm.iwidget.widget.ModifiablePropertiesImpl(b)}return this.idescriptorProperties},_getItemSets:function(){if(this.itemSets)return this.itemSets;this.loadItemSets();return this.itemSets},getItemSets:function(){return this._getItemSets()},getItemSet:function(a){if(!a)return null;
- var b=this._getItemSets();if(b&&b[a])return b[a]},loadItemSets:function(){this.itemSets=this._loadItemSetsOptimized(this.rootElement,this.ns)},_loadItemSetsOptimized:function(a,b){var c={};a.childNodes.length&&dojo.query("> ."+b+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwItemSet+" > ."+b+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwItem,a).forEach(function(a){var e=dojo.attr(a.parentNode,"title");e&&(c[e]||(c[e]={}),a=this._loadItemOptimized(a,b),c[e][a.id]=a)},this);return c},_loadItemOptimized:function(a,
- b){var c=com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE,d={id:com.ibm.mm.iwidget.Utils.stripHashPrefix(dojo.attr(a,"href")),readOnly:dojo.hasClass(a,b+c.iwReadOnly)},e=dojo.attr(a,"lang");e&&(d.defaultLocale=e);c=dojo.query("> ."+b+c.iwValue,a);c.length?(d.values={},c.forEach(function(a){var b=dojo.attr(a,"lang")||e;d.values[b]=com.ibm.mm.enabler.utils.Dom.textContent(a)})):(c=com.ibm.mm.enabler.utils.Dom.textContent(a),dojo.isString(c)&&(d.value=dojo.string.trim(c)));return d},_invalidateItemSets:function(a){a?
- this.itemSets[a]={}:this.itemSets={}},_getInstanceMarkup:function(){var a=dojo.clone(this.rootElement);dojo.query("> ."+this.ns+"Content",a).forEach(function(a){com.ibm.mm.enabler.utils.Dom.destroyNode(a)});dojo.query("> ."+this.ns+"loading",a).forEach(function(a){com.ibm.mm.enabler.utils.Dom.destroyNode(a)});var b=document.createElement("div");b.appendChild(a);return b.innerHTML}});com.ibm.mm.iwidget.widget.IWidgetInstanceImpl=com.ibm.mm.iwidget.widget.IWidgetInstanceDefaultImpl;ibmConfig.enablerLayerModules&&
- 0<=dojo.indexOf(ibmConfig.enablerLayerModules,"iWidget")&&dojo.require("com.ibm.mm.iwidget.widget.IWidgetInstanceExtendedImpl");dojo.declare("com.ibm.mashups.iwidget.widget.IWidgetWrapper",[com.ibm.mashups.iwidget.widget.WireProvider,com.ibm.mashups.iwidget.widget.EventProvider],{constructor:function(){},getIWidgetDefinition:function(){},setIWidgetDefinition:function(){},getIWidgetInstance:function(){},getMarkup:function(){},isLoaded:function(){},isStandalone:function(){},doRender:function(){}});
- dojo.declare("com.ibm.mm.enabler.aggregation.javascript.Filter",null,{constructor:function(){},doFilter:function(){},evalGlobal:function(a){window.execScript?window.execScript(this._stripHTMLComments(a),"JavaScript"):h(a)},_stripHTMLComments:function(a){return a=a.replace(/<\!--[^(--\>)]+--\>/g,"")},prepareDocumentWrite:function(a){var b=this;document.write=function(){b._documentWrite(a,document.write.arguments)};document.writeln=function(){b._documentWrite(a,document.writeln.arguments)}},_documentWrite:function(a,
- b){for(var c=0,d=b.length;c<d;c++)a.content+=b[c]},applyDocumentWrite:function(a,b){var c=b.content||null;if(null!==c&&0<c.length){var d=0;dojo.isIE&&(c="<br>"+c,d++);var c=dojo.create("div",{innerHTML:c}),e=dojo.isIE||dojo.isWebKit||dojo.isOpera,f=c.childNodes||null;if(null!==f&&0<f.length){for(var g=a,m,p=[];d<(m=f.length);)m=f[m-1],dojo.place(m,g,"before"),e&&(m.tagName&&"script"==m.tagName.toLowerCase())&&p.unshift(m),g=m;e&&dojo.forEach(p,function(a){com.ibm.mm.enabler.aggregation.javascript.JAVASCRIPT_HANDLER.handle(a)})}dojo.destroy(c)}}});
- dojo.declare("com.ibm.mm.enabler.aggregation.javascript.ExternalScriptFilter",com.ibm.mm.enabler.aggregation.javascript.Filter,{doFilter:function(a){var b=this._getScriptUrl(a),c=!1;b&&(c=(c=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.PROXY_URL))||null,null!==c&&(b=this._rewriteURL(b,c+"/")),c={content:""},this.prepareDocumentWrite(c),this._loadExternalScript(b),this.applyDocumentWrite(a,
- c),c=!0);return c},_getScriptUrl:function(a){var b=null;if(a.getAttribute)b=a.getAttribute("src");else{var c=a.toLowerCase().indexOf("<script"),d=a.toLowerCase().indexOf(">"),a=a.substring(c,d),c=a.toLowerCase().indexOf("src");if(-1!=c){var b=a.indexOf("'",c),d=a.indexOf('"',c),e='"',c=d;if(-1==d||-1!=b&&b<d)e="'",c=b;b=a.indexOf(e,c+1);b=a.substring(c+1,b)}}return b},loadExternalScript:function(a){var b=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.PROXY_URL),
- b=b||null;null!==b&&(a=this._rewriteURL(a,b+"/"));this._loadExternalScript(a)},_loadExternalScript:function(a){var b=this;dojo.xhrGet({url:a,load:function(a){b.evalGlobal(a)},sync:!0,handleAs:"text"})},_rewriteURL:function(a,b){var c=b,d=window.location.host,e=window.location.protocol;if(0>a.indexOf("://")||0===a.indexOf(e)&&a.indexOf(d)==e.length+2)return a;c=0===a.indexOf("https")?c+"https/":c+"http/";return c+=a.substr(a.indexOf("://")+3)}});dojo.declare("com.ibm.mm.enabler.aggregation.javascript.FilterChain",
- null,{constructor:function(){this._filters=[]},addFilter:function(a){this._filters||(this._filters=[]);this._filters.push(a)},applyFilters:function(a){for(var b=!1,c=0,d=this._filters.length;c<d&&!b;c++)b=this._filters[c].doFilter(a);return b}});dojo.declare("com.ibm.mm.enabler.aggregation.javascript.InlineScriptFilter",com.ibm.mm.enabler.aggregation.javascript.Filter,{doFilter:function(a){var b=!1,c="";if(dojo.isString(a))var c=a.indexOf(">"),d=a.lastIndexOf("<"),c=a.substring(c+1,d);else c=a.innerHTML;
- c&&(d={content:""},this.prepareDocumentWrite(d),this.evalGlobal(c),b=!0,this.applyDocumentWrite(a,d));return b}});dojo.declare("com.ibm.mm.enabler.aggregation.javascript.WidgetJavascriptHandler",null,{constructor:function(){this.filterChain=new com.ibm.mm.enabler.aggregation.javascript.FilterChain},handle:function(a){this.filterChain.applyFilters(a)}});com.ibm.mm.enabler.aggregation.javascript.JAVASCRIPT_HANDLER=new com.ibm.mm.enabler.aggregation.javascript.WidgetJavascriptHandler;com.ibm.mm.enabler.aggregation.javascript.JAVASCRIPT_HANDLER.filterChain.addFilter(new com.ibm.mm.enabler.aggregation.javascript.ExternalScriptFilter);
- com.ibm.mm.enabler.aggregation.javascript.JAVASCRIPT_HANDLER.filterChain.addFilter(new com.ibm.mm.enabler.aggregation.javascript.InlineScriptFilter);dojo.declare("com.ibm.mashups.iwidget.Constants",null,{WIDGET_LOADED:"com.ibm.mashups.iwidget.widgetloaded",RESIZE_WIDGET:"com.ibm.mashups.iwidget.resizewidget",UNLOAD_WIDGETS:"com.ibm.mashups.iwidget.unloadwidgets",WIDGETS_UNLOADED:"com.ibm.mashups.iwidget.widgetsunloaded",WIDGET_MODECHANGED:"com.ibm.mashups.iwidget.widgetmodechanged",CHANGE_WIDGETMODE:"com.ibm.mashups.iwidget.changewidgetmode",
- WIDGET_WINDOWSTATECHANGED:"com.ibm.mashups.iwidget.widgetwindowstatechanged",CHANGE_WIDGETWINDOWSTATE:"com.ibm.mashups.iwidget.changewidgetwindowstate",NAVSTATE_UPDATED:"com.ibm.mashups.enabler.model.state.onNavStateUpdated"});com.ibm.mashups.iwidget.Constants=new com.ibm.mashups.iwidget.Constants;dojo.declare("com.ibm.mashups.iwidget.iEvents",null,{constructor:function(){},fireEvent:function(){},setEvent:function(){},setEvents:function(){},removeEvent:function(){},removeEvents:function(){},getEvents:function(){},
- createEventDescription:function(){}});dojo.declare("com.ibm.mashups.iwidget.IEvent",null,{constructor:function(){},name:"",type:"",payload:null,source:""});dojo.declare("com.ibm.mm.iwidget.IEventImpl",com.ibm.mashups.iwidget.IEvent,{constructor:function(a,b,c,d){this.name=a;this.type="undefined"!=typeof b?b:null;this.payload="undefined"!=typeof c?c:null;this.source="undefined"!=typeof d?d:null;this.source=d}});dojo.declare("com.ibm.mm.iwidget.icontext.IContextIEventsImpl",com.ibm.mashups.iwidget.iEvents,
- {constructor:function(a){this.widget=a;this.id=a.id;this.svc=com.ibm.mashups.services.ServiceManager.getService("eventService");this.timer=null;this.timerEventQ=[];this.allTargetWidgetsLoaded=!1},createEventDescription:function(a){return new com.ibm.mm.iwidget.IEventDescriptionImpl(a)},getEvents:function(a){a=this.widget._getPublicEvents().getEvents(a);if(!a)return null;var b=[],c;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(a[c].clone());return b},setEvent:function(a){var b=this.widget._getPublicEvents(),
- c=b.eventExists(a.name),d=!1;if(d=c?b.isUpdateEventRequired(a):!0)(b=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.iwidget.services.ContainerService.SERVICE_NAME))&&b.switchToModifiablePersistenceMode(com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_EVENTS);b=this.widget._getPublicEvents();(c=b.eventExists(a.name))?(this.widget._inIframe()&&this.svc._publishEvent(this.svc.WIDGETEVENT_PREFIX+"_stub_"+this.id,{scope:"eventmodel",methodname:"updateEvent",params:[a.toJson()]},
- this.id),c=b.updateEvent(a)):(this.widget._inIframe()&&this.svc._publishEvent(this.svc.WIDGETEVENT_PREFIX+"_stub_"+this.id,{scope:"eventmodel",methodname:"createEvent",params:[a.toJson()]},this.id),c=b.createEvent(a));return c},removeEvent:function(a){var b=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.iwidget.services.ContainerService.SERVICE_NAME);b&&b.switchToModifiablePersistenceMode(com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_EVENTS);this.widget._inIframe()&&
- this.svc._publishEvent(this.svc.WIDGETEVENT_PREFIX+"_stub_"+this.id,{scope:"eventmodel",methodname:"removeEvent",params:[a]},this.id);return this.widget._getPublicEvents().removeEvent(a)},publishEvent:function(a,b,c){return this.fireEvent(a,c,b)},fireEvent:function(a,b,c){if(this.allTargetWidgetsLoaded)this._fireEventFinish(a,b,c);else if(this.timerEventQ.push({eventName:a,payloadType:b,payload:c}),!this.timer){for(var a=com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel(),b=dojo.query("."+
- this.widget.ns+"ReceivedEvent",this.widget.rootElement),c=[],d=0;d<b.length;d++){var e=dojo.query("."+this.widget.ns+"SourceEvent",b[d])[0];e&&-1!=e.getAttribute("href").indexOf(this.widget.id)&&(e=a.find(b[d].parentNode.id))&&c.push(e)}this.timer_tries=0;this.timer=setInterval(dojo.hitch(this,"_fireEventContinue",c),5)}},_fireEventContinue:function(a){for(var b=0;b<a.length;b++)if(!a[b].isLoaded()&&20>this.timer_tries){this.timer_tries++;return}clearInterval(this.timer);for(this.timer_tries=0;0<
- this.timerEventQ.length;)a=this.timerEventQ.shift(),this._fireEventFinish(a.eventName,a.payloadType,a.payload);this.allTargetWidgetsLoaded=!0;this.timer=null},_fireEventFinish:function(a,b,c){var d=this.widget._getPublicEvents(),e=!1,f;if(d){if(f=d.find(a))b=f.type;f&&f.handlingFn&&(e=!0)}f=new com.ibm.mm.iwidget.IEventImpl(a,b,c,null);e||this.widget.handleEvent(f);d&&(f=d.find(a))&&f.isPublished&&this.svc.publishWire(this.id,a,c,b)},setEvents:function(a){var b=this.widget._getPublicEvents();if(this.widget._inIframe()){for(var c=
- [],d=0;d<a.length;d++)c.push(a[d].toJson());this.svc._publishEvent(this.svc.WIDGETEVENT_PREFIX+"_stub_"+this.id,{scope:"eventmodel",methodname:"setEvents",params:[c]},this.id)}return rc=b.setEvents(a)},removeEvents:function(a){this.widget._inIframe()&&this.svc._publishEvent(this.svc.WIDGETEVENT_PREFIX+"_stub_"+this.id,{scope:"eventmodel",methodname:"removeEvents",params:[a]},this.id);return this.widget._getPublicEvents().removeEvents(a)}});dojo.declare("com.ibm.mashups.iwidget.io",null,{constructor:function(){},
- XMLHttpRequest:function(){},rewriteURI:function(){return null},xhrReq:function(){}});dojo.declare("com.ibm.mm.iwidget.icontext.IContextIOImpl",com.ibm.mashups.iwidget.io,{constructor:function(a){this.id=a.id;this.widget=a},XMLHttpRequest:function(){return dojo._xhrObj()},rewriteURI:function(a,b){return this.widget._rewriteURI(a,b)},getWebAppRootPath:function(){if(this.rootPath)return this.rootPath;var a=this.widget.getIWidgetInstance().widgetXMLUrl,a=this.widget._getRawBaseUri(a),a=this.widget._getResolvedPocUri(a),
- b=null;a&&0===a.indexOf("/")&&(b=a.substring(1),b=0<b.indexOf("/")?"/"+b.substring(0,b.indexOf("/")):a);if(b)return this.rootPath=b;a&&0<a.indexOf("://")&&(a=a.split("/"),4<=a.length&&(b=a[0]+"//"+a[2]+"/"+a[3]));return b?this.rootPath=b:null},request:function(a,b,c,d,e){var f=dojo._xhrObj(),b=this.rewriteURI(b),g=!1;c&&(f.onreadystatechange=c,g=!0);c=a||null;a||(c=this.httpmethods.GET);a&&!this.httpmethods[a]&&(c=this.httpmethods.GET);f.open(c,b,g);a=null;if(e)for(b=0;b<e.length;b++){var g=e[b],
- m=g[m],p=g[p];"Content-Type"==m?a=p:f.setRequestHeader(m,p)}f.setRequestHeader("Content-Type",a||"application/x-www-form-urlencoded");c==this.httpmethods.PUT||c==this.httpmethods.POST?d&&f.send(d):f.send(null);return f},xhrReq:function(a){if(a&&a.requestVerb&&a.url&&a.handleAs){var b=a.requestVerb;b&&!this.requestVerbs[b]&&(b=this.requestVerbs.get);b&&b==this.requestVerbs.get?(delete a.requestVerb,dojo.xhrGet(a)):b&&b==this.requestVerbs.put?(delete a.requestVerb,a.msgData&&(a.putData=a.msgData,delete a.msgData),
- dojo.xhrPut(a)):b&&b==this.requestVerbs["delete"]?(delete a.requestVerb,dojo.xhrDelete(a)):b&&b==this.requestVerbs.post&&(delete a.requestVerb,a.msgData&&(a.postData=a.msgData,delete a.msgData),dojo.xhrPost(a))}},httpmethods:{GET:"GET",PUT:"PUT",POST:"POST",DELETE:"DELETE"},requestVerbs:{get:"get",put:"put",post:"post","delete":"delete"}});dojo.declare("com.ibm.mashups.iwidget.iContext",null,{constructor:function(){},constants:{mode:{VIEW:"view",EDIT:"edit",PERSONALIZE:"personalize",CONFIG:"config",
- HELP:"help"},event:{TITLE:"title",DESCRIPTION:"description"},ATTRIBUTES:"attributes",IDESCRIPTOR:"idescriptor",USERPROFILE:"userprofile",keys:{SHIFT:1,ALT:2,CTRL:4,META:8,CAPSLOCK:16},windowstate:{NORMAL:"normal",MINIMIZE:"minimize",MAXIMIZE:"maximize"},status:{SUCCESS:200,TIMEOUT:408,NOTFOUND:404,INTERROR:500,OTHER:303},changeType:{CHANGEDVALUE:"changedValue",NEWITEM:"newItem",REMOVEDITEM:"removedItem"}},getWidgetId:function(){return null},getRootElement:function(){return null},getElementById:function(){return null},
- getiWidgetAttributes:function(){return{}},getItemSet:function(){return null},getShareableItemSet:function(){return null},requires:function(){},iScope:function(){return null},processMarkup:function(){return null},processiWidgets:function(){},getElementByClass:function(){return null},getUserProfile:function(){return null},getiDescriptor:function(){return null},io:{},iEvents:{}});dojo.declare("com.ibm.mm.iwidget.icontext.IContextDefaultImpl",com.ibm.mashups.iwidget.iContext,{constructor:function(a){this.widgetwrapper=
- a;this.widgetId=a.id;this.scope={};this.rootElement=dojo.byId(this.widgetId);this.ns=this.rootElement.className.substr(0,3);this._initEvents();this._initIO();this._initMMExtension()},_destroy:function(){this.rootElement&&(this.rootElement=null)},getWidgetId:function(){return this.widgetId?this.widgetId:null},_initEvents:function(){this.iEvents=null},_initMMExtension:function(){this._mm=null},getRootElement:function(){return dojo.byId(this.widgetId)},getElementById:function(a,b){b||(b=this._getContentRoot());
- var c=[];return com.ibm.mm.iwidget.Utils.findElementByAttribute("id",a,b,c,!1)?c[0]:null},getiWidgetAttributes:function(){return this.widgetwrapper.getAttributes()},getItemSet:function(a){return"undefined"==typeof a||null===a?null:a==iwConstants.ATTRIBUTES?this.getiWidgetAttributes():a==iwConstants.USERPROFILE?this.getUserProfile():a==iwConstants.IDESCRIPTOR?this.getiDescriptor():this.widgetwrapper.getWidgetItemSet(a)},iScope:function(){return this.scope},processMarkup:function(a){return a.replace(/_IWID_/g,
- "_"+this.widgetId+"_").replace(/iContext(?=\.|\s|\(|\))/g,"_"+this.widgetId+"_iContext")},getElementByClass:function(a,b){b||(b=this._getContentRoot());var c=dojo.query("."+a,b);if("undefined"!=typeof c&&null!==c&&0!==c.length){for(var d=[],e=0;e<c.length;e++)d.push(c[e]);return d}return null},getWidgetXMLPath:function(){var a=this.widgetwrapper.getIWidgetInstance().widgetXMLUrl,b=a.indexOf("?");0<b&&(a=a.substring(0,b));(b=com.ibm.mm.enabler.EndpointUtils.checkForEndpoints(a))&&(a=b);return a},_getWidgetBaseUri:function(){var a=
- this.widgetwrapper.getIWidgetInstance().widgetXMLUrl,b=a.indexOf("?");0<b&&(a=a.substring(0,b));return a.substring(0,a.lastIndexOf("/")+1)},_getContentRoot:function(){var a=this.getRootElement(),b=this.widgetwrapper.currentMode;b||(b="view");if(b=this.widgetwrapper.windowManager[b])(b=b.root)&&(a=b);return a},getiDescriptor:function(){return this.widgetwrapper.getIDescriptorItems()},_initIO:function(){this.io=new com.ibm.mm.iwidget.icontext.IContextIOImpl(this.widgetwrapper)},getUserProfile:function(){return null},
- requires:function(){},processiWidgets:function(){}});com.ibm.mm.iwidget.icontext.IContextImpl=com.ibm.mm.iwidget.icontext.IContextDefaultImpl;ibmConfig.enablerLayerModules&&0<=dojo.indexOf(ibmConfig.enablerLayerModules,"iWidget")&&dojo.require("com.ibm.mm.iwidget.icontext.IContextExtendedImpl");dojo.declare("com.ibm.mashups.iwidget.itemset.ManagedItemSetCallbackModel",null,{constructor:function(){},postSaveCallbackFn:function(){}});dojo.declare("com.ibm.mashups.iwidget.itemset.ManagedItemSet",null,
- {constructor:function(){},save:function(){},commit:function(){},setItemValue:function(){return this},setItemValue:function(){return this},getItemValue:function(){return null},getAllNames:function(){return null},removeItem:function(){return null},clone:function(){return null},isReadOnly:function(){return null},getItemSetDescription:function(){return null},addListener:function(){return null},removeListener:function(){return!0}});dojo.declare("com.ibm.mashups.iwidget.services.EventService",null,{SERVICE_NAME:"eventService",
- constructor:function(){},fireEvent:function(){},broadcastEvent:function(){},broadcastEvent:function(){},broadcastEvent:function(){},broadcastEvents:function(){},broadcastEvents:function(){},broadcastEvents:function(){},publishEvent:function(){},subscribeEvent:function(){},unsubscribeEvent:function(){}});com.ibm.mashups.iwidget.services.EventService.SERVICE_NAME="eventService";dojo.declare("com.ibm.mm.iwidget.manageditemset.IDescriptorDefaultImpl",com.ibm.mashups.iwidget.itemset.ManagedItemSet,{constructor:function(a,
- b,c){this.widget=a;this.defiDescriptorItems=b;this.instanceiDescriptorItems=c;this.navStateModel=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel();this._updatedItems={}},readOnlyItems:{defaultHeight:"defaultHeight",defaultWidth:"defaultWidth",displayLocale:"displayLocale",messageLocale:"messageLocale",author:"author",email:"email",website:"website",version:"version",icon:"icon"},writableItems:{title:"title",name:"name",description:"description",availableMessageLocales:"availableMessageLocales",
- mode:"mode",windowState:"windowState"},localizedItems:{title:"title",name:"name",description:"description"},getItemValue:function(a){if("undefined"==typeof a||null===a)return null;var b=null;if(a==iwConstants.iDescriptorItems.mode){if(a=this.widget)b=a.currentMode}else a==iwConstants.iDescriptorItems.displayLocale?(b=ibmConfig.locale,(a=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.DISPLAY_LOCALE))&&
- (b=a)):b=a==iwConstants.iDescriptorItems.messageLocale?this._getMessageLocale():a==iwConstants.iDescriptorItems.windowState?this._getWindowState():this._getItemValue(a);return b},_getWindowState:function(){return"normal"},_getItemValue:function(a){var b=null,c=null,d=null;this.localizedItems[a]&&(d=this._getMessageLocale());a==iwConstants.iDescriptorItems.title&&(c=this._getDynamicTitle());null===c&&this.instanceiDescriptorItems&&(c=this.instanceiDescriptorItems.getItemValue(a,d));null===c&&this.defiDescriptorItems&&
- (b=this.defiDescriptorItems.getItemValue(a,d),"undefined"==typeof b&&(b=null));return null!==c?c:b},_getDynamicTitle:function(){return null},_setDynamicTitleOrIcon:function(){},setItemValue:function(a,b){if("undefined"==typeof a||null===a||("undefined"==typeof b||null===b)||this.readOnlyItems[a])return null;if(a==iwConstants.iDescriptorItems.mode){var c=this._getWidgetDef().getSupportedModes();if(this._contains(c,b))this._updatedItems[a]=b;else return null}if(a==iwConstants.iDescriptorItems.windowState)if(c=
- this._getWidgetDef().getSupportedWindowStates(),this._contains(c,b))this._updatedItems[a]=b;else return null;this.widget.id&&(a==iwConstants.iDescriptorItems.title||a==iwConstants.iDescriptorItems.icon)&&this._setDynamicTitleOrIcon(a,b);c=null;this.localizedItems[a]&&(c=this._getMessageLocale());(a==this.writableItems.title||a==this.writableItems.name||a==this.writableItems.description)&&this.instanceiDescriptorItems.setItemValue(a,b,!1,c);a==iwConstants.iDescriptorItems.availableMessageLocales&&
- this.instanceiDescriptorItems.setItemValue(a,b,!1);return this},isReadOnly:function(a){return"undefined"==typeof a||null===a?!1:this.readOnlyItems[a]?!0:!1},removeItem:function(){return null},getAllNames:function(){var a={};if(this.defiDescriptorItems){var b=this.defiDescriptorItems.getAllNames(),c;for(c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[b[c]]=!0)}if(this.instanceiDescriptorItems){var b=this.instanceiDescriptorItems.getAllNames(),d;for(d in b)Object.prototype.hasOwnProperty.call(b,
- d)&&(a[b[d]]=!0)}d=[];for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&d.push(e);return d},save:function(a){return this.commit(a)},commit:function(a){this.serverless&&this._saveMicroformat();this._updatedItems[iwConstants.iDescriptorItems.mode]&&this.widget._handleOnModeChange(this._updatedItems[iwConstants.iDescriptorItems.mode]);if(this._updatedItems[iwConstants.iDescriptorItems.windowState]){var b=this._updatedItems[iwConstants.iDescriptorItems.windowState],c=this._getWindowState();com.ibm.mashups.services.ServiceManager.getService("eventService").publishEvent(com.ibm.mashups.iwidget.Constants.CHANGE_WIDGETWINDOWSTATE,
- {id:this.widget.id,newWindowState:b,oldWindowState:c})}a&&a(iwConstants.IDESCRIPTOR,!0)},_saveMicroformat:function(){this.widget.commit();var a={};a.wid=this.widget.id;this.widget.eventSvr._publishEvent(iwConstants.EVENTS.onAttributeSaved,a,this.widget.hubId)},addListener:function(a){return this.widget._registerListener(iwConstants.IDESCRIPTOR,a)},removeListener:function(a){return this.widget._removeListener(iwConstants.IDESCRIPTOR,a)},_getWidgetDef:function(){return this.widget.widgetDef},_contains:function(a,
- b){for(var c=!1,d=0;d<a.length;d++)if(b==a[d]){c=!0;break}return c},_getMessageLocale:function(){if(this.messageLocale)return this.messageLocale;var a=null,b=this._getItemValue(iwConstants.iDescriptorItems.messageLocale);if(b){var b=b.split(" "),c=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.DISPLAY_LOCALE);c&&(a=this._getLocale(b,c,ibmConfig.locale))}a||(a=ibmConfig.locale);
- return this.messageLocale=a},_getLocale:function(a,b,c){switch(a.length){case 0:return null;case 1:return com.ibm.mm.enabler.utils.LocaleHelper.normalizeLocale(a[0]);default:return(b=com.ibm.mm.enabler.utils.LocaleHelper.matchLocale(b,a))?b:(c=com.ibm.mm.enabler.utils.LocaleHelper.matchLocale(c,a))?c:com.ibm.mm.enabler.utils.LocaleHelper.normalizeLocale(a[0])}}});com.ibm.mm.iwidget.manageditemset.IDescriptorImpl=com.ibm.mm.iwidget.manageditemset.IDescriptorDefaultImpl;ibmConfig.enablerLayerModules&&
- 0<=dojo.indexOf(ibmConfig.enablerLayerModules,"iWidget")&&dojo.require("com.ibm.mm.iwidget.manageditemset.IDescriptorExtendedImpl");dojo.declare("com.ibm.mm.iwidget.manageditemset.InternalPersistentAttributesToPreferenceModelAdapter",com.ibm.mashups.iwidget.itemset.ManagedItemSet,{constructor:function(a,b,c){this.serverless=b?!0:!1;this.modes=iwConstants.mode;this.widget=a;this.widgetInstance=this.widget.getIWidgetInstance();this.instanceAttributes=this.widgetInstance.getAttributes();this.defAttributes=
- this.widget.widgetDef.getAttributes();this.parent=c;this.mode=this._getMode(null)},setItemValue:function(a,b){return!a||!b||this.isReadOnly(a)?null:this.serverless&&this.mode==this.modes.EDIT&&(this.instanceAttributes.setItemValue(a,b),this.parent)?this.parent:null},getItemValue:function(a,b){if(!a)return null;var c;if(this.serverless){"undefined"===typeof b&&(b=!0);if(this.mode==this.modes.CONFIG)return c=this.defAttributes.getItemValue(a),"undefined"===typeof c&&(c=null),c;if(this.mode==this.modes.EDIT&&
- !b)return c=this.instanceAttributes.getItemValue(a),"undefined"===typeof c&&(c=null),c;if(b)return(c=this.instanceAttributes.getItemValue(a))||(c=this.defAttributes.getItemValue(a)),"undefined"===typeof c&&(c=null),c}return null},getAllNames:function(a){if(this.serverless){"undefined"===typeof a&&(a=!0);if(this.mode==this.modes.CONFIG)return(a=this.defAttributes.getAllNames())&&a.length&&0===a.length?null:a;if(this.mode==this.modes.EDIT&&!a)return(a=this.instanceAttributes.getAllNames())&&a.length&&
- 0===a.length?null:a;var b;if(a){var a=this.instanceAttributes.getAllNames(),c={};if(a&&a.length&&0<a.length)for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&(b=a[d],c[b]=b);if((a=this.defAttributes.getAllNames())&&a.length&&0<a.length)for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(b=a[e],c[b]=b);return this._getNamesArray(c)}}return null},removeItem:function(a){return!a||this.isReadOnly(a)?null:this.serverless&&this.mode==this.modes.EDIT&&(this.instanceAttributes.removeItem(a),
- this.parent)?this.parent:null},isReadOnly:function(a,b){if(!a)return!1;if(this.serverless){"undefined"===typeof b&&(b=!0);if(this.mode==this.modes.CONFIG)return this.defAttributes.isReadOnly(a);if(this.mode==this.modes.EDIT&&b){var c=this.defAttributes.isReadOnly(a);c||(c=this.instanceAttributes.isReadOnly(a));return c}if(this.mode==this.modes.EDIT)return this.instanceAttributes.isReadOnly(a)}return!1},commit:function(a){if(this.serverless)this._saveMicroformat();else return null;a&&a(iwConstants.ATTRIBUTES,
- !0);return this},_getNamesArray:function(a){var b=0,c=[],d;for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c.push(d),b++);return 0===b?null:c},_saveMicroformat:function(){this.widget.commit();var a={};a.wid=this.widget.id;this.widget.eventSvr._publishEvent(iwConstants.EVENTS.onAttributeSaved,a,this.widget.hubId)},_getMode:function(a){var b=this.modes.EDIT,b=a?a:this.widget.currentMode;b==this.modes.VIEW&&(b=this.modes.EDIT);return b},addListener:function(a){return this.widget._registerListener(iwConstants.ATTRIBUTES,
- a)},removeListener:function(a){return this.widget._removeListener(iwConstants.ATTRIBUTES,a)}});dojo.declare("com.ibm.mm.iwidget.manageditemset.PersistentAttributes",com.ibm.mashups.iwidget.itemset.ManagedItemSet,{constructor:function(a,b){this._internalPersistentAttributesToPreferenceModelAdapter=new com.ibm.mm.iwidget.manageditemset.InternalPersistentAttributesToPreferenceModelAdapter(a,b,this)},setItemValue:function(a,b){return this._internal().setItemValue(a,b,!0)},getItemValue:function(a){return this._internal().getItemValue(a,
- !0)},getAllNames:function(){return this._internal().getAllNames(!0)},removeItem:function(a){return this._internal().removeItem(a)},isReadOnly:function(a){return this._internal().isReadOnly(a,!0)},save:function(a){return this.commit(a)},commit:function(a){return this._internal().commit(a)},_internal:function(){return this._internalPersistentAttributesToPreferenceModelAdapter},addListener:function(a){return this._internal().addListener(a)},removeListener:function(a){return this._internal().removeListener(a)}});
- dojo.declare("com.ibm.mashups.iwidget.itemset.ItemSet",null,{constructor:function(){},setLocalizedItemValue:function(){return this},setItemValue:function(){return this},setItemValue:function(){return this},getLocalizedItemValue:function(){return null},getItemValue:function(){return null},getAllNames:function(){return null},removeItem:function(){return null},removeItemValue:function(){return null},removeLocalizedItemValue:function(){return null},getLocalesWithValues:function(){return null},clone:function(){return null},
- isReadOnly:function(){return!1},getItemSetDescription:function(){return null},addListener:function(){return null},removeListener:function(){return!0}});dojo.declare("com.ibm.mm.iwidget.itemset.ItemSetDefaultImpl",com.ibm.mashups.iwidget.itemset.ItemSet,{constructor:function(a,b,c){this.widget=a;this.name=c;var d=this.widget.getIWidgetInstance(),a=null;d&&(a=d.getItemSet(c));c={};if(b){if(b)for(var e in b.items)Object.prototype.hasOwnProperty.call(b.items,e)&&(c[e]=dojo.clone(b.items[e]));this.properties=
- new com.ibm.mm.iwidget.widget.ModifiablePropertiesImpl(c)}this.properties||(this.properties=new com.ibm.mm.iwidget.widget.ModifiablePropertiesImpl(c));if(a)for(var f in a)if(Object.prototype.hasOwnProperty.call(a,f)){b=a[f];if(b.values)for(var g in b.values)Object.prototype.hasOwnProperty.call(b.values,g)&&this.properties.setItemValue(f,b.values[g],!1,g);b.value&&this.properties.setItemValue(f,b.value)}},_getResourceBundle:function(){this.iwMessages||(this.iwMessages=dojo.i18n.getLocalization("com.ibm.mm.enabler",
- "iwMessages"));return this.iwMessages},_logDeprecated:function(){this._getResourceBundle()},getLocalesWithValues:function(a){return this.properties.getItemLocales(a)},setLocalizedItemValue:function(a,b,c){return!a||!c||!("undefined"!=typeof b&&null!==b)?null:(rc=this.properties.setItemValue(a,b,!1,c))?this:null},setItemValue:function(a,b,c){if(!a||!("undefined"!=typeof b&&null!==b))return null;if(c)if(c&&!dojo.isString(c))this._logDeprecated("setItemValue","ItemSet.setItemValue(itemName,value,readOnly)",
- "ItemSet.setItemValue(item,value)"),rc=this.properties.setItemValue(a,b,!1);else return this._logDeprecated("setItemValue","ItemSet.setItemValue(itemName,value,locale)","ItemSet.setLocalizedItemValue(item,value,locale)"),this.setLocalizedItemValue(a,b,c);else rc=this.properties.setItemValue(a,b,!1);return rc?this:null},getLocalizedItemValue:function(a,b){return!a||!b?null:this.properties.getLocalizedItemValue(a,b)},getItemValue:function(a,b){return!a?null:b?(this._logDeprecated("getItemValue","ItemSet.getItemValue(itemName,locale)",
- "ItemSet.getLocalizedItemValue(item,locale)"),this.getLocalizedItemValue(a,b)):this.properties.getItemValue(a)},getAllNames:function(){return(rc=this.properties.getAllNames())&&0===rc.length?null:rc},removeItem:function(a,b){return!a?null:b?(this._logDeprecated("removeItem","ItemSet.removeItem(itemName,locale)","ItemSet.removeLocalizedItemValue(itemName,locale)"),this.removeLocalizedItemValue(a,b)):(rc=this.properties.removeItem(a))?this:null},removeLocalizedItemValue:function(a,b){return!a||!b?null:
- (rc=this.properties.removeItemValue(a,b))?this:null},removeItemValue:function(a){return!a?null:(rc=this.properties.removeItemValue(a))?this:null}});dojo.declare("com.ibm.mm.iwidget.DeferredLiveTextUnprocessStubImpl",com.ibm.mm.enabler.DeferredImpl,{constructor:function(a){this.wrapper=a},start:function(a){a||(a=dojo.clone(this.wrapper.rootElement),this._unchangeCompleteCallback(a))},setIncludeParent:function(a){this.includeParent=a},getIncludeParent:function(){return this.includeParent},_unchangeCompleteCallback:function(a){dojo.isFunction(this.getFinishedCallback())&&
- this.finish(a,200)}});dojo.declare("com.ibm.mashups.iwidget.services.ContainerService",null,{SERVICE_NAME:"iWidgetContainerService",PROVIDER_EVENTS:"events",PROVIDER_WIRES:"wires",PROVIDER_ATTRIBUTES:"attributes",registerOnChangeListener:function(){},getPersistenceMode:function(){},switchToModifiablePersistenceMode:function(){}});com.ibm.mashups.iwidget.services.ContainerService.SERVICE_NAME="iWidgetContainerService";com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_EVENTS="events";com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_WIRES=
- "wires";com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_ATTRIBUTES="attributes";dojo.declare("com.ibm.mm.iwidget.services.ContainerServiceImpl",com.ibm.mashups.iwidget.services.ContainerService,{constructor:function(){this._modModes=this._modes=null;this.TOPIC_BASE="/"+"com.ibm.mm.iwidget.services.ContainerServiceImpl".replace(/\./ig,"/")+"/";this.TOPIC_CHANGE=this.TOPIC_BASE+"change";this.TOPIC_CHANGE_EVENTS=this.TOPIC_CHANGE+"/events";this.TOPIC_CHANGE_WIRES=this.TOPIC_CHANGE+"/wires";
- this.TOPIC_CHANGE_ATTRIBUTES=this.TOPIC_CHANGE+"/attributes";this._topics={};this._topics[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_EVENTS]=this.TOPIC_CHANGE_EVENTS;this._topics[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_WIRES]=this.TOPIC_CHANGE_WIRES;this._topics[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_ATTRIBUTES]=this.TOPIC_CHANGE_ATTRIBUTES},_invalidate:function(){this._modModes=this._modes=null},_init:function(){if(!this._modes){var a=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME),
- b=a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.PERSISTENCE_MODE),c=a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.PERSISTENCE_MODE_EVENTS),d=a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.PERSISTENCE_MODE_WIRES),e=a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.PERSISTENCE_MODE_ATTRIBUTES);this._modes={};this._modes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_EVENTS]=c?c:b;this._modes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_WIRES]=
- d?d:b;this._modes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_ATTRIBUTES]=e?e:b;c=a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.PERSISTENCE_MODE_EVENTS_MODIFIABLE);d=a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.PERSISTENCE_MODE_WIRES_MODIFIABLE);e=a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.PERSISTENCE_MODE_ATTRIBUTES_MODIFIABLE);this._modModes={};this._modModes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_EVENTS]=c?c:b;this._modModes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_WIRES]=
- d?d:b;this._modModes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_ATTRIBUTES]=e?e:b}},registerOnChangeListener:function(a,b){this._init();var c=dojo.subscribe(this._topics[a],b.context,b.callback);dojo.isFunction(b.unregister)&&dojo.hitch(b.context,b.unregister)(c)},getPersistenceMode:function(a){this._init();return this._modes[a]},switchToModifiablePersistenceMode:function(){this._init();var a=this._modes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_EVENTS],b=this._modModes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_EVENTS],
- c=this._modes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_WIRES],d=this._modModes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_WIRES],e=this._modes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_ATTRIBUTES],f=this._modModes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_ATTRIBUTES];this._modes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_EVENTS]=b;this._modes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_WIRES]=d;this._modes[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_ATTRIBUTES]=
- f;a!=b&&(dojo.publish(this._topics[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_EVENTS],[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_EVENTS,a,b]),dojo.publish(this._topics[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_WIRES],[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_WIRES,c,d]),dojo.publish(this._topics[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_ATTRIBUTES],[com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_ATTRIBUTES,
- e,f]))}});com.ibm.mashups.services.ServiceManager.setService(com.ibm.mashups.iwidget.services.ContainerService.SERVICE_NAME,new com.ibm.mm.iwidget.services.ContainerServiceImpl);dojo.declare("com.ibm.mm.iwidget.manageditemset.AttributesModeDelegate",com.ibm.mashups.iwidget.itemset.ManagedItemSet,{constructor:function(a,b){this.persistentAttributesFactoryService=a;this.wrapper=b;this.callbackHandle={context:this,callback:"_attributesProviderModeChange",unregister:function(a){this.wrapper.unregisterArray.push(a)}};
- this.widgetAttributes=[];this.widgetAttributesReplay=[];this._skipRecord=!1;this._getAttributes()},_attributesProviderModeChange:function(){this.widgetAttributes=[];this._getAttributes();var a=this._getModeSelector(),b=this.widgetAttributesReplay[a];if(b){this._skipRecord=!0;for(var c=0;c<b.length;c++){var d=b[c];"set"==d[0]?this.setItemValue(d[1],d[2]):"remove"==d[0]&&this.removeItem(d[1])}this._skipRecord=!1}this.widgetAttributesReplay=[];this.widgetAttributesReplay[a]=[]},_getModeSelector:function(){var a=
- this.wrapper._getCurrentMode(),b=iwConstants.mode.PERSONALIZE;if(a==iwConstants.mode.CONFIG||a==iwConstants.mode.EDIT)b=a;return b},_getAttributes:function(){var a=this._getModeSelector();this.widgetAttributes[a]=this.widgetAttributes[a]||null;null===this.widgetAttributes[a]&&(this.widgetAttributes[a]=this.persistentAttributesFactoryService.createPersistentAttributes(this.wrapper,this.callbackHandle),this.callbackHandle=null);return this.widgetAttributes[a]},_record:function(a){if(!this._skipRecord){var b=
- this._getModeSelector();this.widgetAttributesReplay[b]=this.widgetAttributesReplay[b]||null;null===this.widgetAttributesReplay[b]&&(this.widgetAttributesReplay[b]=[]);this.widgetAttributesReplay[b].push(a)}},_clearReplay:function(){var a=this._getModeSelector();this.widgetAttributesReplay[a]=[]},setItemValue:function(a,b){this._record(["set",a,b]);return this._getAttributes().setItemValue(a,b)},getItemValue:function(a){return this._getAttributes().getItemValue(a,!0)},getAllNames:function(){return this._getAttributes().getAllNames(!0)},
- removeItem:function(a){this._record(["remove",a]);return this._getAttributes().removeItem(a)},isReadOnly:function(a){return this._getAttributes().isReadOnly(a,!0)},save:function(a){var b=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.iwidget.services.ContainerService.SERVICE_NAME);b&&b.switchToModifiablePersistenceMode(com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_ATTRIBUTES);this._clearReplay();return this._getAttributes().save(a)},commit:function(a){var b=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.iwidget.services.ContainerService.SERVICE_NAME);
- b&&b.switchToModifiablePersistenceMode(com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_ATTRIBUTES);this._clearReplay();return this._getAttributes().commit(a)},addListener:function(a){return this._getAttributes().addListener(a)},removeListener:function(a){return this._getAttributes().removeListener(a)}});dojo.declare("com.ibm.mm.iwidget.DeferredLoadImpl",com.ibm.mm.enabler.DeferredImpl,{constructor:function(a,b,c){this.uri=a;"undefined"==typeof b&&(b=null);this.id=b;"undefined"==typeof c&&
- (c=null);this.widgetDef=c},start:function(a){if(this.widgetDef)return this._handleCallback(this.widgetDef,200),this.widgetDef;com.ibm.mashups.services.ServiceManager.getService("widgetLoadService").getWidgetXML(this.uri,"undefined"==typeof a?!0:a,dojo.hitch(this,"_handleLoad"),this.id);return a?this.widgetDef:null},_handleLoad:function(a,b,c){c&&(b=c.status);200!=b&&(a=null);this.widgetDef=a;this._handleCallback(a,status)},_handleCallback:function(a,b){this.finish(a,b)}});dojo.declare("com.ibm.mm.iwidget.widget.IWidgetWrapperDefaultImpl",
- com.ibm.mashups.iwidget.widget.IWidgetWrapper,{constructor:function(a,b){this._internalIbmModes=iwConstants._INTERNALIBMMODES;this.rootElement=a;this.hubId=this.id=b||dojo.attr(a,"id");this.simpleWidgetEvents={};this.loaded=!1;this.widgetItemSets=this.widgetAttributes=this.standalone=null;this.ns=a.className.substr(0,3);this.windowManager={};this.iwMessages=null;this.eventSvr=com.ibm.mashups.services.ServiceManager.getService("eventService");this._jsHandler=com.ibm.mm.enabler.aggregation.javascript.JAVASCRIPT_HANDLER;
- this.eventHandlers=[];this.unregisterArray=[];this.publishedEvents={};this.handledEvents={}},getID:function(){return this.id},getIWidgetInstance:function(){return this.widgetInstance?this.widgetInstance:this.widgetInstance=new com.ibm.mm.iwidget.widget.IWidgetInstanceImpl(this,this.rootElement,this.id)},setIWidgetDefinition:function(a){this.widgetDef=a},getIWidgetDefinition:function(){return this.loaded?new com.ibm.mm.iwidget.DeferredLoadImpl(this.getIWidgetInstance().widgetXMLUrl,this.id,this.widgetDef):
- new com.ibm.mm.iwidget.DeferredLoadImpl(this.getIWidgetInstance().widgetXMLUrl,this.id)},getMarkup:function(){return new com.ibm.mm.iwidget.DeferredLiveTextUnprocessStubImpl(this)},doRender:function(){try{this.prepare(),this.execute()}catch(a){}},prepare:function(){var a="_"+this.id+"_iContext";dojo.global[a]=this.isModal()?parent[this._mainframeId][a]:new com.ibm.mm.iwidget.icontext.IContextImpl(this,this.ns);a=this.eventSvr._subscribeEvent(this.eventSvr.WIDGETEVENT_PREFIX+this.hubId,this,"handleEvent",
- null,this.hubId);this._inIframe()||this.eventHandlers.push(a)},execute:function(){this._initialize(dojo.hitch(this,function(){this._doRender()}))},_initialize:function(a){var b=this.widgetDef.getDefaultLanguage();this.defaultLanguage="undefined"!=typeof b&&null!==b?b:"en";b=this._getInitDefaultMode();null===b&&(b=iwConstants.mode_view);this.currentMode=b;this._handleSaveMode&&this._handleSaveMode();this._initManagedItemSet();a&&a()},_getResourceBundle:function(){return null},_logUpdateMarkupError:function(){},
- _getMarkupByMode:function(a){var b=this.widgetDef,c=b.getMarkupByMode(a);if(c&&c.uri){var d=this._rewriteURI(c.uri);dojo.xhrGet({url:d,handleAs:"text",sync:!0,load:function(c){if(c){var d={};d.content=c;b.setMarkupByMode(a,d)}},error:function(){delete c.uri}})}d=null;b.getMarkupByMode(a)&&(d=b.getMarkupByMode(a).content);return d},_updateTitle:function(){},_updateMarkup:function(a,b){var c=this._getMarkupByMode(a);if(a==iwConstants.mode_view&&this.widgetDef.getAllowInstanceContent()){var d=this.getIWidgetInstance().getDefaultViewContent();
- d&&null!==d&&(c=d)}if("undefined"==typeof c||null===c)return this._logUpdateMarkupError(a),!0;d=this._prepareMarkup(c);d=d.replace(/^\s+|\s+$/,"");0===d.indexOf("<script")&&(d=" "+d);c=document.createElement("DIV");c.innerHTML=d;d=c.getElementsByTagName("script");if(null!==d)for(var e=0,f=d.length;e<f;e++){var g=d[e],m=g.getAttribute("id");(null===m||""==m)&&g.setAttribute("id","_scr#"+e)}b.innerHTML=c.innerHTML;com.ibm.mm.enabler.utils.Dom.destroyNode(c);return!0},_prepareMarkup:function(a){return a.replace(/_IWID_/g,
- "_"+this.id+"_").replace(/iContext(?=\.|\s|\(|\))/g,"_"+this.id+"_iContext")},destroy:function(){this.loaded&&!this.isModal()&&this._handleEventInternal(iwConstants.EVENTS.onUnLoad);if(this._inIframe())this.isModal()||(this.eventSvr.disconnectHubClient(),dojo.global["_"+this.id+"_iContext"]&&(dojo.global["_"+this.id+"_iContext"]=null));else{var a=this.getIWidgetInstance().getWireModel();if(a){var b=a.getWires();if(b)for(var c=b.length-1;0<=c;c--){var d=b[c].getSourceWidgetID();a.removeWire(d);this.commit()}}b=
- null;a&&(b=a.getTargets());if(b){var a=com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel(),e;for(e in b)if(Object.prototype.hasOwnProperty.call(b,e)&&(c=a.find(e)))c.getIWidgetInstance().getWireModel().removeWire(this.id),c.commit()}for(var f in this.eventHandlers)Object.prototype.hasOwnProperty.call(this.eventHandlers,f)&&this.eventSvr._unsubscribeEvent(this.eventHandlers[f],this.hubId);this.eventSvr._getHubAdapter(this.hubId).removeInlineHubClient(this.hubId);dojo.global["_"+this.id+"_iContext"]&&
- (dojo.global["_"+this.id+"_iContext"]._destroy(),dojo.global["_"+this.id+"_iContext"]=null)}this.rootElement&&(this.rootElement=null);this.windowManager&&(this.windowManager=null);this.widgetInstance._destroy()},_doRender:function(){this._inIframe()||this._updateTitle();var a=document.createElement("div");a.className=this.ns+"Content";this.rootElement.appendChild(a);a=this.rootElement.lastChild;dojo.addClass(a,this.currentMode);a.style.visibility="hidden";this._inIframe()&&dojo.style(a,"height","100%");
- var b=this.widgetDef.getIDescriptorItems().getItemValue(iwConstants.iDescriptorItems.mode);if(this.isModal()&&this.currentMode!=b){var c=document.createElement("div");c.className=this.ns+"Content";this.rootElement.appendChild(c);contentDiv1=this.rootElement.lastChild;dojo.addClass(contentDiv1,b);contentDiv1.style.visibility="hidden";contentDiv1.style.display="none";this._updateMarkup(b,contentDiv1)}this._updateMarkup(this.currentMode,a);this._loadWidgetSharedResource(dojo.partial(this._finishRender,
- a,this))},_finishRender:function(a,b){try{var c=b.eventSvr._subscribeEvent(com.ibm.mashups.iwidget.Constants.RESIZE_WIDGET+"."+b.id,b,"handleSizeChanged",null,b.id);b.eventHandlers.push(c);b._createiScope();b._evalScripts(a);b.windowManager[b.currentMode]={id:b.currentMode,root:a,active:!0,external:!1};dojo.query("> ."+b.ns+"loading",b.rootElement).forEach(function(a){com.ibm.mm.enabler.utils.Dom.destroyNode(a)});b.onLoad();if("undefined"!=typeof b._eventqueue&&null!==b._eventqueue)for(var d in b._eventqueue)Object.prototype.hasOwnProperty.call(b._eventqueue,
- d)&&b.handleEvent(b._eventqueue[d])}catch(e){return}dojo.query("."+b.currentMode,b.rootElement).style({visibility:""})},_evalScripts:function(a){dojo.query("script",a).forEach(function(a){this._jsHandler.handle(a)},this)},onLoad:function(){this.isModal()||this._handleEventInternal(iwConstants.EVENTS.onLoad);this.updateState();var a=new com.ibm.mm.iwidget.IEventImpl("on"+this.currentMode,null,{oldMode:null});this._handleEventInternal("on"+this.currentMode,a);this.loaded=!0;try{dojo.publish(com.ibm.mashups.iwidget.Constants.WIDGET_LOADED+
- "."+this.id,[this.id])}catch(b){throw b;}this.eventSvr._publishEvent(com.ibm.mashups.iwidget.Constants.WIDGET_LOADED+"."+this.hubId,this.hubId)},updateState:function(){},_getSimpleEventHandler:function(a){if(this.simpleWidgetEvents&&"undefined"!=typeof this.simpleWidgetEvents[a])return this.simpleWidgetEvents[a];var b=this.widgetDef.getWidgetEvents()[a];b||(b=a);var c=this._getHandlerScope(b),d=null;if(c)d=dojo.hitch(c,b),this.simpleWidgetEvents[a]=d;else if(0===b.indexOf("on")){var e="on"+b.substr(2,
- 1).toUpperCase()+b.substr(3);if(e!=b&&(c=this._getHandlerScope(e)))d=dojo.hitch(c,e),this.simpleWidgetEvents[a]=d}return d},_getHandlerScope:function(a){var b=dojo.global["_"+this.id+"_"+a];if("undefined"==typeof b){var c=dojo.global["_"+this.id+"_iContext"].iScope();c&&c[a]&&(b=c)}if("undefined"==typeof b||null===b)b=dojo.global[a];return"undefined"==typeof b||null===b?null:b},handleEvent:function(a){if("com.ibm.mm.iwidget.IEventImpl"==a.declaredClass)return this._handleEvent(a.name,a)},_handleEvent:function(a,
- b){b=this._deserializePayload(b);if("undefined"==typeof a||null===a)return!1;if(this.loaded)try{if(a==iwConstants.EVENTS.onModeChanged){if(this._inIframe()){var c={methodname:"_handleOnModeChange"};c.hubclient=this.hubId;c.params=[b.payload];this.eventSvr._publishEvent(iwConstants.WIDGETEVENT_PREFIX+("_stub_"+this.id),c,this.hubId);return}return this._handleModeChange(b)}return this._handleEventInternal(a,b)}catch(d){throw d;}else this._eventqueue||(this._eventqueue={}),this._eventqueue[a]=b},_deserializePayload:function(a){if("string"==
- typeof a.payload&&-1!=a.payload.indexOf("className")&&-1!=a.payload.indexOf("json"))try{var b=dojo.fromJson(a.payload);if(b.className&&"string"==typeof b.className&&0<b.className.length&&b.json&&"string"==typeof b.json){var c=b.json;"com.ibm.mm.data.table"==b.className&&-1!=c.indexOf("data")&&(c=dojo.fromJson(c));a.payload=new (dojo.getObject(b.className))(c)}}catch(d){throw d;}return a},_handleOnModeChange:function(a){a=new com.ibm.mm.iwidget.IEventImpl("onModeChanged",null,{newMode:a},null);this._handleModeChange(a)},
- _handleModeChange:function(a){var b=!1,c=this.currentMode,d=a.payload;if("undefined"==typeof d||null===d)return!1;dojo.isString(d)&&(d=dojo.fromJson(d));if("undefined"==typeof d||null===d)return!1;var e=d.newMode||null,d=d.rootElementId||null;if(null!==e&&e==this.currentMode||null===e)return!1;var f=null!==d,g=d,m=this._getDefaultMode();m||(m="view");var p=this.windowManager[e]||null;if(this._inIframe()&&null!==p&&m==e)this.currentMode=e,this._handleSaveMode&&this._handleSaveMode(),this.windowManager[e].active=
- !0,null!==g&&(this.windowManager[e].root=g),dojo.style(this.windowManager[e].root,"display",""),a=this.windowManager[c],a.active=!1,a.root&&dojo.style(a.root,"display","none"),this._handleOnModeEvent(e,c);else{m=!1;if("undefined"!=typeof p&&null!==p){var h=p.root;!p.external&&(null!==h&&null===d)&&(g=h,b=m=!0,dojo.style(h,"display",""))}m||(null===g&&(b=document.createElement("div"),b.className=this.ns+"Content",this.rootElement.appendChild(b),g=this.rootElement.lastChild,dojo.addClass(g,e)),b=this._updateMarkup(e,
- g));b&&(c=this.windowManager[this.currentMode],p=c.root,c.external?(dojo.style(p,"display","none"),this.windowManager[this.currentMode]=null):null!==d?c.active=!1:(c.active=!1,dojo.style(p,"display","none")),c=this.currentMode,this.currentMode=e,this._handleSaveMode&&this._handleSaveMode(),this.windowManager[e]={id:e,root:g,active:!0,external:f},m||this._evalScripts(g),this._handleOnModeEvent(e,c));b&&!this._inIframe()&&(dojo.publish(iwConstants.EVENTS.modeChanged,[this.id,c,e]),d={},d.id=this.id,
- d.oldMode=c,d.newMode=e,this.eventSvr._publishEvent(com.ibm.mashups.iwidget.Constants.WIDGET_MODECHANGED,d,this.hubId));this._inIframe()&&(e={methodname:"_handleOnModeUpdated"},e.hubclient=this.hubId,e.params=[a.payload],this.eventSvr._publishEvent(iwConstants.WIDGETEVENT_PREFIX+("_stub_"+this.id),e,this.hubId));return b}},_handleOnModeUpdated:function(a){a=a.newMode||a;a!=this.currentMode&&(this.currentMode=a,this._handleSaveMode&&this._handleSaveMode(),this.windowManager[a]={id:this.id,active:!0,
- external:!0})},_handleOnModeEvent:function(a,b){this._inIframe()&&(dojo.setContext(com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel().global,com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel().doc),dojo.isIE&&(document._mmcreateElement&&(document.createElement=document._mmcreateElement),document._mmgetElementsByTagName&&(document.getElementsByTagName=document._mmgetElementsByTagName)));var c=!1,c="on"+a;b||(b=null);var d=new com.ibm.mm.iwidget.IEventImpl(c,null,{oldMode:b});return c=
- this._handleEventInternal(c,d)},_handleEventInternal:function(a,b){if("undefined"==typeof a||null===a)return!1;var c=!1,d=null;if(0===a.indexOf("on")){var e=this._getSimpleEventHandler(a);null!==e&&(d=e)}null===d&&(d=this.getPublicEventHandler(a));if(dojo.isFunction(d)){try{b?(this._transform&&(b=this._transform(a,b)),dojo.partial(d)(b)):dojo.partial(d)()}catch(f){throw f;}c=!0}return c},getPublicEventHandler:function(){return null},_getParent:function(){this.parent||(this.parent=com.ibm.mm.iwidget.Utils.getWidgetParent(this.rootElement));
- return this.parent=this.parent||null},_setParent:function(a){this.parent=a},getAttributes:function(){if(!this.widgetAttributes){var a=com.ibm.mashups.services.ServiceManager.getService("persistentAttributesFactoryService");this.widgetAttributes=new com.ibm.mm.iwidget.manageditemset.AttributesModeDelegate(a,this)}return this.widgetAttributes},getWidgetItemSets:function(){if(this.widgetItemSets)return this.widgetItemSets;this.widgetItemSets={};if(this.widgetDef)for(var a=this.widgetDef.getAllItemSetNames(),
- b=0,c=a.length;b<c;b++){var d=a[b],e=this.widgetDef.getItemSet(d),e=new com.ibm.mm.iwidget.itemset.ItemSetDefaultImpl(this,e,d);this.widgetItemSets[d]=e}return this.widgetItemSets},getWidgetItemSet:function(a){var b=this.getWidgetItemSets(),c=null;b&&(c=b[a],c||(c=new com.ibm.mm.iwidget.itemset.ItemSetDefaultImpl(this,null,a),this.widgetItemSets[a]=c));return c},_loadWidgetSharedResource:function(a){a&&a()},_createiScope:function(){if(this.isModal())this.iScope=dojo.global["_"+this.id+"_iContext"].scope;
- else{var a=this.widgetDef.getIScope(),b=null;if("undefined"!=typeof a&&null!==a)try{b=new (dojo.getObject(a))}catch(c){}this.iScope=b||{};dojo.global["_"+this.id+"_iContext"].scope=this.iScope;this._executeCallbackQueue()}this.iScope.iContext=dojo.global["_"+this.id+"_iContext"]},getIDescriptorItems:function(){return this.iDescriptor?this.iDescriptor:this.iDescriptor=new com.ibm.mm.iwidget.manageditemset.IDescriptorImpl(this,this.widgetDef.getIDescriptorItems(),this.getIWidgetInstance().getIDescriptorItems())},
- _getInitDefaultMode:function(){if(this._getModeFromNavStateModel){var a=this._getModeFromNavStateModel();if("undefined"!=typeof a&&null!==a)return a}return this._getDefaultMode()},_getDefaultMode:function(){var a=this.getIWidgetInstance().getIDescriptorItems();if("undefined"!=typeof a&&null!==a&&(a=a.getItemValue(iwConstants.iDescriptorItems.mode)))return a;var a=this.widgetDef.getIDescriptorItems(),b=null;"undefined"!=typeof a&&null!==a&&(b=a.getItemValue(iwConstants.iDescriptorItems.mode));return b||
- null},_getMarkup:function(a){var b=this,c=this.getMarkup();c.setIncludeParent(a);c.setFinishedCallback(function(a){b.eventSvr._publishEvent(b.eventSvr.WIDGETEVENT_PREFIX+b.id+".onMarkupReturned",a)});c.start()},_inIframe:function(){return!1},commit:function(a){var b=this.getIWidgetInstance(),c=null;if(this._inIframe()&&!a){a={};if((c=b.getAttributes())&&c._isDirty())a.attributes=dojo.clone(c.toJson());if((b=b.getWireModel())&&b.isDirty())a.wiremodel=b.toJson();b={methodname:"_handleDataSync"};b.hubclient=
- this.hubId;b.params=[a];this.eventSvr._publishEvent(iwConstants.WIDGETEVENT_PREFIX+("_stub_"+this.id),b,this.hubId)}else{if((c=b.getAttributes())&&c._isDirty())this._notifyWidget(this,"attributes",c),this._writePropertiesToDOM(this,"attributes",c),c._setDirty(!1);if((a=b.getIDescriptorItems())&&a._isDirty())this._notifyWidget(this,"idescriptor",a),this._writePropertiesToDOM(this,"idescriptor",a),a._setDirty(!1);(b=b.getWireModel())&&b.isDirty()&&b.commit()}},_writePropertiesToDOM:function(a,b,c){for(var d=
- a.ns,e=a.rootElement,a=dojo.query("span."+d+'ItemSet[title="'+b+'"]',e),f=0,g=a.length;f<g;f++){var m=a[f];e==m.parentNode&&e.removeChild(m)}a=document.createElement("span");a.className=d+"ItemSet";a.title=b;a.style.display="none";a.style.visibility="hidden";e.appendChild(a);if(b=c.getAllNames()){e=0;for(f=b.length;e<f;e++){m=b[e];g=document.createElement("a");g.className=d+"Item";g.style.visibility="hidden";g.style.display="none";g.href="#"+m;c.isReadOnly(m)&&dojo.addClass(g,d+"ReadOnly");var p=
- c.getItemLocales(m);if(!p||null!==p&&1==p.length&&""==p[0])(m=c.getItemValue(m))&&g.appendChild(document.createTextNode(m)),a.appendChild(g);else if(null!==p){var h=c._getItemDefaultLocale(m);h||(h=c.DEFAULT_LOCALE);g.setAttribute("lang",h);for(h=0;h<p.length;h++){var k=document.createElement("span");k.setAttribute("class",d+"Value");k.setAttribute("lang",p[h]);var n=c.getItemValue(m,p[h]);k.appendChild(document.createTextNode(n));g.appendChild(k)}a.appendChild(g)}}}},_notifyWidget:function(a,b,c){var d=
- c.getAllNames();if(d){a={};a.itemSetName=b;a.changes=[];for(var e=0,f=d.length;e<f;e++){var g=d[e];if(c._isItemDirty&&c._isItemDirty(g)){var m=c._getInternalItemValue(g);m&&m._change&&(m=dojo.clone(m._change),m.newVal&&(m.newVal=c._getRequiredValue(m.newVal)),m.oldVal&&(m.oldVal=c._getRequiredValue(m.oldVal)),a.changes.push(m));c._setItemDirty(g,!1)}}var b=this._getListeners(b),p;for(p in b)if(Object.prototype.hasOwnProperty.call(b,p))b[p](a)}},isModal:function(){return!1},isLoaded:function(){return this.loaded},
- isStandalone:function(){null===this.standalone&&(this.standalone=dojo.hasClass(this.rootElement,com.ibm.mm.iwidget.Constants.CSSCLASS_PREFIXED_INSTANCE.iwStandalone));return this.standalone},handleSizeChanged:function(a){a.newWidth&&(this.width=a.newWidth);a.newHeight&&(this.height=a.newHeight);a=new com.ibm.mm.iwidget.IEventImpl(iwConstants.EVENTS.onSizeChanged,null,a,null);this._handleEvent(iwConstants.EVENTS.onSizeChanged,a)},_isEmpty:function(a){return com.ibm.mm.enabler.utils.Misc.isEmpty(a)},
- _getListeners:function(a){return!this.listenerManager||!this.listenerManager[a]?null:this.listenerManager[a]},_registerListener:function(a,b){this.listenerManager||(this.listenerManager={});this.listenerManager[a]=this.listenerManager[a]?this.listenerManager[a]:{};var c=this._generateListenerId(),d=this;this.listenerManager[a][c]=function(a){if(0<(a.changes?a.changes:null).length){a=new com.ibm.mm.iwidget.IEventImpl("onItemSetChanged",null,a);if(dojo.isString(b)){var c=d._getHandlerScope(b);c&&(b=
- dojo.hitch(c,b))}dojo.isFunction(b)&&dojo.partial(b)(a)}};return c},_removeListener:function(a,b){return!a||("undefined"==typeof b||null===b)||!this.listenerManager||!this.listenerManager[a]?!1:this.listenerManager[a][b]?(delete this.listenerManager[a][b],!0):!1},_generateListenerId:function(){"undefined"==typeof this._listenerCt?this._listenerCt=0:this._listenerCt++;return this._listenerCt},_initManagedItemSet:function(){var a=null;"undefined"!=typeof this.widgetDef&&(a=this.widgetDef._getManagedItemSetListener(iwConstants.ATTRIBUTES),
- null!==a&&this._registerListener(iwConstants.ATTRIBUTES,a),a=this.widgetDef._getManagedItemSetListener(iwConstants.IDESCRIPTOR),null!==a&&this._registerListener(iwConstants.IDESCRIPTOR,a))},_getRawUri:function(){var a=this.getIWidgetInstance().widgetXMLUrl;this.widgetDef.getXmlBase()&&(a=this.widgetDef.getXmlBase());return a},_initBaseUri:function(a){if(a&&(this.rawBaseUri=this._getRawBaseUri(a),this.widgetBaseUri=this._getResolvedPocUri(this.rawBaseUri),this.widgetBaseUriXhr=this._getXhrUri(this.widgetBaseUri),
- -1!=this.rawBaseUri.indexOf(":/")&&(a=this._getServerRoot(this.rawBaseUri))))this.serverRoot=this._getResolvedPocUri(a),this.serverRootXhr=this._getXhrUri(this.serverRoot)},_rewriteURI:function(a,b){if(!this.widgetBaseUri){var c=this._getRawUri();this._initBaseUri(c)}return this._rewriteURIWithContext(a,b,this.widgetBaseUri,this.widgetBaseUriXhr,this.serverRoot,this.serverRootXhr)},_rewriteURIWithContext:function(a,b,c,d,e,f){"undefined"==typeof b&&(b=!0);var g=com.ibm.mm.enabler.EndpointUtils.checkForEndpoints(a);
- g&&(a=g);var g=a,m;b?-1!=a.indexOf(":/")?g=com.ibm.mm.enabler.utils.URLHelper.rewriteURL(a):null!==f&&0===a.indexOf(f)?g=a:(b=a.split("?"),g=m=com.ibm.mm.enabler.utils.Misc.encodePath(b[0]),0===a.indexOf("/")?f&&(g=f+m.substring(1)):d&&(g=d+m),2==b.length&&(g+="?"+b[1])):-1===a.indexOf(":/")&&(b=a.split("?"),m=com.ibm.mm.enabler.utils.Misc.encodePath(b[0]),0===a.indexOf("/")?e&&(g=e+m.substring(1)):c&&(g=c+m),2===b.length&&(g+="?"+b[1]));return g},_getRawBaseUri:function(a){if(!a)return null;var b=
- a.indexOf("?");0<b&&(a=a.substring(0,b));(b=com.ibm.mm.enabler.EndpointUtils.checkForEndpoints(a))&&(a=b);return a.substring(0,a.lastIndexOf("/")+1)},_getResolvedPocUri:function(a){if(!a)return null;var b=a;!0===com.ibm.mm.enabler.utils.Misc.isPocUrl(a)&&(b=com.ibm.mm.enabler.utils.URLHelper.rewriteURL(a));return b},_getXhrUri:function(a){if(!a)return null;var b=a;0!==a.indexOf("/")&&(b=com.ibm.mm.enabler.utils.URLHelper.rewriteURL(a));return b},_getServerRoot:function(a){if(!a||-1==a.indexOf(":/"))return null;
- var b=null,c=a.indexOf(":/"),b=a.substring(0,c+2);-1!==a.indexOf(":///")?b=a.substring(0,c+4):-1!==a.indexOf("://")&&(b=a.indexOf("/",c+4),b=a.substring(0,b+1));return b},_executeCallbackQueue:function(){},_getCurrentMode:function(){return this.currentMode}});com.ibm.mm.iwidget.widget.IWidgetWrapperImpl=com.ibm.mm.iwidget.widget.IWidgetWrapperDefaultImpl;ibmConfig.enablerLayerModules&&0<=dojo.indexOf(ibmConfig.enablerLayerModules,"iWidget")&&dojo.require("com.ibm.mm.iwidget.widget.IWidgetWrapperExtendedImpl");
- dojo.declare("com.ibm.mashups.iwidget.model.WidgetModel",null,{constructor:function(){},find:function(){},hasChildren:function(){},getChildren:function(){},getParent:function(){},getWidgetDefinitionByUrl:function(){},getWidgetDefinitionByURL:function(){},commit:function(){},createIWidgetDefinition:function(){},createWidget:function(){}});dojo.declare("com.ibm.mm.enabler.hub.ManagedHubImpl",null,{constructor:function(){},publishMgr:function(){return!0},subscribeMgr:function(){return!0},securityMgr:function(){},
- getInstance:function(){var a=com.ibm.mm.enabler.hub.ManagedHubImpl._instance;a||(com.ibm.mm.enabler.hub.ManagedHubImpl._instance=new OpenAjax.hub.ManagedHub({onPublish:this.publishMgr,onSubscribe:this.subscribeMgr,onSecurityAlert:this.securityMgr}),a=com.ibm.mm.enabler.hub.ManagedHubImpl._instance);return a}});com.ibm.mm.enabler.hub.ManagedHubImpl=new com.ibm.mm.enabler.hub.ManagedHubImpl;dojo.declare("com.ibm.mm.enabler.hub.SubDomainPoolImpl",null,{constructor:function(a){a?(this._pool=a,this._internalPool=
- dojo.clone(this._pool)):(this._counter=0,this._reusedSubDomain=[]);this.configService=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME);this.reuseSubDomain=this.configService.getValue(com.ibm.mashups.enabler.services.ConfigConstants.SUBDOMAINREUSE)},getSize:function(){return this._internalPool?this._internalPool.length:-1},get:function(){if(this._pool)return this._getFromPool();var a=this._counter;if(this.reuseSubDomain&&0<this._reusedSubDomain.length)return a=
- this._reusedSubDomain.shift();this._counter++;return"w"+a},add:function(a){if(this.reuseSubDomain){if(this._pool)return this._addToPool(a);this._reusedSubDomain.push(a)}},_getFromPool:function(){return 0===this._pool.length?null:this._pool.shift()},_addToPool:function(a){this._pool.push(a)}});dojo.declare("com.ibm.mm.enabler.hub.XHRHeaderExtensionImpl",null,{constructor:function(){this.originalDojoXHR=dojo.xhr;dojo.xhr=dojo.hitch(this,function(a,b,c){b.headers||(b.headers={});b.headers["com.ibm.lotus.openajax.virtualhost"]=
- document.location.hostname;b.headers["com.ibm.lotus.openajax.virtualport"]=document.location.port;return this.originalDojoXHR(a,b,c)})}});com.ibm.mm.enabler.hub.XHRHeaderExtension=new com.ibm.mm.enabler.hub.XHRHeaderExtensionImpl;dojo.declare("com.ibm.mm.enabler.hub.MainHubAdapterImpl",null,{constructor:function(a){this._managedhub=a;this._inlineHubClients={}},PREFIX_INLINE:"_inline_",PREFIX_IFRAME:"_iframe_",createInlineHubContainer:function(a){return new OpenAjax.hub.InlineContainer(this._managedhub,
- this.PREFIX_INLINE+a,{Container:{onConnect:function(){},onDisconnect:function(){},onSecurityAlert:function(){},onError:function(){}}})},createIframeHubContainer:function(a,b,c,d,e,f,g){function m(){}function p(){}function h(){}var k=this.PREFIX_IFRAME+a,n=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTEXT_ROOT_ENABLER)+"/js/openajaxhub/rpc_relay.html",q=window.location.protocol,
- s=window.location.hostname,r=window.location.port,w=q+"//"+s+":"+r+n;""==r&&(w=q+"//"+s+n);try{var v,x;this.removeIframeHubContainer(a);d&&"true"==d?(v="600px",x="400px"):x=v="100%";e&&(v=e);f&&(x=f);g&&(h=g);new OpenAjax.hub.IframeContainer(this._managedhub,k,{Container:{onConnect:m,onDisconnect:p,onSecurityAlert:h},IframeContainer:{uri:c,tunnelURI:w,parent:b,iframeAttrs:{title:"iframe",style:{width:v,height:x,border:"0px",overflow:"auto"}},timeout:12E5}})}catch(A){}},createInlineHubClient:function(a){var a=
- this.PREFIX_INLINE+a,b=this._managedhub.getContainer(a),b=new OpenAjax.hub.InlineHubClient({HubClient:{onSecurityAlert:function(){}},InlineHubClient:{container:b}});b.connect(function(){});return this._inlineHubClients[a]=b},_getInlineHubClient:function(a){if(!a)return null;a=this._inlineHubClients[this.PREFIX_INLINE+a];"undefined"==typeof a&&(a=null);return a},getInlineHubClient:function(a){return!a?this._managedhub:(a=this._getInlineHubClient(a))?a:this._managedhub},isInlineClient:function(a){var b=
- !1;this._getInlineHubClient(a)&&(b=!0);return b},removeInlineHubClient:function(a){var b=this._getInlineHubClient(a),a=this.PREFIX_INLINE+a;b&&(b.disconnect(function(){}),delete this._inlineHubClients[a],(b=this._managedhub.getContainer(a))&&this._managedhub.removeContainer(b))},getContainer:function(a,b){!0===(b||!1)&&(a=this.PREFIX_IFRAME+a);return this._managedhub.getContainer(a)},removeIframeHubContainer:function(a){(a=this._managedhub.getContainer(this.PREFIX_IFRAME+a))&&this._managedhub.removeContainer(a)},
- returnSubDomain:function(a){this.getSubDomainPool().add(a)},getSubDomainSize:function(){return this.getSubDomainPool().getSize()},getSubDomain:function(){return this.getSubDomainPool().get()},getSubDomainPool:function(){if(!this.subDomainPool){var a=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.SUBDOMAINS);a&&(dojo.isArray(a)&&0!==a.length)&&(this.subDomainPool=new com.ibm.mm.enabler.hub.SubDomainPoolImpl(a));
- this.subDomainPool||(this.subDomainPool=new com.ibm.mm.enabler.hub.SubDomainPoolImpl)}return this.subDomainPool}});dojo.declare("com.ibm.mm.iwidget.services.EventServiceDefaultImpl",com.ibm.mashups.iwidget.services.EventService,{constructor:function(){this.subMgr={};this.managedhub=com.ibm.mm.enabler.hub.ManagedHubImpl.getInstance();this.hubAdapter=new com.ibm.mm.enabler.hub.MainHubAdapterImpl(this.managedhub);this._subscribeEventService();this.registerServices&&this.registerServices();this.registerExtServices&&
- this.registerExtServices()},getType:function(){return com.ibm.mm.iwidget.Constants.eventservice.type.MAIN},registerServices:function(){var a=this;this.subscribeEvent(com.ibm.mashups.iwidget.Constants.CHANGE_WIDGETMODE,null,function(b){a.fireEvent(b.id,"onModeChanged",{newMode:b.newMode,rootElementId:b.parentNode})},null,null)},setId:function(a){this.id=a},getId:function(){return"main"},_subscribeEventService:function(){var a=this;this.managedhub.subscribe("eventservice."+this.getId(),function(b,c){var d=
- c.methodname;d&&a[c.methodname]&&a[d].apply(a,c.params)},a,a._subscribeCallback)},_subscribeCallback:function(a,b){b||console.log("subscribe failed "+a)},_getHubAdapter:function(){return this.hubAdapter},_getManagedHub:function(){return this.managedhub},WIDGETEVENT_PREFIX:iwConstants.WIDGETEVENT_PREFIX,WILDCARD_PREFIX:iwConstants.WILDCARD_PREFIX,subscribeWire:function(){return!1},publishWire:function(){return!1},unSubscribeWire:function(){return!1},addWire:function(){return!1},removeWire:function(){return!1},
- fireEvent:function(a,b,c,d,e){var f=new com.ibm.mm.iwidget.IEventImpl(b,d,c,e),g=com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel(),b=g.find(a),m=function(a,b,d,e){if(a.hubAdapter.isInlineClient(b.id))a._publishEvent(a.WIDGETEVENT_PREFIX+b.id,d,d.source);else{var f={};if(d.name==iwConstants.EVENTS.onModeChanged){f.methodname="_handleOnModeChange";f.params=[c];b.handleEvent(f);return}f.methodname="fireEvent";f.hubclient=a.getId();f.params=[b.id,d.name,d.payload,d.type];a._publishEvent("eventservice."+
- b.id,f)}e&&((b=a.subMgr[e])&&a.unsubscribeEvent(b),delete a.subMgr[e])};if(b&&b.isLoaded())m(this,b,f);else{var p=this,h=dojox.uuid.generateRandomUuid(),b=this.subscribeEvent(com.ibm.mashups.iwidget.Constants.WIDGET_LOADED+"."+a,null,function(){var b=g.find(a);m(p,b,f,h)});this.subMgr[h]=b}},publishEvent:function(a,b,c,d){if(!("undefined"==typeof a||null===a)){var e;if(0===a.indexOf(this.WILDCARD_PREFIX))return e=this.WILDCARD_PREFIX,this.broadcastEvent(a.substring(e.length),b,c,d);if(0===a.indexOf(this.WIDGETEVENT_PREFIX))return e=
- a.substring(this.WIDGETEVENT_PREFIX.length),a=e.substring(0,e.indexOf(".")),e=e.substring(e.indexOf(".")+1),this.fireEvent(a,e,b,c,d);this._publishEvent(a,b,d)}},_publishEvent:function(a,b,c){c=this.hubAdapter.getInlineHubClient(c);"undefined"==typeof b||null===b?c.publish(a):c.publish(a,b)},broadcastEvent:function(a,b,c,d,e,f){var g={};g.targetEvent=a;g.payload=b;g.payloadType=c;this.broadcastEvents([g],d,e,f)},broadcastEvents:function(a,b,c,d){if(null!==a&&dojo.isArray(a)){var e=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel(),
- f=com.ibm.mashups.enabler.model.state.AccessorFactory.getSpaceAccessor(e),g=f.getSpaceID(),m=com.ibm.mashups.enabler.model.state.AccessorFactory.getPageAccessor(e,g).getPageID();if(c&&"string"==typeof c&&c!=m)this._switchPageForBroadcastEvents(a,b,c,d,e,f,g);else{var p,c=com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel().getAllWidgets(),h=this,d=function(a,c,d){var e=a.getWidgetHandledEvents();if(null===e){var f=a.getIWidgetDefinition().start();f&&(e=f.getWidgetHandledEvents())}if(e)for(f=
- 0;f<c.length;f++)for(var g=0;g<e.length;g++)if(c[f].targetEvent==e[g].name){h.fireEvent(a.getID(),c[f].targetEvent,c[f].payload,c[f].payloadType,b);break}d&&((a=h.subMgr[d])&&h.unsubscribeEvent(a),delete h.subMgr[d])},k;for(k in c)Object.prototype.hasOwnProperty.call(c,k)&&(e=c[k],e.isLoaded()?d(e,a):e.lazyLoad||(p=dojox.uuid.generateRandomUuid(),e=this.subscribeEvent(com.ibm.mashups.iwidget.Constants.WIDGET_LOADED+"."+e.getID(),null,dojo.partial(d,e,a,p)),this.subMgr[p]=e));0<a.length&&"com.ibm.mashups.builder.skinLoaded"===
- a[0].targetEvent&&(p=dojox.uuid.generateRandomUuid(),e=this.subscribeEvent(com.ibm.mashups.iwidget.Constants.WIDGET_LOADED+"."+a[0].payload.widgetId,null,function(){h._handleBroadcastEventsCache();var a=h.subMgr[p];a&&h.unsubscribeEvent(a)}),this.subMgr[p]=e);for(k=0;k<a.length;k++)this._publishEvent(a[k].targetEvent,a[k].payload,b)}}},_switchPageForBroadcastEvents:function(){},_handleBroadcastEventsCache:function(){},_subscribeEvent:function(a,b,c,d,e){return this._getHubAdapter().getInlineHubClient(e).subscribe(a,
- function(a,d){var e=c;b&&c&&(e=dojo.hitch(b,c));e&&e(d)},null,function(a,c,e){b&&d&&(d=dojo.hitch(b,d));d&&d.apply(this,[a,c,e]);c||console.log("subscription for "+a+" failed")})},subscribeEvent:function(a,b,c,d,e){return this._subscribeEvent(a,b,c,d,e)},_unsubscribeEvent:function(a,b){var c=this._getHubAdapter().getInlineHubClient(b);try{c&&c.unsubscribe(a)}catch(d){console.log("unsubscribe failure:"+d)}},unsubscribeEvent:function(a,b){a&&this._unsubscribeEvent(a,b)},_generateWireId:function(a,b,
- c,d){return a+"_"+b+"_"+c+"_"+d}});ibmConfig.insideSandbox||com.ibm.mashups.services.ServiceManager.setService("eventService","com.ibm.mm.iwidget.services.EventServiceDefaultImpl");ibmConfig.enablerLayerModules&&0<=dojo.indexOf(ibmConfig.enablerLayerModules,"iWidget")&&(dojo.require("com.ibm.mm.iwidget.services.EventServiceExtended"),dojo.require("com.ibm.mm.iwidget.services.IFrameEventServiceImpl"));dojo.declare("com.ibm.mm.iwidget.model.WidgetModelDefaultImpl",com.ibm.mashups.iwidget.model.WidgetModel,
- {constructor:function(){this.widgetArr={};this.parentMap={};this.eventService=com.ibm.mashups.services.ServiceManager.getService("eventService");this.eventService.subscribeEvent(com.ibm.mashups.iwidget.Constants.UNLOAD_WIDGETS,this,"_unloadWidgets");if(!ibmConfig||ibmConfig&&"string"!=typeof ibmConfig.loadingHTML)if(ibmConfig["loadingHTML.imageURL"])this.processAnim=com.ibm.mm.enabler.utils.Misc.preloadImage(ibmConfig["loadingHTML.imageURL"],20,20);else{var a=new dojo.moduleUrl("com.ibm.mm.iwidget",
- "image/");this.processAnim=com.ibm.mm.enabler.utils.Misc.preloadImage(a+"progress-anim.gif",20,20)}dojo.addOnWindowUnload(this,"_onWindowUnload");this.global=dojo.global;this.doc=dojo.doc},_onWindowUnload:function(){try{for(var a in this.widgetArr)Object.prototype.hasOwnProperty.call(this.widgetArr,a)&&this._unloadWidget(a)}catch(b){console.log("_onWindowUnload "+b.message)}},createWidget:function(a){var b=a.getAttribute("id");if("undefined"==typeof b)return null;var c=this.widgetArr[b];if("undefined"!=
- typeof c&&null!==c){if(c.rootElement==a)return c;this._unloadWidget(b)}a=new com.ibm.mm.iwidget.widget.IWidgetWrapperImpl(a,b);this.widgetArr[b]=a;this.parentMap[b]="DEFER_TOKEN";return a},createIWidgetDefinition:function(a){return new com.ibm.mm.iwidget.widget.IWidgetDefinitionImpl(null,null,a)},find:function(a){a=this.widgetArr[a];return "undefined"!=typeof a?(a.lazyLoad&&!a.loaded&&(this.renderWidget(a),delete a.lazyLoad),a):null},getWidgetById:function(a){return this.find(a)},commit:function(){return new com.ibm.mm.enabler.DeferredOperationImpl(this,
- this._commit)},_commit:function(){for(var a in this.widgetArr)if(Object.prototype.hasOwnProperty.call(this.widgetArr,a)){var b=this.widgetArr[a];b.getIWidgetInstance()&&b.commit()}},_unloadWidgets:function(a){var b;if("undefined"!=typeof a||null!==a)if(dojo.isArray(a)){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b=a[c],this._unloadWidget(b));dojo.publish(com.ibm.mashups.iwidget.Constants.WIDGETS_UNLOADED,[a]);this.eventService.publishEvent(com.ibm.mashups.iwidget.Constants.WIDGETS_UNLOADED,
- a)}else dojo.isString(a)&&this._unloadWidget(a)},_unloadWidget:function(a){if("undefined"!=typeof this.widgetArr[a]&&null!==this.widgetArr[a]){var b=this.widgetArr[a];try{b.destroy()}catch(c){}delete this.widgetArr[a];this.parentMap[a]&&delete this.parentMap[a]}},getParent:function(a){var b=this.parentMap[a.getID()];b&&"DEFER_TOKEN"==b&&(b=a._getParent(),this.parentMap[a.getID()]=b);b&&(parent=this.find(b));return parent||null},hasChildren:function(a){return 0===this.getChildren(a,!1).length?!1:!0},
- getChildren:function(a,b){this._checkParentMap();var c=[];this._getChildren(a,"undefined"==typeof b?!0:b,c);return c},_checkParentMap:function(){for(var a in this.widgetArr)if(Object.prototype.hasOwnProperty.call(this.widgetArr,a)){var b=this.parentMap[a];b&&"DEFER_TOKEN"==b&&(b=this.widgetArr[a]._getParent(),this.parentMap[a]=b)}},_getChildren:function(a,b,c){for(var d in this.parentMap)if(this.parentMap[d]==a.getID()){var e=this.find(d);e&&(c.push(e),b&&this._getChildren(e,b,c))}},getWidgetDefinitionByUrl:function(a){return this.getWidgetDefinitionByURL(a)},
- getWidgetDefinitionByURL:function(a){return new com.ibm.mm.iwidget.DeferredLoadImpl(a)},getAllWidgets:function(){return this.widgetArr},renderWidget:function(a){"undefined"!=typeof a&&(a.loaded||a.doRender())}});com.ibm.mm.iwidget.model.WidgetModelImpl=com.ibm.mm.iwidget.model.WidgetModelDefaultImpl;ibmConfig.enablerLayerModules&&0<=dojo.indexOf(ibmConfig.enablerLayerModules,"iWidget")&&dojo.require("com.ibm.mm.iwidget.model.WidgetModelExtended");dojo.declare("com.ibm.mm.iwidget.model.FactoryImpl",
- com.ibm.mashups.iwidget.model.Factory,{constructor:function(){},getGlobalWidgetModel:function(){this._globalWidgetModel||(this._globalWidgetModel=new com.ibm.mm.iwidget.model.WidgetModelImpl);return this._globalWidgetModel}});com.ibm.mashups.iwidget.model.Factory=new com.ibm.mm.iwidget.model.FactoryImpl;dojo.declare("com.ibm.mm.enabler.model.state.NavigationStateProcessorImpl",com.ibm.mashups.enabler.model.state.NavigationStateProcessor,{constructor:function(){this.configService=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME);
- var a=this.configService.getValue(com.ibm.mashups.enabler.services.ConfigConstants.NAVSTATE_PERSISTENCE_URL);a&&(this.persistenceURL=this._getAssociativeArray(a));if(a=this.configService.getValue(com.ibm.mashups.enabler.services.ConfigConstants.NAVSTATE_PERSISTENCE_PSTORE))this.persistencePSTORE=this._getAssociativeArray(a);var b=this.configService.getValue(com.ibm.mashups.enabler.services.ConfigConstants.NAVSTATE_PERSISTENCE_URL_LIMIT),a=10;b&&(a=parseInt(b,10));this.urlpersistenceLIMIT=a;b=this.configService.getValue(com.ibm.mashups.enabler.services.ConfigConstants.NAVSTATE_PERSISTENCE_URL_SPLIMIT);
- a=2;b&&(a=parseInt(b,10));this.urlpersistenceSPLIMIT=a;this.isHuffmannEnabled=this.configService.getValue(com.ibm.mashups.enabler.services.ConfigConstants.NAVSTATE_HUFFMANNENCODE_ENABLED)},PID:"pid",SHAREDPARAMETERSETS:"sps",SID:"sid",HUFFMANN_PREFIX:"mashup:huffman/",encodeWidgetIdentifier:function(a){return a},decodeWidgetIdentifier:function(a){return a},dispose:function(a){com.ibm.mashups.enabler.model.state.CookieManager.disposeState();a&&a()},_getAssociativeArray:function(a){var b={};if(dojo.isString(a))return b[a]=
- a,b;for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var d=a[c];b[d]=d}return b},decode:function(a,b){if(-1!=a.indexOf(this.HUFFMANN_PREFIX)){var c=a.split(this.HUFFMANN_PREFIX),d=com.ibm.mm.enabler.encode.huffman.HuffmanURL.getDataFromHuffmanTree(c[1])||null;d&&(a=c[0]+d)}if(c=this._getHash(a)||null)-1!=a.indexOf("#")?a.lastIndexOf("&")!=a.length-1&&(a=a.concat("#")):a=a.concat("#"),a=a.concat(c);c={};d=(new com.ibm.mm.enabler.utils.HttpUrl(a)).anchor;if((d=decodeURIComponent(d))&&""!=
- d){var d=dojo.queryToObject(d),e=(new Date).getTime();d.pid&&(c.pid={},c.pid.value=decodeURIComponent(d.pid),c.pid.params={},c.pid.params.lm=e);d.sid&&(c.sid={},c.sid.value=decodeURIComponent(d.sid),c.sid.params={},c.sid.params.lm=e);d.sps&&(c.sparams={},rawValue=dojo.fromJson(decodeURIComponent(d.sps)),c.sparams=rawValue);c.wparams={};for(var f in d)if(0===f.indexOf("w")&&-1==f.indexOf("cp")&&-1==f.indexOf("rp")){var g={},m=1*f.substr(1)+e,p=d[f],h=f+"cp",k=f+"rp";if(d[h]){g.value=g.value?g.value:
- {};try{g.value.cp=dojo.fromJson(decodeURIComponent(d[h]))}catch(n){g.value.cp=decodeURIComponent(d[h])}g.params=g.params?g.params:{};g.params.lm=m}if(d[k]){g.value=g.value?g.value:{};try{g.value.rp=dojo.fromJson(decodeURIComponent(d[k]))}catch(q){g.value.rp=decodeURIComponent(d[k])}g.params=g.params?g.params:{};g.params.lm=m}c.wparams[p]=g}else 0!==f.indexOf("w")&&("pid"!=f&&"sid"!=f&&"sps"!=f&&"pageselection"!=f)&&(g=d[f],c.params=c.params?c.params:{},c.params[f]=decodeURIComponent(g))}b&&b(c);if(!b)return c},
- _getFragmentFromData:function(a,b,c){var d;if(dojo.isString(a))d=a;else if(d=dojo.clone(a),b||c)d=this._filterData(a,b,c);a=d;if(!dojo.isString(a))if(this._isEmpty(a))a=null;else try{a=dojo.toJson(a)}catch(e){a=null}return a},encode:function(a,b,c,d,e){var c="",f={},g;d&&d.cp&&(f=d.cp,"true"==f.widgetsOnCurrentPage&&(g=com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel()));var m,h;a.pid&&a.pid.value&&(m=a.pid.value);!m&&(a.sid&&a.sid.value)&&(h=a.sid.value,a.pageselection&&a.pageselection[h]&&
- (m=a.pageselection[h].value));m&&this._contains("pid",this.persistenceURL)&&(c=c+"pid="+encodeURIComponent(m)+"&");!h&&(a.sid&&a.sid.value)&&(h=a.sid.value);h&&this._contains("sid",this.persistenceURL)&&(c=c+"sid="+encodeURIComponent(h)+"&");for(var k in a)if(Object.prototype.hasOwnProperty.call(a,k)){"sparams"==k&&a[k]&&(m=dojo.clone(a[k])||null,this._removeHiddenParameters(m),this._removeEmptyObj(m),m&&this._contains("sparams",this.persistenceURL)&&(c=c+"sps="+encodeURIComponent(dojo.toJson(m))+
- "&"));"pageselection"==k&&a[k]&&(m=dojo.clone(a[k])||null)&&this._contains("pageselection",this.persistenceURL)&&(c=c+"pageselection="+encodeURIComponent(dojo.toJson(m))+"&");if("wparams"==k&&a[k]&&"true"!=f.noWidgets){m=this._sortData(dojo.clone(a[k]));m.length>this.urlpersistenceLIMIT&&(m=m.slice(m.length-this.urlpersistenceLIMIT));h=0;var n,t,q="true"==f.allWidgets||this._contains("cp",this.persistenceURL),s="true"==f.widgetsOnCurrentPage,r;for(r in m)if(Object.prototype.hasOwnProperty.call(m,
- r)){var w=m[r]||null;if(s&&g&&(w&&w.wid)&&(n=dojo.isFunction(this.decodeWidgetIdentifier)?this.decodeWidgetIdentifier(w.wid,e):w.wid,null===g.find(n)))continue;if(w&&w.value){t=n=null;if(w.value.cp&&(q||s))n=this._getFragmentFromData(w.value.cp)||null;w.value.rp&&(t=this._getFragmentFromData(w.value.rp,this.persistenceURL)||null);if(n||t)if(c=c+"w"+h+"="+w.wid+"&",n&&(c=c+"w"+h+"cp="+encodeURIComponent(n)+"&"),t&&(c=c+"w"+h+"rp="+encodeURIComponent(t)+"&"),h++,h>=this.urlpersistenceLIMIT)break}}}if("params"==
- k&&a[k]){m=a[k];for(var v in m)Object.prototype.hasOwnProperty.call(m,v)&&(c=c+v+"="+encodeURIComponent(m[v])+"&")}}this.isHuffmannEnabled&&-1!=c.indexOf("&")&&(m=c.substr(c.indexOf("&")+1),0<m.length&&(m=com.ibm.mm.enabler.encode.huffman.HuffmanURL.createRawSchemeSpecificPartFromRegex(m,"[%&c=]"),c=c.substring(0,c.indexOf("&")+1),c=c.concat(this.HUFFMANN_PREFIX),c=c.concat(m)));b&&b(c,d);if(!b)return c},_removeHiddenParameters:function(a){for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&
- (0===b.indexOf("_")?(a[b]=null,delete a[b]):dojo.isString(a[b])||this._removeHiddenParameters(a[b]))},_removeEmptyObj:function(a){if(!com.ibm.mm.enabler.utils.Misc.isEmpty(a))for(var b in a)if(Object.prototype.hasOwnProperty.call(a,b)&&dojo.isObject(a[b])){var c=a[b];this._removeEmptyObj(c);com.ibm.mm.enabler.utils.Misc.isEmpty(c)&&(a[b]=null,delete a[b])}},_removeQueryState:function(a){if(-1==a.indexOf("?"))return a;var b=a.substring(a.indexOf("?")+1);b&&-1!=b.indexOf("#")&&(b=b.substring(0,b.indexOf("#")));
- var c=a.substr(0,a.indexOf("?")),d="";if(b&&(0===b.indexOf("nst=")||0<=b.indexOf("&nst="))){var e=b.substr(b.indexOf("nst=")+3),f="";0<e.indexOf("&")&&(e.substring(0,e.indexOf("&")),f=e.substring(e.indexOf("&")));-1!=b.indexOf("&nst=")&&(d=b.substring(0,b.indexOf("&nst=")));d=0===d.length&&0!==f.length?d.concat(f.substring(1)):d.concat(f)}else return a;a=a.substr(a.indexOf("#")+1);0<d.length&&(c=c.concat("?").concat(d));0<a.length&&(c=c.concat("#").concat(a));return c},generateUrl:function(a,b,c){return this.generateURL(a,
- b,c)},generateURL:function(a,b,c,d){var e;c&&c.cp&&(e={cp:c.cp});a=e?this.encode(a,null,null,e,d):this.encode(a,null,null,null,d);e=window.location.href;d=e=this._removeQueryState(e);-1!=e.indexOf("#")&&(d=e.substr(0,e.indexOf("#")));e=d.concat("#");e=e.concat(a);c&&(c.nohash&&"true"==c.nohash)&&(a=encodeURIComponent(a),-1==d.indexOf("?")?(e=d.concat("?"),e=e.concat("nst=")):d.lastIndexOf("&")==d.length-1?e=d.concat("nst="):(e=d.concat("&"),e=e.concat("nst=")),e=e.concat(a));b&&b(e);return e},_getHash:function(a){if(-1==
- a.indexOf("?")||-1!=a.indexOf("#")&&(-1!=a.indexOf("pid")||-1!=a.indexOf("sid")))return null;(a=a.substring(a.indexOf("?")+1))&&-1!=a.indexOf("#")&&(a=a.substring(0,a.indexOf("#")));var b=null;if(a&&(0===a.indexOf("nst=")||0<=a.indexOf("&nst=")))a=a.substr(a.indexOf("nst=")+4),b=0<a.indexOf("&")?a.substring(0,a.indexOf("&")):a,b=decodeURIComponent(b);else return null;return b},_sortData:function(a){var b=[],c;for(c in a)if(Object.prototype.hasOwnProperty.call(a,c)){a[c].wid=c;var d=a[c];d.params&&
- d.params.lm&&b.push(d)}b.sort(function(a,b){return a.params.lm-b.params.lm});return b},_getLength:function(a){var b=0,c;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&b++;return b},_isEmpty:function(a){return com.ibm.mm.enabler.utils.Misc.isEmpty(a)},_contains:function(a,b){return!b?!1:b[a]?!0:!1},_filterData:function(a,b,c){if(!b&&!c)return a;if(!c){for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&(this._contains(d,b)||delete a[d]);return a}for(var e in a)Object.prototype.hasOwnProperty.call(a,
- e)&&!this._contains(e,b)&&this._contains(e,c)&&delete a[e];return a},preprocess:function(a,b){var c=com.ibm.mashups.enabler.model.state.CookieManager.getState();!a.pid&&(c.pid&&!a.sid)&&(a.pid=c.pid);!a.sid&&c.sid&&(a.sid=c.sid);!a.pageselection&&c.pageselection&&(a.pageselection=c.pageselection);a.lcparams=c.lcparams||{};a.wparams||(a.wparams={});var d=a.wparams,c=c.wparams,e;for(e in c)if(Object.prototype.hasOwnProperty.call(c,e)){var f=e,g=c[e],m=d[f];m&&(g=dojo.mixin(g,dojo.clone(m)));d[f]=g}b&&
- b(a);if(!b)return a},postprocess:function(a,b,c,d){var c=com.ibm.mashups.enabler.model.state.CookieManager,e;for(e in a)if(Object.prototype.hasOwnProperty.call(a,e)){("pid"==e||"sid"==e||"pageselection"==e||"sparams"==e)&&this._contains(e,this.persistencePSTORE)&&c.setState(e,a[e]);if("lcparams"==e&&a[e]&&this.persistencePSTORE&&(this.persistencePSTORE.w||this.persistencePSTORE.h)){var f={},g=a[e],m;for(m in g)if(Object.prototype.hasOwnProperty.call(g,m)){var h={},k=g[m];h.templateURL=k.templateURL;
- h.params=k.params;f[m]=h}c.setState("lcparams",f)}if("wparams"==e&&a[e]){var f={},g=a[e],n;for(n in g)if(Object.prototype.hasOwnProperty.call(g,n)){var h=g[n]||null,k=n,t={};if(h&&h.value){if(h.value.rp){var q=this._filterData(dojo.clone(h.value.rp),this.persistencePSTORE);this._isEmpty(q)||(t.value=t.value?t.value:{},t.value.rp=q)}h.value.cp&&this._contains("cp",this.persistencePSTORE)&&(q=this._filterData(dojo.clone(h.value.cp),this.persistencePSTORE),this._isEmpty(q)||(t.value=t.value?t.value:
- {},t.value.cp=q));this._isEmpty(t)||(h.params&&(t.params=h.params),f[k]=t)}}c.setState("wparams",f)}}c.commit();b&&b(a,d);if(!b)return a}});dojo.declare("com.ibm.mm.enabler.model.state.NavigationStateProcessorFactoryImpl",null,{constructor:function(){},getProcessor:function(){this._nsp||(this._nsp=new com.ibm.mm.enabler.model.state.NavigationStateProcessorImpl);return this._nsp}});com.ibm.mashups.enabler.model.state.NavigationStateProcessorFactory=new com.ibm.mm.enabler.model.state.NavigationStateProcessorFactoryImpl;
- dojo.declare("com.ibm.mashups.enabler.model.state.NavigationStateNode",com.ibm.mashups.enabler.Identifiable,{get:function(){},set:function(){}});dojo.declare("com.ibm.mm.enabler.model.state.NavigationStateNodeImpl",[com.ibm.mashups.enabler.model.state.NavigationStateNode],{constructor:function(a,b,c,d,e){this.model=a;this.key=b;this.value=c;d&&(this.id=d);e&&(this.ref=e)},setID:function(a){this.id=a},setRef:function(a){this.ref=a},getID:function(){return this.id},getRef:function(){return this.ref},
- getKey:function(){return this.key},getValue:function(){return this.value},get:function(){return dojo.clone(this._ref)},set:function(a){this.ref=a;this.model.setDirty(!0)}});dojo.declare("com.ibm.mm.enabler.model.state.NavigationStateModelImpl",[com.ibm.mashups.enabler.model.state.NavigationStateModel],{DELIMITER:"#",ROOT:"ROOT",DELETE_TOKEN:"DELETE_TOKEN",VALUE:"value",PARAMS:"params",constructor:function(a){this.processor=com.ibm.mashups.enabler.model.state.NavigationStateProcessorFactory.getProcessor();
- a?(this._state=a,this._rootNode=new com.ibm.mm.enabler.model.state.NavigationStateNodeImpl(this,this.ROOT,this._state,this.ROOT,this._state),this._loaded=!0):(dojo.back.setInitialState({back:this._loadCurrentPage,forward:this._loadCurrentPage}),this._loaded=!1,this.processor.decode(window.location.href,dojo.hitch(this,"_preprocess")));this._sync=!0},_getUniqueWid:function(a){return dojo.isFunction(this.processor.encodeWidgetIdentifier)?this.processor.encodeWidgetIdentifier(a,this):a},_refreshPage:function(){var a=
- com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel();com.ibm.mashups.enabler.model.state.UrlGeneratorFactory.getURLGenerator().getUrl(a,function(a){a&&(top.location.href=a)},{nohash:"true"})},_getFullUrl:function(a,b){return this.processor.generateURL(this._state,a,b,this)},clone:function(){var a=dojo.clone(this._state);return new com.ibm.mm.enabler.model.state.NavigationStateModelImpl(a)},_preprocess:function(a){this.processor.preprocess(a,dojo.hitch(this,"_initializeState"))},
- _initialize:function(){this.processor.decode(window.location.href,dojo.hitch(this,"_preprocess"))},_initializeState:function(a){this._state=a;this._stateInternal=dojo.clone(a);this._rootNode=new com.ibm.mm.enabler.model.state.NavigationStateNodeImpl(this,this.ROOT,this._state,this.ROOT,this._state);this._isTransaction=this._isTransactionDirty=this._isDirty=!1;this._loaded=!0},_postprocess:function(a,b){this._isDirty&&(!this._pagemode||this._pagemode&&"unload"!=this._pagemode&&"edit"!=this._pagemode)?
- this.processor.encode(a,dojo.hitch(this,"_finishCommit"),this._stateInternal,b,this):this._deferred&&(this._deferred.finish(null,com.ibm.mm.enabler.model.HttpStatusCodes.HTTP_OK),delete this._deferred)},_loadCurrentPage:function(){var a=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel();a._initialize();com.ibm.mashups.services.ServiceManager.getService("eventService").publishEvent(a.ONNAVSTATEUPDATED)},_finishCommit:function(a,b,c){try{var d=window.location.hash.substring(1);
- b&&b.addToHistory&&a&&d!=a&&dojo.back.addToHistory({back:this._loadCurrentPage,forward:this._loadCurrentPage,changeUrl:a})}catch(e){}this._isDirty&&com.ibm.mashups.services.ServiceManager.getService("eventService").publishEvent(this.ONNAVSTATEUPDATED);this._isDirty=!1;this._removeDirty(this._state);this._stateInternal=dojo.clone(this._state);b&&b.allowRedirect&&c&&c.doRedirect&&!this._sync?this._refreshPage():this._deferred&&(this._deferred.finish(null,com.ibm.mm.enabler.model.HttpStatusCodes.HTTP_OK),
- delete this._deferred)},_removeDirty:function(a){for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&(b.params&&b.params._isDirty&&(b.params._isDirty=!1,b.value&&b.value==this.DELETE_TOKEN&&(a[b]=null,delete a[b])),a[b]&&!dojo.isString(a[b])&&this._removeDirty(a[b]))},setDirty:function(a){this._isDirty=a},isDirty:function(){return this._isDirty},_find:function(a){a=a||null;if(!a)return null;if(a==this.ROOT)return this._rootNode;var b=this._findReference(a)||null;if(b){var c=new com.ibm.mm.enabler.model.state.NavigationStateNodeImpl(this);
- c.setID(a);c.setRef(b);return c}return null},create:function(a){return new com.ibm.mm.enabler.model.state.NavigationStateNodeImpl(this,a.key?a.key:null,a.value?a.value:null)},insert:function(a,b){var c=b.getRef(),d=a.getKey(),e=a.getValue()||null;e||(e={});c[d]=e},_getIndex:function(a){var b=0,c;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&b++;return b},remove:function(a){var b=a.getID(),a=b.split("#");1==a.length&&this._state[b]&&delete this._state[b];if(1<a.length&&(a=b.substring(b.lastIndexOf("#")+
- 1),b=b.substring(0,b.lastIndexOf("#")),b=this._find(b)))b=b.getRef(),b[a]&&delete b[a]},_getRoot:function(){return this._rootNode},_findReference:function(a){if(a==this.ROOT)return this._state;var b=!1,a=a.split("#"),c=this._state;if(!c)return null;for(var d in a)if(Object.prototype.hasOwnProperty.call(a,d)){var e=a[d],b=!1;if(this._findMatch(c,e))c=c[e],b=!0;else break}return!b?null:c},_findMatch:function(a,b){return a[b]?!0:!1},commit:function(a){return new com.ibm.mm.enabler.DeferredImpl(this,
- this._commit,a)},_commit:function(a,b,c){this._deferred=a;this._sync=b;this._processShareableParameters();if(this._isDirty&&(!this._pagemode||this._pagemode&&"edit"!=this._pagemode))this._isTransactionDirty=!0,this.processor.postprocess(this._state,dojo.hitch(this,this._postprocess),this._stateInternal,c)},_processShareableParameters:function(){var a=this._state.sparams;if(a)for(var b in a)if(Object.prototype.hasOwnProperty.call(a,b)){var c={};c.itemSetName=b;var d=[],e;for(e in a[b])if(Object.prototype.hasOwnProperty.call(a[b],
- e)){var f=a[b][e].value,g;for(g in f)if(Object.prototype.hasOwnProperty.call(f,g)){var m=f[g].params;m&&m._isDirty&&(d.push(m._change),f[g].value==this.DELETE_TOKEN?(f[g]=null,delete f[g]):(f[g].params=null,delete f[g].params))}if(0<d.length&&(c.changes=d,a[b][e].params&&a[b][e].params._listeners)){var f=a[b][e].params._listeners,h;for(h in f)if(Object.prototype.hasOwnProperty.call(f,h))f[h](c)}}}},discard:function(){this._state=dojo.clone(this._stateInternal);this._rootNode=new com.ibm.mm.enabler.model.state.NavigationStateNodeImpl(this,
- this.ROOT,this._state,this.ROOT,this._state);this._isDirty=!1},_getPageMode:function(){return!this._pagemode?null:this._pagemode},_setPageMode:function(a){a&&(this._pagemode=a)},dispose:function(){this._state={};this._stateInternal={};this._rootNode=new com.ibm.mm.enabler.model.state.NavigationStateNodeImpl(this,this.ROOT,this._state,this.ROOT,this._state);this._isDirty=!1;this._loaded=!0;this.processor.dispose()},startTransaction:function(){if(!this.isTransaction()){this.discard();this._isTransaction=
- !0;this._isTransactionDirty=!1;this._transactionRollbackState=dojo.clone(this._state);var a=null;this._state&&(a=this._state.wparams);if(a){var b=com.ibm.mashups.enabler.services.IdentificationService,c;for(c in a)b.isServerID(c)||delete a[c]}}},commitTransaction:function(){this.isTransaction()&&(this._isTransaction=!1,this._isTransactionDirty&&(this.discard(),this._stateInternal=this._transactionRollbackState,this._transactionRollbackState=null,this._isDirty=!0,this.processor.postprocess(this._state,
- dojo.hitch(this,this._postprocess),this._stateInternal),this._isTransactionDirty=!1))},discardTransaction:function(){if(this.isTransaction()){if(this._isTransactionDirty){this.discard();if("undefined"!=typeof this._transactionRollbackState){var a=this._transactionRollbackState,b=this._state;b&&(b.pid&&(a.pid=dojo.clone(b.pid)),b.sid&&(a.sid=dojo.clone(b.sid)),b.pageselection&&(a.pageselection=dojo.clone(b.pageselection)));this._state=this._transactionRollbackState;this._rootNode=new com.ibm.mm.enabler.model.state.NavigationStateNodeImpl(this,
- this.ROOT,this._state,this.ROOT,this._state);this._transactionRollbackState=null;this._isDirty=!0;this.processor.postprocess(this._state,dojo.hitch(this,this._postprocess),this._stateInternal)}this._isTransactionDirty=!1}this._isTransaction=!1}},isTransaction:function(){"undefined"==typeof this._isTransaction&&(this._isTransaction=!1);return this._isTransaction},_generateListenerId:function(){this._listenerCounter?this._listenerCounter++:this._listenerCounter=1;return this._listenerCounter}});dojo.declare("com.ibm.mashups.enabler.model.state.NavigationStateModelFactory",
- null,{getNavigationStateModel:function(){}});dojo.declare("com.ibm.mm.enabler.model.state.NavigationStateModelFactoryImpl",[com.ibm.mashups.enabler.model.state.NavigationStateModelFactory],{constructor:function(){},getNavigationStateModel:function(a){this.navigationstatemodel||(this.navigationstatemodel=new com.ibm.mm.enabler.model.state.NavigationStateModelImpl(a));return this.navigationstatemodel}});com.ibm.mashups.enabler.model.state.NavigationStateModelFactory=new com.ibm.mm.enabler.model.state.NavigationStateModelFactoryImpl;
- dojo.declare("com.ibm.mashups.enabler.model.state.UrlGenerator",null,{getUrl:function(){},getURL:function(){}});dojo.declare("com.ibm.mm.enabler.model.state.UrlGeneratorImpl",com.ibm.mashups.enabler.model.state.UrlGenerator,{constructor:function(){},getUrl:function(a,b,c){return this.getURL(a,b,c)},getURL:function(a,b,c){return!a?null:a.clone()._getFullUrl(b,c)}});dojo.declare("com.ibm.mashups.enabler.model.state.UrlGeneratorFactory",null,{getUrlGenerator:function(){},getURLGenerator:function(){}});
- dojo.declare("com.ibm.mm.enabler.model.state.UrlGeneratorFactoryImpl",com.ibm.mashups.enabler.model.state.UrlGeneratorFactory,{constructor:function(){this._urlGenerator=new com.ibm.mm.enabler.model.state.UrlGeneratorImpl},getUrlGenerator:function(){return this.getURLGenerator()},getURLGenerator:function(){return this._urlGenerator}});com.ibm.mashups.enabler.model.state.UrlGeneratorFactory=new com.ibm.mm.enabler.model.state.UrlGeneratorFactoryImpl;dojo.declare("com.ibm.mashups.enabler.strategy.HiddenMetaDataLoadingStrategy",
- com.ibm.mashups.enabler.strategy.Strategy,{constructor:function(a){this.names=a},getHiddenMetaDataToLoad:function(){return this.names}});dojo.declare("com.ibm.mashups.enabler.strategy.ListLoadAheadStrategy",com.ibm.mashups.enabler.strategy.Strategy,{constructor:function(a){this.interval=a},getInterval:function(){return this.interval}});dojo.declare("com.ibm.mashups.enabler.strategy.SyncMetaDataStrategy",com.ibm.mashups.enabler.strategy.Strategy,{});dojo.declare("com.ibm.mashups.enabler.strategy.TreeLoadAheadStrategy",
- com.ibm.mashups.enabler.strategy.Strategy,{constructor:function(a,b){this.parentLevel=a;this.childrenLevel=b},getChildrenLevel:function(){return this.childrenLevel},getParentLevel:function(){return this.parentLevel}});dojo.declare("com.ibm.mashups.enabler.utils.EventTransformer",null,{isTransformable:function(){}});dojo.declare("com.ibm.mm.data.datatypes",null,{_alltypes:{text:1,url:1,html:1,image:1,number:1,countrycode:1,languagecode:1,currency:1,"boolean":1,date:1,time:1,timestamp:1,email:1,postalcode:1,
- phone:1,address:1,person:1,table:1,atom:1,xml:1,json:1,modeldata:1,"xsd:string":1,"xsd:boolean":1,"xsd:decimal":1,"xsd:float":1,"xsd:double":1,"xsd:duration":1,"xsd:datetime":1,"xsd:time":1,"xsd:date":1,"xsd:gyearmonth":1,"xsd:gyear":1,"xsd:gmonthday":1,"xsd:gday":1,"xsd:gmonth":1,"xsd:hexbinary":1,"xsd:base64binary":1,"xsd:anyuri":1,"xsd:qname":1,"xsd:notation":1,"js:string":1,"js:number":1,"js:date":1,"js:boolean":1},_simpleTypes:{text:1,url:1,html:1,image:1,number:1,countrycode:1,languagecode:1,
- currency:1,"boolean":1,date:1,time:1,timestamp:1,email:1,postalcode:1,phone:1,address:1,person:1,"xsd:string":1,"xsd:boolean":1,"xsd:decimal":1,"xsd:float":1,"xsd:double":1,"xsd:duration":1,"xsd:datetime":1,"xsd:time":1,"xsd:date":1,"xsd:gyearmonth":1,"xsd:gyear":1,"xsd:gmonthday":1,"xsd:gday":1,"xsd:gmonth":1,"xsd:hexbinary":1,"xsd:base64binary":1,"xsd:anyuri":1,"xsd:qname":1,"xsd:notation":1,"js:string":1,"js:number":1,"js:date":1,"js:boolean":1},_complexTypes:{table:1,atom:1,xml:1,json:1,modeldata:1},
- specialTypes:{mashupdata:1},_mappings:{text:{url:1,html:1,number:1,countrycode:1,languagecode:1,currency:1,"boolean":1,date:1,time:1,timestamp:1,email:1,postalcode:1,phone:1,address:1,person:1,"xsd:string":1,"xsd:boolean":1,"xsd:decimal":1,"xsd:float":1,"xsd:double":1,"xsd:duration":1,"xsd:datetime":1,"xsd:time":1,"xsd:date":1,"xsd:gyearmonth":1,"xsd:gyear":1,"xsd:gmonthday":1,"xsd:gday":1,"xsd:gmonth":1,"xsd:hexbinary":1,"xsd:base64binary":1,"xsd:anyuri":1,"xsd:qname":1,"xsd:notation":1,"js:string":1,
- "js:number":1,"js:date":1,"js:boolean":1},url:{"xsd:anyuri":1,text:1,"xsd:string":1,"js:string":1},html:{text:1,"xsd:string":1,"js:string":1},image:{},number:{"xsd:decimal":1,"xsd:float":1,"xsd:double":1,"js:number":1,text:1,"xsd:string":1,"js:string":1},countrycode:{text:1,"xsd:string":1,"js:string":1},languagecode:{text:1,"xsd:string":1,"js:string":1},currency:{text:1,"xsd:string":1,"js:string":1},"boolean":{"xsd:boolean":1,"js:boolean":1,text:1,"xsd:string":1,"js:string":1},date:{timestamp:1,"xsd:date":1,
- "js:date":1,text:1,"xsd:string":1,"js:string":1},time:{timestamp:1,"xsd:time":1,text:1,"xsd:string":1,"js:string":1},timestamp:{date:1,time:1,"xsd:datetime":1,text:1,"xsd:string":1,"js:string":1},email:{text:1,"xsd:string":1,"js:string":1},postalcode:{text:1,"xsd:string":1,"js:string":1},phone:{text:1,"xsd:string":1,"js:string":1},address:{text:1,"xsd:string":1,"js:string":1},person:{text:1,"xsd:string":1,"js:string":1},json:{},"xsd:string":{text:1,url:1,html:1,number:1,countrycode:1,languagecode:1,
- currency:1,"boolean":1,date:1,time:1,timestamp:1,email:1,postalcode:1,phone:1,address:1,person:1,"xsd:boolean":1,"xsd:decimal":1,"xsd:float":1,"xsd:double":1,"xsd:duration":1,"xsd:datetime":1,"xsd:time":1,"xsd:date":1,"xsd:gyearmonth":1,"xsd:gyear":1,"xsd:gmonthday":1,"xsd:gday":1,"xsd:gmonth":1,"xsd:hexbinary":1,"xsd:base64binary":1,"xsd:anyuri":1,"xsd:qname":1,"xsd:notation":1,"js:string":1,"js:number":1,"js:date":1,"js:boolean":1},"xsd:boolean":{"boolean":1,"js:boolean":1,text:1,"xsd:string":1,
- "js:string":1},"xsd:decimal":{number:1,"js:number":1,text:1,"xsd:string":1,"js:string":1},"xsd:float":{number:1,"js:number":1,text:1,"xsd:string":1,"js:string":1},"xsd:double":{number:1,"js:number":1,text:1,"xsd:string":1,"js:string":1},"xsd:duration":{text:1,"xsd:string":1,"js:string":1},"xsd:gmonthday":{text:1,"xsd:string":1,"js:string":1},"xsd:gday":{text:1,"xsd:string":1,"js:string":1},"xsd:gmonth":{text:1,"xsd:string":1,"js:string":1},"xsd:hexbinary":{text:1,"xsd:string":1,"js:string":1},"xsd:base64binary":{text:1,
- "xsd:string":1,"js:string":1},"xsd:qname":{text:1,"xsd:string":1,"js:string":1},"xsd:notation":{text:1,"xsd:string":1,"js:string":1},"xsd:anyuri":{url:1,text:1,"xsd:string":1,"js:string":1},"xsd:time":{time:1,text:1,"xsd:string":1,"js:string":1},"xsd:date":{date:1,"js:date":1,text:1,"xsd:string":1,"js:string":1},"xsd:datetime":{timestamp:1,text:1,"xsd:string":1,"js:string":1},"xsd:gyear":{date:1,text:1,"xsd:string":1,"js:string":1},"xsd:gyearmonth":{date:1,text:1,"xsd:string":1,"js:string":1},"js:string":{text:1,
- url:1,html:1,number:1,countrycode:1,languagecode:1,currency:1,"boolean":1,date:1,time:1,timestamp:1,email:1,postalcode:1,phone:1,address:1,person:1,"xsd:string":1,"xsd:boolean":1,"xsd:decimal":1,"xsd:float":1,"xsd:double":1,"xsd:duration":1,"xsd:datetime":1,"xsd:time":1,"xsd:date":1,"xsd:gyearmonth":1,"xsd:gyear":1,"xsd:gmonthday":1,"xsd:gday":1,"xsd:gmonth":1,"xsd:hexbinary":1,"xsd:base64binary":1,"xsd:anyuri":1,"xsd:qname":1,"xsd:notation":1,"js:number":1,"js:date":1,"js:boolean":1},"js:date":{date:1,
- "xsd:date":1,text:1,"xsd:string":1,"js:string":1},"js:number":{"xsd:decimal":1,"xsd:float":1,"xsd:double":1,number:1,text:1,"xsd:string":1,"js:string":1},"js:boolean":{"xsd:boolean":1,"boolean":1,text:1,"xsd:string":1,"js:string":1}},_semanticMappings:{text:{"xsd:string":1,"js:string":1},url:{"xsd:anyuri":1},html:{},image:{},number:{"xsd:decimal":1,"xsd:float":1,"xsd:double":1,"js:number":1},countrycode:{},languagecode:{},currency:{},"boolean":{"xsd:boolean":1,"js:boolean":1},date:{"xsd:date":1,"js:date":1},
- time:{"xsd:time":1},timestamp:{"xsd:datetime":1},email:{},postalcode:{},phone:{},address:{},person:{},json:{},"xsd:string":{text:1,"js:string":1},"xsd:boolean":{"boolean":1,"js:boolean":1},"xsd:decimal":{number:1,"js:number":1},"xsd:float":{number:1,"js:number":1},"xsd:double":{number:1,"js:number":1},"xsd:duration":{},"xsd:gmonthday":{},"xsd:gday":{},"xsd:gmonth":{},"xsd:hexbinary":{},"xsd:base64binary":{},"xsd:qname":{},"xsd:notation":{},"xsd:anyuri":{url:1},"xsd:time":{time:1},"xsd:date":{date:1,
- "js:date":1},"xsd:datetime":{timestamp:1},"xsd:gyear":{date:1},"xsd:gyearmonth":{date:1},"js:string":{text:1,"xsd:string":1},"js:date":{date:1,"xsd:date":1},"js:number":{"xsd:decimal":1,"xsd:float":1,"xsd:double":1,number:1},"js:boolean":{"xsd:boolean":1,"boolean":1}},_SIMPLE_DATA_TYPE:1,_COMBINED_DATA_TYPE:2,_COMPLEX_DATA_TYPE:3,resourceBundle:null,constructor:function(){this.resourceBundle=dojo.i18n.getLocalization("com.ibm.mm.data","dataTypeStrings");this.xsdNS=com.ibm.mm.enabler.model.NameSpaceFactory.getNameSpaceUri(com.ibm.mm.enabler.model.NameSpaceFactory.NS_XSD);
- this.nsNS=com.ibm.mm.enabler.model.NameSpaceFactory.getNameSpaceUri(com.ibm.mm.enabler.model.NameSpaceFactory.NS_EVENT_DATATYPES);this.jsNS=com.ibm.mm.enabler.model.NameSpaceFactory.getNameSpaceUri(com.ibm.mm.enabler.model.NameSpaceFactory.NS_JS);this.xsdPrefix="xsd:";this.nsPrefix="";this.jsPrefix="js:"},addDataType:function(a,b){a&&(this._alltypes.typename=1,!b||b==this._SIMPLE_DATA_TYPE?this._simpleTypes.typename=1:this._complexTypes.typename=1)},removeDataType:function(a){delete this._alltypes[a]},
- addDataMapping:function(a,b){null===this._mappings.typename1&&(this._mappings.typename1={});this._mappings[a][b]=1},removeDataMapping:function(a,b){null!==this._mappings[a]&&null!==this._mappings[a][b]&&delete this._mappings[a][b]},getAllTypes:function(){return dojo.clone(this._alltypes)},doesTypeMatch:function(a,b){var c=!1;if(!a||!b)return c;a=a.toLowerCase();b=b.toLowerCase();if(a==b||"any"==a||"any"==b)c=!0;else switch(this.checkDataType(a)){case this._SIMPLE_DATA_TYPE:switch(this.checkDataType(b)){case this._SIMPLE_DATA_TYPE:1==
- this._mappings[a][b]&&(c=!0);break;case this._COMBINED_DATA_TYPE:var d=this.getMainType(b);if(a==d||1==this._mappings[a][d])c=!0}}return c},doesTypeFlexMatch:function(a,b,c){var d=!1;if(null===a||null===b)return d;if(null===c||"undefined"==typeof c)c=!0;a=this.getNormalizedPayload(a);b=this.getNormalizedPayload(b);a=a.toLowerCase();b=b.toLowerCase();if(a==b||"any"==a||"any"==b)d=!0;else{var e;switch(this.checkDataType(a)){case this._SIMPLE_DATA_TYPE:e=this.checkDataType(b);switch(e){case this._SIMPLE_DATA_TYPE:c?
- 1==this._mappings[a][b]&&(d=!0):1==this._semanticMappings[a][b]&&(d=!0);break;case this._COMBINED_DATA_TYPE:if(b=this.getMainType(b),c){if(a==b||1==this._mappings[a][b])d=!0}else if(a==b||1==this._semanticMappings[a][b])d=!0}break;case this._COMBINED_DATA_TYPE:switch(e=this.checkDataType(b),a=this.getMainType(a),e){case this._SIMPLE_DATA_TYPE:if(c){if(a==b||1==this._mappings[a][b])d=!0}else if(a==b||1==this._semanticMappings[a][b])d=!0;break;case this._COMBINED_DATA_TYPE:if(b=this.getMainType(b),
- a==b||1==this._mappings[a][b])d=!0}}}return d},getMainType:function(a){var b=a.indexOf(".");return 0>b?a:a.substring(0,b)},checkDataType:function(a){var a=a.toLowerCase(),b=a.split(".");return 1==b.length?1==this._simpleTypes[a]?this._SIMPLE_DATA_TYPE:this._COMPLEX_DATA_TYPE:2==b.length||3==b.length?(a=b[b.length-1],"url"==b[0]||"languagecode"==a||"countrycode"==a?this._COMBINED_DATA_TYPE:this._COMPLEX_DATA_TYPE):this._COMPLEX_DATA_TYPE},getTypeLabel:function(a,b){var c=a=a.toLowerCase();if(this.checkDataType(a)==
- this._COMBINED_DATA_TYPE)var d=a.indexOf("."),c=a.substring(0,d),c=this.getSimpleTypeLabel(c,b),d=a.substring(d+1,a.length),d=this.getSimpleTypeLabel(d,b),c=c+" ("+d+")";else c=this.getSimpleTypeLabel(a,b);return c},getNormalizedPayload:function(a){var b=a,c=a,b=a.indexOf("{"),d=a.indexOf("}"),e="";d>b&&(b=a.substring(b+1,d),c=a.substring(d+1,a.length),b===this.xsdNS?e=this.xsdPrefix:b===this.jsNS?e=this.jsPrefix:b===this.nsNS&&(e=this.nsPrefix),c=e+c);return c},getSimpleTypeLabel:function(a){return this.resourceBundle[a]?
- this.resourceBundle[a]:a.charAt(0).toUpperCase()+a.substring(1)}});dojo.declare("com.ibm.mm.enabler.utils.EventTransformerImpl",[com.ibm.mashups.enabler.utils.EventTransformer],{constructor:function(){this.dataTypes=new com.ibm.mm.data.datatypes},_transform:function(a,b,c){var d=null;if(a.type==b.type||"any"==a.type||"any"==b.type)d=new com.ibm.mm.iwidget.IEventImpl(a.name,a.type,a.payload,a.source);else if(this.isTransformable(a,b,c)){c=null;switch(b.type.toLowerCase()){case "time":"xsd:time"==a.type.toLowerCase()&&
- (c=this._xsdTimeToMmTime(a.payload));break;case "date":switch(a.type.toLowerCase()){case "xsd:date":c=this._xsdDateToMmDate(a.payload);break;case "js:date":c=this._jsDateToMmDate(a.payload)}break;case "timestamp":"xsd:datetime"==a.type.toLowerCase()&&(c=this._xsdDateTimeToMmTimestamp(a.payload));break;case "xsd:time":"time"==a.type.toLowerCase()&&(c=this._mmTimeToXsdTime(a.payload));break;case "xsd:date":switch(a.type.toLowerCase()){case "date":c=this._mmDateToXsdDate(a.payload);break;case "js:date":c=
- this._jsDateToXsdDate(a.payload)}break;case "xsd:datetime":"timestamp"==a.type.toLowerCase()&&(c=this._mmTimestampToXsdDatetime(a.payload));break;case "js:date":switch(a.type.toLowerCase()){case "xsd:date":c=this._xsdDateToJsDate(a.payload);break;case "date":c=this._mmDateToJsDate(a.payload)}}d=null!==c?new com.ibm.mm.iwidget.IEventImpl(a.name,b.type,c,a.source):new com.ibm.mm.iwidget.IEventImpl(a.name,b.type,a.payload,a.source)}return d},isTransformable:function(a,b,c){return this.dataTypes.doesTypeFlexMatch(a.type,
- b.type,c)},_mmTimestampToXsdDatetime:function(a){var b=/^([\d]{4})([\d]{2})([\d]{2})\s([\d]{2})([\d]{2})([\d]{2})$/,c=!1;return(c=/^([\d]{4})-([\d]{2})-([\d]{2})\s([\d]{2}):([\d]{2}):([\d]{2})\.([\d]{4})$/.test(a))?a.split(/[.]{1}/)[0].replace(/\s/,"T"):(c=/^([\d]{4})-([\d]{2})-([\d]{2})\s([\d]{2}):([\d]{2}):([\d]{2})$/.test(a))?a.replace(/\s/,"T"):(c=b.test(a))?(a=b.exec(a),a[1]+"-"+a[2]+"-"+a[3]+"T"+a[4]+":"+a[5]+":"+a[6]):null},_mmDateToXsdDate:function(a){var b=/^([\d]{4})([\d]{2})([\d]{2})$/,
- c=/^([\d]{4})([\d]{2})$/,d=/^([\d]{4})$/,e=!1;return(e=/^([\d]{4})-([\d]{2})-([\d]{2})$/.test(a))?a:(e=b.test(a))?(c=b.exec(a),a=c[1],b=c[2],a+"-"+b+"-"+c[3]):(e=c.test(a))?(c=c.exec(a),a=c[1],b=c[2],a+"-"+b+"-01"):(e=d.test(a))?(c=d.exec(a),a=c[1],a+"-01-01"):null},_mmTimeToXsdTime:function(a){var b=!1;return(b=/^\d{2}\:\d{2}\:\d{2}\.\d{4}$/.test(a))?a.split(/[.]{1}/)[0]:(b=/^\d{2}\:\d{2}\:\d{2}$/.test(a))?a:(b=/^\d{2}\:\d{2}$/.test(a))?a+":00":(b=/^\d{2}$/.test(a))?a+":00:00":null},_xsdDateTimeToMmTimestamp:function(a){var b=
- /^\d{4}\-\d{2}\-\d{2}\T\d{2}\:\d{2}\:\d{2}/,c=!1;return(c=b.test(a))?a.match(b)[0].replace(/T/," "):null},_xsdDateToMmDate:function(a){var b=/^\d{4}\-\d{2}\-\d{2}/,c=!1;return(c=b.test(a))?a.match(b)[0]:null},_xsdTimeToMmTime:function(a){var b=/^\d{2}\:\d{2}\:\d{2}/,c=!1;return(c=b.test(a))?a.match(b)[0]:null},_jsDateToMmDate:function(a){if(a){var b=a.getFullYear(),c=a.getMonth(),a=a.getDate(),c=this._format(c.toString()),a=this._format(a.toString());return b+"-"+c+"-"+a}return null},_jsDateToXsdDate:function(a){var b=
- null;if(a){var b=a.getFullYear(),c=a.getMonth(),d=a.getDate(),a=a.getTimezoneOffset(),c=this._format(c.toString()),d=this._format(d.toString()),b=b+"-"+c+"-"+d;0!==a&&(0>a?(c=Math.ceil(a/60),a=-1*a%60,a=0===a?"-"+this._format((-1*c).toString())+":00":"-"+this._format((-1*c).toString())+this._format(a)):(c=Math.floor(a/60),a%=60,a=0===a?"+"+this._format(c.toString())+":00":"+"+this._format(c.toString())+this._format(a)),b+=a)}return b},_xsdDateToJsDate:function(a){var b=/^([\d]{4})-(\d\d)-(\d\d)/,
- c=!1;if(c=b.test(a)){c=new Date(NaN);if(b=b.exec(a))a=b[2],c.setFullYear(b[1],a-1,b[3]),a!=c.getMonth()+1&&c.setTime(NaN);return c}return null},_mmDateToJsDate:function(a){return this._xsdDateToJsDate(this._mmDateToXsdDate(a))},_format:function(a){1==a.length&&(a="0"+a);return a}});dojo.declare("com.ibm.mashups.enabler.widget.Constants",null,{FILTER_HANDLED_EVENTS:"HandledEvents",FILTER_PUBLISHED_EVENTS:"PublishedEvents"});dojo.declare("com.ibm.mm.enabler.widget.Constants",com.ibm.mashups.enabler.widget.Constants,
- {constructor:function(){},PERSISTENCE_MODE_MODEL:"Model",PERSISTENCE_MODE_MODEL_PREFERENCES:"ModelPreferences",PERSISTENCE_MODE_DOM:"DOM"});com.ibm.mashups.enabler.widget.Constants=new com.ibm.mm.enabler.widget.Constants;dojo.declare("com.ibm.mashups.iwidget.itemset.PersistentAttributesFactory",null,{createPersistentAttributes:function(){},getSupportedPersistenceMode:function(){}});dojo.declare("com.ibm.mashups.iwidget.services.PersistentAttributesFactoryService",null,{SERVICE_NAME:"persistentAttributesFactoryService",
- createPersistentAttributes:function(){},setFactory:function(){},removeFactory:function(){}});com.ibm.mashups.iwidget.services.PersistentAttributesFactoryService.SERVICE_NAME=com.ibm.mashups.iwidget.services.PersistentAttributesFactoryService.prototype.SERVICE_NAME;dojo.declare("com.ibm.mm.iwidget.manageditemset.DOMPersistentAttributesFactoryImpl",com.ibm.mashups.iwidget.itemset.PersistentAttributesFactory,{constructor:function(){this.modes=["DOM"]},createPersistentAttributes:function(a){return new com.ibm.mm.iwidget.manageditemset.PersistentAttributes(a,
- !0)},getSupportedPersistenceMode:function(){return this.modes}});dojo.declare("com.ibm.mm.iwidget.services.PersistentAttributesFactoryServiceImpl",com.ibm.mashups.iwidget.services.PersistentAttributesFactoryService,{constructor:function(){this._factories={}},createPersistentAttributes:function(a,b){b&&com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.iwidget.services.ContainerService.SERVICE_NAME).registerOnChangeListener(com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_ATTRIBUTES,
- b);var c=a.id,d=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.iwidget.services.ContainerService.SERVICE_NAME).getPersistenceMode(com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_ATTRIBUTES);if(dojo.hasClass(a.rootElement,com.ibm.mm.iwidget.services.PersistentAttributesFactoryServiceImpl.STANDALONE_CLASS)||!d)d=com.ibm.mm.iwidget.services.PersistentAttributesFactoryServiceImpl.DEFAULT_PERSISTENCE;if("undefined"!==typeof d&&d==com.ibm.mashups.enabler.widget.Constants.PERSISTENCE_MODE_MODEL){var e=
- com.ibm.mashups.enabler.widget.Factory.getWidgetModel(),f=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel(),f=com.ibm.mashups.enabler.model.state.AccessorFactory.getPageAccessor(f).getPageID(),c=com.ibm.mm.iwidget.Utils.getModelID(c);e.findWidgetWindow(c,f).start()||(com.ibm.mashups.enabler.services.IdentificationService.isClientID(c)||dojo.isFunction(a._getResourceBundle)&&a._getResourceBundle(),d=com.ibm.mm.iwidget.services.PersistentAttributesFactoryServiceImpl.DEFAULT_PERSISTENCE)}return!(d in
- this._factories)?null:this._factories[d].createPersistentAttributes(a,d)},setFactory:function(a,b){this._factories[a]=b},removeFactory:function(a){a in this._factories&&delete this._factories[a]}});com.ibm.mm.iwidget.services.PersistentAttributesFactoryServiceImpl.DEFAULT_PERSISTENCE=com.ibm.mashups.enabler.widget.Constants.PERSISTENCE_MODE_DOM;com.ibm.mm.iwidget.services.PersistentAttributesFactoryServiceImpl.STANDALONE_CLASS=com.ibm.mm.iwidget.Constants.CSSCLASS_PREFIXED_INSTANCE.iwStandalone;com.ibm.mashups.services.ServiceManager.setService(com.ibm.mashups.iwidget.services.PersistentAttributesFactoryService.SERVICE_NAME,
- new com.ibm.mm.iwidget.services.PersistentAttributesFactoryServiceImpl);com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.iwidget.services.PersistentAttributesFactoryService.SERVICE_NAME).setFactory(com.ibm.mashups.enabler.widget.Constants.PERSISTENCE_MODE_DOM,new com.ibm.mm.iwidget.manageditemset.DOMPersistentAttributesFactoryImpl);dojo.declare("com.ibm.mm.iwidget.services.IWidgetFragmentServiceImpl",null,{createItem:function(a,b,c,d){d||(d="iw-");var e=document.createElement("a");
- dojo.addClass(e,d+iwConstants.CSSCLASS_INSTANCE.iwItem);dojo.style(e,"visibility","hidden");dojo.style(e,"display","none");e.setAttribute("href","#"+a);c&&e.setAttribute("lang",c);b&&!c&&(e.innerHTML=b);return e},createItemSet:function(a,b){b||(b="iw-");var c=document.createElement("span");dojo.addClass(c,b+iwConstants.CSSCLASS_INSTANCE.iwItemSet);c.setAttribute("title",a);dojo.style(c,"visibility","hidden");dojo.style(c,"display","none");return c},createWidgetDefRef:function(a,b){b||(b="iw-");var c=
- document.createElement("a");dojo.addClass(c,b+iwConstants.CSSCLASS_INSTANCE.iwDefinition);c.setAttribute("href",a);dojo.style(c,"visibility","hidden");dojo.style(c,"display","none");return c},getItemSet:function(a,b,c){c||(c="iw-");for(var d=null,a=dojo.byId(a),c=dojo.query("."+c+iwConstants.CSSCLASS_INSTANCE.iwItemSet,a),a=0;a<c.length;a++){var e=c[a],f=e.getAttribute("title");if(b==f){d=e;break}}return d},getItem:function(a,b,c){c||(c="iw-");for(var d=null,a=dojo.query("."+c+iwConstants.CSSCLASS_INSTANCE.iwItem,
- a),c=0;c<a.length;c++){var e=a[c],f=this.getKeyFromHref(e);if(f&&f==b){d=e;break}}return d},getItems:function(a,b){b||(b="iw-");var c=dojo.query("."+b+iwConstants.CSSCLASS_INSTANCE.iwItem,a);if("undefined"==typeof c||null===c||0===c.length)c=null;return c},getWidgetDefRef:function(a,b){b||(b="iw-");var c=null,d=dojo.byId(a);(d=dojo.query("."+b+iwConstants.CSSCLASS_INSTANCE.iwDefinition,d)[0].getAttribute("href"))&&(c=d);return c},getKeyFromHref:function(a){a=a.getAttribute("href");if(!a)return null;
- var b=a.indexOf("#");return 0>b?null:a.substring(b+1)}});com.ibm.mashups.services.ServiceManager.setService("iwidgetFragmentService",new com.ibm.mm.iwidget.services.IWidgetFragmentServiceImpl);dojo.declare("com.ibm.mm.enabler.EndpointUtilsExtendedImpl",com.ibm.mm.enabler.EndpointUtilsDefaultImpl,{constructor:function(){},checkForEndpoints:function(a){if(!a)return null;var b=a.toString();if(b){var c=b.indexOf("endpoint://",0);if(0===c){if(c=b.indexOf("/",11),0<c)return a=b.substring(11,c),b=b.substring(c+
- 1),(a=this._resolveEndpoint(a))?b="/"==a.charAt(a.length-1)?a+b:a+"/"+b:null}else if(0<c&&(b=b.substring(c),b=this.checkForEndpoints(b)))return b.substring(0)}return a},_resolveEndpoint:function(a){this.co||this._init();var a=decodeURIComponent(a),b=this.co.getValue(a+".url");if(!b)if("{contenthandler}"==a)b=this.urlContentHandler;else if("{webdavroot}"==a)b=this.urlWebDavRoot;else return null;b&&("/"!=b.charAt(0)&&"http"!=b.substr(0,4))&&(b="/"+b);return b},_init:function(){this.cs=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME);
- this.co=this.cs.getConfigObject(com.ibm.mashups.enabler.services.ConfigConstants.ENDPOINT_CONFIG_PROVIDER);this.urlContentHandler="";this.urlContentHandler+=this.cs.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTEXT_ROOT);var a;a=this.cs.getValue(com.ibm.mashups.enabler.services.ConfigConstants.ANONYMOUS_USER)?this.cs.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTENTHANDLER_PUBLIC):this.cs.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTENTHANDLER_PRIVATE);
- this.urlContentHandler+=a;this.urlWebDavRoot=com.ibm.mm.enabler.remote&&com.ibm.mm.enabler.remote.WebDavUrlFactory?com.ibm.mm.enabler.remote.WebDavUrlFactory.createUrl()+"/":null}});com.ibm.mm.enabler.EndpointUtils=new com.ibm.mm.enabler.EndpointUtilsExtendedImpl;dojo.declare("com.ibm.mm.iwidget.payloadDef",null,{constructor:function(a,b,c,d,e){this.name=a;this.attributes=e||null;this.attributes||(this.attributes={});"undefined"!=typeof b&&null!==b&&(this.attributes.type=b);"undefined"!=typeof c&&
- null!==c&&(this.attributes.defaultValue=c);"undefined"!=typeof d&&null!==d&&(this.attributes.description=d);this.attributeNames=[];this.attributeNames.push("type");this.attributeNames.push("defaultValue");this.attributeNames.push("description");for(var f in e)Object.prototype.hasOwnProperty.call(e,f)&&this.attributeNames.push(f);this.children=new com.ibm.mm.enabler.ArrayMap},setAttribute:function(a,b){this.attributes[a]=b;"undefined"!=typeof this.attributeNames[a]&&this.attributeNames.push(a)},getAttribute:function(a){a=
- this.attributes[a];"undefined"==typeof a&&(a=null);return a},getAttributeNames:function(){return this.attributeNames},getChildren:function(){return this.children.values()},getChild:function(a){return this.children.get(a)},setChild:function(a,b){this.children.put(a,b)},getChildrenNames:function(){this.children.keySet()},getName:function(){return this.name},getType:function(){return this.attributes.type},getDefaultValue:function(){return this.attributes.defaultValue},getDescription:function(){return this.attributes.description}});
- dojo.declare("com.ibm.mm.iwidget.UtilsExtendedImpl",com.ibm.mm.iwidget.UtilsDefaultImpl,{getPayloadDef:function(a){for(var b=a.getAttribute("name"),b=new com.ibm.mm.iwidget.payloadDef(b),c=a.attributes,d=0;d<c.length;d++){var e=c[d];"name"!=e.name&&b.setAttribute(e.name,e.value)}a=a.childNodes;for(c=0;c<a.length;c++)d=a[c],1==d.nodeType&&(d=this.getPayloadDef(d),b.setChild(d.name,d));return b}});ibmConfig.enablerLayerModules&&0<=dojo.indexOf(ibmConfig.enablerLayerModules,"CoreModel")?dojo.require("com.ibm.mm.enabler.iwidget.UtilsModelImpl"):
- com.ibm.mm.iwidget.Utils=new com.ibm.mm.iwidget.UtilsExtendedImpl;dojo.declare("com.ibm.mm.iwidget.icontext.IContextMMExtensionImpl",null,{constructor:function(a){this.widget=a;this.widgetId=a.id},getSupportedModes:function(){return this.widgetwrapper.widgetDef.getSupportedModes()},getPayloadDef:function(a){a=this.widget.widgetDef.payloadDefs[a];return"undefined"==typeof a?null:a},getPayloadDefNames:function(){var a=this.widget.widgetDef.payloadDefs,b=[],c;for(c in a)Object.prototype.hasOwnProperty.call(a,
- c)&&b.push(c);return b}});dojo.declare("com.ibm.mm.iwidget.manageditemset.UserProfileImpl",com.ibm.mashups.iwidget.itemset.ManagedItemSet,{constructor:function(a,b){this.widgetId=a;this.user=b},getItemValue:function(a){if(!a)return null;a=this.user.getAttribute(a);"undefined"==typeof a&&(a=null);return a},setItemValue:function(a,b){if(!a||!b||this.isReadOnly(a))return null;this.user.setAttribute(a,b);return this},isReadOnly:function(a){if("undefined"==typeof a||null===a)return!1;var b=this.user.getReadOnlyAttributeNames();
- return this._contains(b,a)},_contains:function(a,b){if(!b||!a||a&&!dojo.isArray(a))return!1;for(var c=0;c<a.length;c++)if(a[c]&&a[c]==b)return!0;return!1},removeItem:function(a){if(!a||this.isReadOnly(a))return null;this.user.removeAttribute(a);return this},getAllNames:function(){var a=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue("com.ibm.mashups.hideLookaside");return dojo.isString(a)&&"true"==a.toLowerCase()?this.user.getReadOnlyAttributeNames():
- this.user.getAttributeNames()},save:function(a){return this.commit(a)},commit:function(a){var b=null;com.ibm.mashups.enabler.user.Factory.getUserModel&&(b=com.ibm.mashups.enabler.user.Factory.getUserModel());b&&(b=b.commit(),b.setFinishedCallback(function(b,d){if(a){var e=!1,f=iwConstants.USERPROFILE;d&&d==iwConstants.status.SUCCESS&&(e=!0);a(f,e)}}),b.start())},addListener:function(a){var b=this._getWidget();return!b?null:b._registerListener(iwConstants.USERPROFILE,a)},removeListener:function(a){var b=
- this._getWidget();return!b?null:b._removeListener(iwConstants.USERPROFILE,a)},_getWidget:function(){return com.ibm.mashups.iwidget.model.Factory.getGlobalModel().find(this.widget)||null}});dojo.declare("com.ibm.mm.iwidget.widget.ResourceImpl",null,{constructor:function(a){if(a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&(this[b]=a[b])},IMAGE:{bmp:"bmp",cod:"cod",gif:"gif",ief:"ief",jpe:"jpe",jpeg:"jpeg",jpg:"jpg",jfif:"jfif",svg:"svg",tif:"tif",tiff:"tiff",ras:"ras",cmx:"cmx",ico:"ico",
- pnm:"pnm",pbm:"pbm",pgm:"pgm",ppm:"ppm",rgb:"rgb",xbm:"xbm",xpm:"xpm",xwd:"xwd"},isCSS:function(){var a=!1,b=this._getExtension();b&&"css"==b&&(a=!0);if(!a&&this.getMimeType()&&("text/stylesheet"==this.getMimeType()||"text/css"==this.getMimeType()))a=!0;return a},isImage:function(){var a=!1,b=this._getExtension();b&&b in this.IMAGE&&(a=!0);!a&&this.getMimeType()&&0===this.getMimeType().indexOf("image/")&&(a=!0);return a},isJS:function(){var a=!1,b=this._getExtension();b&&"js"==b&&(a=!0);if(!a&&this.getMimeType()&&
- (b=this.getMimeType(),"text/javascript"==b||"application/x-javascript"==b||"application/javascript"==b))a=!0;return a},getGlobalId:function(){var a=this[iwConstants.RESOURCE.globalid];a||(a=this[iwConstants.RESOURCE.id]);a||(a=null);return a},getSrc:function(){return this[iwConstants.RESOURCE.src]},getMimeType:function(){var a=this[iwConstants.RESOURCE.mimeType];a||(a=null);return a},_getExtension:function(){var a=this.getSrc();if(!a)return null;a=a.substring(a.lastIndexOf(".")+1,a.length);return!a?
- null:a}});dojo.declare("com.ibm.mm.iwidget.icontext.IContextExtendedImpl",com.ibm.mm.iwidget.icontext.IContextDefaultImpl,{_initEvents:function(){this.iEvents=new com.ibm.mm.iwidget.icontext.IContextIEventsImpl(this.widgetwrapper)},_initIO:function(){this.io=new com.ibm.mm.iwidget.icontext.IContextIOImpl(this.widgetwrapper)},_initMMExtension:function(){this._mm=new com.ibm.mm.iwidget.icontext.IContextMMExtensionImpl(this.widgetwrapper)},getUserProfile:function(){var a=null;com.ibm.mashups.enabler.user.Factory.getUserModel&&
- (a=com.ibm.mashups.enabler.user.Factory.getUserModel());var b=null;a&&(b=a.findCurrentUser().start());a=null;b&&(a=new com.ibm.mm.iwidget.manageditemset.UserProfileImpl(this.widgetId,b));return a},requires:function(a,b,c,d,e){(e=e||null)||(e="text/plain");if(c=c||null){var f={};f[iwConstants.RESOURCE.mimeType]=e;f[iwConstants.RESOURCE.id]=a;f[iwConstants.RESOURCE.version]=b;f[iwConstants.RESOURCE.src]=c;f[iwConstants.RESOURCE.callback]=d;a=new com.ibm.mm.iwidget.widget.ResourceImpl(f);com.ibm.mashups.services.ServiceManager.getService("resourceLoadService").loadResource(a,
- this.widgetId)}},processiWidgets:function(a){dojo.publish("/com/ibm/mashups/livetext/livetextchanged",[a,!0])},getShareableItemSet:function(a){a=a||null;return!a?null:this.widgetwrapper._getShareableItemSet(a)}});com.ibm.mm.iwidget.icontext.IContextImpl=com.ibm.mm.iwidget.icontext.IContextExtendedImpl;dojo.declare("com.ibm.mm.iwidget.manageditemset.IDescriptorExtendedImpl",com.ibm.mm.iwidget.manageditemset.IDescriptorDefaultImpl,{_getWindowState:function(){return value=this.widget?com.ibm.mashups.enabler.model.state.AccessorFactory.getWidgetAccessor(this.navStateModel,
- this.widget.id).getWindowState():"normal"}});com.ibm.mm.iwidget.manageditemset.IDescriptorImpl=com.ibm.mm.iwidget.manageditemset.IDescriptorExtendedImpl;dojo.declare("com.ibm.mm.iwidget.services.ResourceLoadServiceImpl",null,{constructor:function(){this.modules={};this.LOADING_TOKEN=0;this.LOADING_ERROR_TOKEN=1;this.LOADED_TOKEN=2;this.waitingqueue={};this.evalqueue={};this.callbackQueue={};var a=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME);
- if(a&&(a=a.getValue(com.ibm.mashups.enabler.services.ConfigConstants.REGISTER_LOADEDRESOURCES))){if(dojo.isString(a))try{a=dojo.fromJson(a)}catch(b){}dojo.isArray(a)&&(this.registeredLoadedResources=a)}},executeCallbackQueue:function(a){if(this.callbackQueue[a]){var b=this.callbackQueue[a];if(a=com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel().find(a))for(var c=0;c<b.length;c++)if(b[c]){var d=a._getHandlerScope(b[c].cb);d&&(dojo.hitch(d,b[c].cb)(b[c].id,b[c].src,b[c].status),b[c]=null)}}},
- loadResource:function(a,b,c){var d=a.getGlobalId(),e=a.getSrc(),f=null,f=a.isJS()?this._rewriteUrl(e,b,!0):this._rewriteUrl(e,b,!1);d||(d=f);if(d){this.evalqueue[b]=this.evalqueue[b]?this.evalqueue[b]:[];this.evalqueue[b].push({_id:d,resourceElem:a,cb2:c,widgetId:b,isReady:!1});if(e=a[iwConstants.RESOURCE.skipLoad]){var g=!1;try{g=dojo.eval(e)}catch(m){g=!1}if(g){this._handleLoadedResource(d,b,null,status.OTHER);return}}e=this.registeredLoadedResources;if(dojo.isArray(e))for(g=0;g<e.length;g++)if(e[g].globalid&&
- e[g].globalid==d)if(e[g].version){var h=a[iwConstants.RESOURCE.version];if(!h||h&&h==e[g].version){this._handleLoadedResource(d,b,null,status.OTHER);return}}else{this._handleLoadedResource(d,b,null,status.OTHER);return}var e=this.modules[d],k=this;if(e&&null!==e)switch(e.type){case 0:this.waitingqueue[e._id]=this.waitingqueue[e._id]?this.waitingqueue[e._id]:[];this.waitingqueue[e._id].push({resourceElem:a,widgetId:b,cb2:c});return;case 1:this._handleLoadedResource(d,b,null,e.status,e.data);return;
- case 2:this._handleLoadedResource(d,b,null,e.status);return}e={};e.type=this.LOADING_TOKEN;e._id=d;e._path=f;this.modules[d]=e;d!=f&&(this.modules[f]=this.modules[d]);a.isCSS()?(this._loadCSS(f),this.modules[d].type=this.LOADED_TOKEN,this.modules[d].status=iwConstants.status.OTHER,this._handleLoadedResource(d,b,null,iwConstants.status.OTHER)):a.isImage()?(this._loadImage(f),this.modules[d].type=this.LOADED_TOKEN,this.modules[d].status=iwConstants.status.OTHER,this._handleLoadedResource(d,b,null,iwConstants.status.OTHER)):
- (a=f,6==dojo.isIE&&0===f.indexOf("/")&&(a=window.location.protocol+"//"+window.location.hostname+":"+window.location.port+f),f=!com.ibm.mashups.enabler.io.XHRMultipartFactory.create().isTransaction(),ibmConfig.dojotest&&(f=!0),dojo.xhrGet({url:a,sync:f,load:function(a,c){var e=null;if(200==c.xhr.status||0===c.xhr.status)e=c.xhr.responseText.replace(/_IWID_/g,"_"+b+"_");k.modules[d].type=k.LOADED_TOKEN;k.modules[d].status=iwConstants.status.SUCCESS;k._handleLoadedResource(d,b,e,iwConstants.status.SUCCESS);
- if(e=k.waitingqueue[d])for(var f=0;f<e.length;f++)k._handleLoadedResource(d,e[f].widgetId,null,iwConstants.status.SUCCESS);k.waitingqueue[d]=null},error:function(a,c){k.modules[d].type=k.LOADING_ERROR_TOKEN;k.modules[d].data=a;k.modules[d].status=c.xhr.status;k._handleLoadedResource(d,b,null,c.xhr.status,a);var e=k.waitingqueue[d];if(e)for(var f=0;f<e.length;f++)k._handleLoadedResource(d,e[f].widgetId,null,c.xhr.status,a);k.waitingqueue[d]=null}}))}},_rewriteUrl:function(a,b,c){return com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel().find(b)._rewriteURI(a,
- c)},_getExtension:function(a){return a.substring(a.lastIndexOf(".")+1,a.length)},_loadCSS:function(a){var b=document.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("href",a);document.getElementsByTagName("head")[0].appendChild(b)},_loadImage:function(){com.ibm.mm.enabler.utils.Misc.preloadImage(url)},_evalCallback:function(a,b,c,d){if(a){if(dojo.isString(a)){var e=com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel().find(b);e&&(e=
- e._getHandlerScope(a))&&(a=dojo.hitch(e,a))}e=c.getGlobalId();c=c.getSrc();d||(d=iwConstants.status.SUCCESS);dojo.isFunction(a)?dojo.partial(a)(e,c,d):(this.callbackQueue[b]=this.callbackQueue[b]?this.callbackQueue[b]:[],this.callbackQueue[b].push({cb:a,id:e,src:c,status:d}))}},_evalFn:function(a){window.execScript?window.execScript(a,"JavaScript"):dojo.eval(a)},_loadedFC:function(a,b,c,d,e){var f=a[iwConstants.RESOURCE.callback];f&&this._evalCallback(f,b,a,e);c&&(a=com.ibm.mashups.enabler.io.XHRMultipartFactory.create(),
- a.suspendTransaction(),d&&e?c(d,e):c(),a.resumeTransaction())},_handleLoadedResource:function(a,b,c,d,e){var f,g=this.evalqueue[b];if(g)if(g[0]&&g[0]._id&&g[0]._id==a){c&&this._evalFn(c);f=g.shift();this._loadedFC(f.resourceElem,b,f.cb2,e,d);for(a=!0;a&&0<g.length;)g[0].isReady?(c&&this._evalFn(c),this._loadedFC(g[0].resourceElem,b,g[0].cb2,g[0].statusData,g[0].status),g.shift()):a=!1}else if(g[0]&&g[0]._id&&g[0]._id!=a)for(b=0;b<g.length;b++)f=g[b],f._id&&f._id==a&&(g[b].contents=c,g[b].isReady=
- !0,g[b].status=d,g[b].statusData=e)}});com.ibm.mashups.services.ServiceManager.setService("resourceLoadService",new com.ibm.mm.iwidget.services.ResourceLoadServiceImpl);dojo.declare("com.ibm.mm.iwidget.parser.WidgetParser",null,{parseWidgetDefinition:function(){return null}});com.ibm.mm.enabler.xslt.ie={};com.ibm.mm.enabler.xslt.gecko={};com.ibm.mm.enabler.xslt.getXmlHttpRequest=function(){var a=null;return a=(typeof window.ActiveXObject != "undefined" || dojo.isIE == 11 || dojo.isIE == 10)?new window.ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest};
- com.ibm.mm.enabler.xslt.loadXml=function(a){return (typeof window.ActiveXObject != "undefined" || dojo.isIE == 11 || dojo.isIE == 10)?com.ibm.mm.enabler.xslt.ie.loadXml(a):com.ibm.mm.enabler.xslt.gecko.loadXml(a)};com.ibm.mm.enabler.xslt.loadXmlString=function(a){return (typeof window.ActiveXObject != "undefined" || dojo.isIE == 11 || dojo.isIE == 10)?com.ibm.mm.enabler.xslt.ie.loadXmlString(a):com.ibm.mm.enabler.xslt.gecko.loadXmlString(a)};com.ibm.mm.enabler.xslt.loadXsl=function(a){return (typeof window.ActiveXObject != "undefined" || dojo.isIE == 11 || dojo.isIE == 10)?com.ibm.mm.enabler.xslt.ie.loadXsl(a):com.ibm.mm.enabler.xslt.gecko.loadXsl(a)};
- com.ibm.mm.enabler.xslt.transform=function(a,b,c,d,e){return (typeof window.ActiveXObject != "undefined" || dojo.isIE == 11 || dojo.isIE == 10)?com.ibm.mm.enabler.xslt.ie.transform(a,b,c,d,e):com.ibm.mm.enabler.xslt.gecko.transform(a,b,c,d,e)};com.ibm.mm.enabler.xslt.transformAndUpdate=function(a,b,c,d,e){(typeof window.ActiveXObject != "undefined" || dojo.isIE == 11 || dojo.isIE == 10)?(b=com.ibm.mm.enabler.xslt.ie.transform(b,c,d,e,!0),a.innerHTML+=b):(b=com.ibm.mm.enabler.xslt.gecko.transform(b,c,d,e,!1),c=b.documentElement,"transformiix:result"==b.documentElement.tagName?com.ibm.mm.enabler.utils.Dom.copyChildren(b.documentElement,
- a,!0):a.appendChild(c))};com.ibm.mm.enabler.xslt.ie.loadXml=function(a){var b=new ActiveXObject("MSXML2.DOMDocument");b.async=0;b.resolveExternals=0;if(!b.load(a))throw Error("Error loading xml file "+a);return b};com.ibm.mm.enabler.xslt.ie.loadXmlString=function(a){var b=new ActiveXObject("MSXML2.DOMDocument");b.async=0;b.resolveExternals=0;if(!b.loadXML(a))throw Error("Error loading xml string "+a);return b};com.ibm.mm.enabler.xslt.ie.loadXsl=function(a){var b=new ActiveXObject("MSXML2.FreeThreadedDOMDocument");
- b.async=0;b.resolveExternals=0;if(!b.load(a))throw Error("Error loading xsl file "+a);return b};com.ibm.mm.enabler.xslt.ie.transform=function(a,b,c,d,e){var f=b;try{f.documentElement||(f=this.loadXsl(b))}catch(g){throw a=g.message,Error(""+a,""+a);}b=new ActiveXObject("Msxml2.XSLTemplate");b.stylesheet=f;b=b.createProcessor();b.input=a;d&&com.ibm.mm.enabler.utils.Misc.forIn(d,function(a,b){this.addParameter(b,a)},b);c&&b.addParameter("mode",c);if(e){if(!b.transform())throw Error("Error transforming xml doc "+
- a);return b.output}c=new ActiveXObject("MSXML2.DOMDocument");c.async=0;c.validateOnParse=1;a.transformNodeToObject(f,c);return c};com.ibm.mm.enabler.xslt.gecko.loadXml=function(){};com.ibm.mm.enabler.xslt.gecko.loadXmlString=function(a){var b=new DOMParser,c;try{c=b.parseFromString(a,"text/xml")}catch(d){throw Error("Error loading xml string "+a);}return c};com.ibm.mm.enabler.xslt.gecko.loadXsl=function(a){var b=document.implementation.createDocument("","",null);b.async=0;b.load(a);return b};com.ibm.mm.enabler.xslt.gecko.transform=
- function(a,b,c,d,e){try{var f=b;f.documentElement||(f=this.loadXsl(b));var g=new XSLTProcessor;g.importStylesheet(f);d&&com.ibm.mm.enabler.utils.Misc.forIn(d,function(a,b){this.setParameter(null,b,a)},g);c&&g.setParameter(null,"mode",c);var m=g.transformToDocument(a);if(!e)return m;resultStr=m.documentElement.childNodes[0].textContent}catch(h){throw Error("Error transforming xml doc "+h);}return resultStr};com.ibm.mm.enabler.xslt.setLayerContentByXml=function(a,b,c,d,e){b=com.ibm.mm.enabler.xslt.transform(b,
- c,null,d,e);a.innerHTML?a.innerHTML=b:document.getElementById(a).innerHTML=b};dojo.declare("com.ibm.mm.iwidget.widget.IWidgetDefinitionLegacyImpl",com.ibm.mashups.iwidget.widget.IWidgetDefinition,{constructor:function(a,b,c,d,e,f,g,h,p,k,n,t){if(dojo.isString(a))this.name=a,this.markup=b,this.iScope=c,this.itemSetsArr=d,this.uri=f,this.widgetEvents=e,this.publishedEvents=h,this.handledEvents=p,this.supportedModes=g,this.resources=k,this.payloadDefs=n,this.iDescriptor=t;else{this.name=a.name;this.markup=
- a.markup;this.metaData=a.metaData;this.events=a.events;this.itemSets=a.itemSets;this.resources=a.resources;this.payloadDefs=a.payloadDefs;this.iScope=this.metaData.iScope;this.supportedModes=this.metaData.supportedModes;this.uri=this.metaData.contentURI;var q;this.widgetEvents={};for(q in this.metaData)0===q.indexOf("on")&&(this.widgetEvents[q]=this.metaData[q]);b=a.events.publishedEvents;this.publishedEvents={};this.handledEvents={};for(var s in b)Object.prototype.hasOwnProperty.call(b,s)&&(q=b[s],
- q=new com.ibm.mm.iwidget.IEventDescriptionImpl(q.eventName,q.payloadType,q.description,q.onEvent),this.publishedEvents[s]||(this.publishedEvents[s]=[]),this.publishedEvents[s].push(q));b=a.events.handledEvents;for(s in b)Object.prototype.hasOwnProperty.call(b,s)&&(q=b[s],q=new com.ibm.mm.iwidget.IEventDescriptionImpl(q.eventName,q.payloadType,q.description,q.onEvent),this.handledEvents[s]||(this.handledEvents[s]=[]),this.handledEvents[s].push(q));var r;this.itemSetsArr={};for(r in a.itemSets)Object.prototype.hasOwnProperty.call(a.itemSets,
- r)&&(s=a.itemSets[r],q=new com.ibm.mm.iwidget.itemset.ItemSetDefaultImpl(s.name,s.onItemSetChanged),q.itemLists.items=s.itemLists,this.itemSetsArr[r]=q)}},_getPublishedEvents:function(){return this.publishedEvents},_getHandledEvents:function(){return this.handledEvents},getPublishedEvents:function(){var a=[],b;for(b in this.publishedEvents)Object.prototype.hasOwnProperty.call(this.publishedEvents,b)&&a.push(this.publishedEvents[b]);return a},getHandledEvents:function(){var a=[],b;for(b in this.handledEvents)Object.prototype.hasOwnProperty.call(this.handledEvents,
- b)&&a.push(this.handledEvents[b]);return a},getAttributes:function(){var a=this.itemSetsArr.attributes;a||(a={name:"attributes",items:{}});"undefined"!=typeof this.uri&&a&&(a.items.contentURI={id:"contentURI",value:this.uri,readOnly:!1});"undefined"!=typeof this.supportedModes&&a&&(a.items.supportedModes={id:"supportedModes",value:this.uri,readOnly:!1});return a},getAllItemSetNames:function(){var a=[];if(!this.itemSetsArr)return a;var b=0,c;for(c in this.itemSetsArr)if(Object.prototype.hasOwnProperty.call(this.itemSetsArr,
- c)){var d=this.itemSetsArr[c];"undefined"!=typeof d&&(a[b]=d.name);b++}return a},getItemSet:function(a){if("attributes"==a)return this.getAttributes();a=this.itemSetsArr[a];return "undefined"!=typeof a?a:null},getPublishedEventsNames:function(){if(!this.publishedEvents)return null;var a=[],b;for(b in this.publishedEvents)Object.prototype.hasOwnProperty.call(this.publishedEvents,b)&&a.push(b);return a},getHandledEventsNames:function(){if(!this.handledEvents)return null;var a=[],b;for(b in this.handledEvents)Object.prototype.hasOwnProperty.call(this.handledEvents,
- b)&&a.push(b);return a},getPublishedEvent:function(a){return!this.publishedEvents?null:this.publishedEvents[a]},getHandledEvent:function(a){return!this.handledEvents?null:this.handledEvents[a]},getWidgetName:function(){return this.name},getPayloadDefs:function(){return this.payloadDefs},getPayloadDef:function(a){a=this.payloadDefs[a];return"undefined"==typeof a?null:a},getPayloadDefNames:function(){var a=[],b;for(b in this.payloadDefs)Object.prototype.hasOwnProperty.call(this.payloadDefs,b)&&a.push(b);
- return a},getSupportedModes:function(){var a=this.supportedModes;return!a?null:a.split(" ")},getIDescriptorItems:function(){return null},getMarkupByMode:function(){return this.markup},getWidgetEvents:function(){return this.widgetEvents},getIScope:function(){return this.iScope},getResources:function(){return this.resources},getDefaultLanguage:function(){return"en"},getMarkup:function(){return this.markup},getAllowInstanceContent:function(){return!1},_getShareableItemSets:function(){return null},_getManagedItemSetListener:function(){return null},
- getXmlBase:function(){return null}});dojo.declare("com.ibm.mm.iwidget.parser.LegacyXMLParser",com.ibm.mm.iwidget.parser.WidgetParser,{constructor:function(a){this.xmlStr=a},namespaces:{iw:"http://www.ibm.com/iWidget"},parseWidgetDefinition:function(){var a=com.ibm.mm.enabler.xslt.loadXmlString(this.xmlStr),b=this.readMarkup(a),c=this.readItemSets(a),d=this.readContentURI(a),e=this.readWidgetEvents(a),f=this.readName(a),g=this.readiScope(a),h=this.readSupportedModes(a),p=this.readPublicEvents(a,"iw:handledEvents"),
- k=this.readPublicEvents(a,"iw:publishedEvents"),n=this.readResources(a),t=this.readPayloadDefs(a),a=this.readIDescriptor(a);return new com.ibm.mm.iwidget.widget.IWidgetDefinitionLegacyImpl(f,b,g,c,e,d,h,k,p,n,t,a)},readMarkup:function(a){var b=com.ibm.mashups.enabler.xml.XPath.evaluateEntry("/iw:iwidget/iw:content",a,this.namespaces),a="";if(b)for(var b=b.childNodes,c=0,d=b.length;c<d;c++){var e=b[c];4==e.nodeType?a=a.concat(e.nodeValue):3==e.nodeType&&(a=a.concat(e.nodeValue))}return a},readSupportedModes:function(a){a=
- a.documentElement.getAttribute("supportedModes");return"undefined"==typeof a||null===a?null:a},readItemSets:function(a){for(var b={},a=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("/iw:iwidget/iw:itemSet",a,this.namespaces),c=0,d=a.length;c<d;c++){for(var e=a[c],f=e.getAttribute("name"),g=e.getAttribute("onItemSetChanged"),g={id:f,onItemSetChanged:g,items:{}},e=e.childNodes,h=0,p=e.length;h<p;h++){var k=e[h];if(1==k.nodeType){var n=k.getAttribute("readOnly"),k={id:k.getAttribute("name"),value:k.getAttribute("value"),
- readOnly:n};g.items[k.id]=k}}b[f]=g}return b},readPayloadDefs:function(a){for(var b={},a=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("/iw:iwidget/iw:payloadDef",a,this.namespaces),c=0,d=a.length;c<d;c++){var e=com.ibm.mm.iwidget.Utils.getPayloadDef(a[c]);b[e.name]=e}return b},readName:function(a){a=a.documentElement.getAttribute("name");return"undefined"==typeof a||null===a?null:a},readContentURI:function(a){a=a.documentElement.getAttribute("contentURI");return"undefined"==typeof a||null===a?
- null:a},readiScope:function(a){a=a.documentElement.getAttribute("iScope");return"undefined"==typeof a||null===a?null:a},readWidgetEvents:function(a){for(var b={},a=a.documentElement.attributes,c=0;c<a.length;c++){var d=a[c];if(0===d.name.indexOf("on")){var e=d.value;"undefined"!=typeof e&&null!==e&&(b[d.name]=e)}}return b},readPublicEvents:function(a,b){var c=com.ibm.mashups.enabler.xml.XPath.evaluateEntry("/iw:iwidget/"+b,a,this.namespaces),d={};c&&dojo.forEach(c.childNodes,function(a){if(1==a.nodeType){var b=
- new com.ibm.mm.iwidget.IEventDescriptionImpl(a.getAttribute("eventName"),a.getAttribute("onEvent"),a.getAttribute("payloadType"),a.getAttribute("description"));d[a.getAttribute("eventName")]=b}},this);return!d?null:d},readResources:function(a){var b=[];(a=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("/iw:iwidget/iw:resource",a,this.namespaces))&&0<a.length&&dojo.forEach(a,function(a){var d={};d.name=a.getAttribute("resourceName");d.src=a.getAttribute("uri");d.version=a.getAttribute("version");
- d.callback=a.getAttribute("callback");d.mimetype=a.getAttribute("mimetype");b[i]=d},this);return b},readIDescriptor:function(){return null}});dojo.declare("com.ibm.mm.iwidget.parser.StandardXMLParser",com.ibm.mm.iwidget.parser.WidgetParser,{constructor:function(a){this.xmlStr=a},namespaces:{iw:"http://www.ibm.com/xmlns/prod/iWidget"},reservedAttributes:{iScope:"iScope",supportedModes:"supportedModes",id:"id",allowInstanceContent:"allowInstanceContent",lang:"lang","xmlns:iw":"xmlns:iw",supportedWindowStates:"supportedWindowStates",
- "xml:lang":"xml:lang","xml:base":"xml:base"},parseWidgetDefinition:function(){var a=com.ibm.mm.enabler.xslt.loadXmlString(this.xmlStr),b=this.readRootElement(a);b.markup=this.readMarkup(a);b.itemSetsArr=this.readItemSets(a,b);b.publicEvents=this.readPublicEvents(a);b.resources=this.readResources(a);var c=this.readPayloadDefs(a);c&&(b.payloadDefs=c);b.eventDescriptions=this.readEventDescriptions(a);b.xmlStr=this.xmlStr;return new com.ibm.mm.iwidget.widget.IWidgetDefinitionImpl(b,this.xmlStr)},readRootElement:function(a){var b=
- {},a=a.documentElement,c=a.getAttribute("supportedModes");c||(c="view");b.supportedModes=c;var d=a.getAttribute("id");d||(d=null);b.id=d;b.name=d;c=a.getAttribute("allowInstanceContent");d=!1;c&&"true"==c&&(d=!0);b.allowInstanceContent=d;(c=a.getAttribute("lang"))||(c=a.getAttribute("xml:lang"));c||(c="en");b.lang=c;var c={},d=a.attributes,e;for(e=0;e<d.length;e++){var f=d[e];if(0===f.name.indexOf("on")){var g=f.value;g&&(c[f.name]=g)}}b.widgetEvents=c;(c=a.getAttribute("iScope"))||(c=null);b.iScope=
- c;e=iwConstants.iDescriptorItems;var f={},h;for(h in e)Object.prototype.hasOwnProperty.call(e,h)&&(d=e[h],c=a.getAttribute(d),f[d]=c);b.iDescriptor=f;h={};d=a.attributes;for(e=0;e<d.length;e++)f=d[e],0!==f.name.indexOf("on")&&(!iwConstants.iDescriptorItems[f.name]&&!this.reservedAttributes[f.name])&&(c=f.value,"undefined"!=typeof c&&null!==c&&(h[f.name]=c));b.simpleAttributes=h;(h=a.getAttribute("supportedWindowStates"))||(h="normal");b.supportedWindowStates=h;if(a=a.getAttribute("xml:base"))b.xmlBase=
- a;return b},readMarkup:function(a){var a=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("/iw:iwidget/iw:content",a,this.namespaces),b={},c="",d=null;if(a&&0<a.length)for(var e=0,f=a.length;e<f;e++){for(var g=a[e],d=g.childNodes,h=0,p=d.length;h<p;h++){var k=d[h];4==k.nodeType?c=c.concat(k.nodeValue):3==k.nodeType&&(c=c.concat(k.nodeValue))}d=g.getAttribute("mode");if(!d)break;uri=g.getAttribute("uri");b[d]={};uri&&(b[d].uri=uri);b[d].content=c;c=""}return b},readItemSets:function(a,b){for(var c=
- {},d={},e=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("/iw:iwidget/iw:itemSet",a,this.namespaces),f=0,g=e.length;f<g;f++){var h=e[f],p=h.getAttribute("id"),k=h.getAttribute("alias")?h.getAttribute("alias"):null;k||(k=h.getAttribute("globalid")?h.getAttribute("globalid"):null);var n=h.getAttribute("onItemSetChanged"),t=h.getAttribute("private"),q=!0;t&&"false"==t&&(q=!1);n={id:p,onItemSetChanged:n,isPrivate:q};k&&(n.alias=k);n.items={};h=h.childNodes;k=0;for(t=h.length;k<t;k++){var s=h[k];if(1==
- s.nodeType){var r=!1,w=s.getAttribute("readOnly");w&&"true"==w&&(r=!0);var w=s.getAttribute("id"),v=s.getAttribute("alias")?s.getAttribute("alias"):null;v||(v=s.getAttribute("globalid")?s.getAttribute("globalid"):null);var x=s.getAttribute("value"),A=s.getAttribute("lang");A||(A=s.getAttribute("xml:lang"));var z={};z.id=w;v&&(z.alias=v);z.readOnly=r;!A&&("undefined"!=typeof x&&null!==x)&&(z.value=x);A&&(z.defaultLocale=A);A&&("undefined"!=typeof x&&null!==x)&&(z.values={},z.values[A]=x);s=s.childNodes;
- if(0<s.length||A&&x){r=0;for(x=s.length;r<x;r++)v=s[r],1==v.nodeType&&((A=v.getAttribute("lang"))||(A=v.getAttribute("xml:lang")),A||(A="en"),v=v.getAttribute("value"),z.values=z.values?z.values:{},z.values[A]=v)}n.items[w]=z}}q?d[p]=n:c[p]=n}b.shareableItemSetsArr=c;return d},readPayloadDefs:function(a){for(var b={},a=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("/iw:iwidget/iw:payloadDef",a,this.namespaces),c=0,d=a.length;c<d;c++){var e=com.ibm.mm.iwidget.Utils.getPayloadDef(a[c]);b[e.name]=
- e}!0===com.ibm.mm.enabler.utils.Misc.isEmpty(b)&&(b=null);return b},readPublicEvents:function(a){var b={};if((a=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("/iw:iwidget/iw:event",a,this.namespaces))&&0!==a.length)for(var c=0,d=a.length;c<d;c++){var e=a[c];if(1==e.nodeType){for(var f={},e=e.attributes,g=0;g<e.length;g++){var h=e[g],p=h.name,h=h.value;"eventDescName"==p&&(p="description");"handled"==p&&(p="isHandled");"published"==p&&(p="isPublished");h&&(f[p]=h)}b[f.id]=f}}return b},readResources:function(a){var b=
- [];if((a=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("/iw:iwidget/iw:resource",a,this.namespaces))&&0!==a.length)for(var c=0,d=a.length;c<d;c++){var e=a[c],f={},g=e.getAttribute("id");g||(g=e.getAttribute("globalid"));f[iwConstants.RESOURCE.id]=g;f[iwConstants.RESOURCE.globalid]=e.getAttribute("globalid")?e.getAttribute("globalid"):null;(g=e.getAttribute("src"))||(g=e.getAttribute("uri"));f[iwConstants.RESOURCE.src]=g;f[iwConstants.RESOURCE.version]=e.getAttribute("version");f[iwConstants.RESOURCE.blockInit]=
- e.getAttribute("blockInit");f[iwConstants.RESOURCE.callback]=e.getAttribute("callback");f[iwConstants.RESOURCE.mimeType]=e.getAttribute("mimeType");f[iwConstants.RESOURCE.skipLoad]=e.getAttribute("skipLoad");if(!f[iwConstants.RESOURCE.skipLoad]){for(var e=e.childNodes,g=null,h=0;h<e.length&&!(g=e[h],1==g.nodeType);h++);if(g){e=g.childNodes;for(g=0;g<e.length;g++)4==e[g].nodeType&&(f[iwConstants.RESOURCE.skipLoad]=e[g].nodeValue)}}b[c]=f}return b},readEventDescriptions:function(a){var b={};if((a=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("iw:iwidget/iw:eventDescription",
- a,this.namespaces))&&0!==a.length)for(var c=0,d=a.length;c<d;c++){var e=a[c],f={},g=e.getAttribute("id");f.id=g;f.payloadType=e.getAttribute("payloadType");f.description=e.getAttribute("description");f.title=e.getAttribute("title");f.descriptionURI=e.getAttribute("descriptionURI");var h=e.getAttribute("lang");h||(h=e.getAttribute("xml:lang"));f.lang=h;f.aliases=e.getAttribute("aliases");f.descriptions={};for(var e=e.childNodes,h=0,p=e.length;h<p;h++){var k=e[h];if(1==k.nodeType){var n={},t=k.getAttribute("lang");
- t||(t=k.getAttribute("xml:lang"));n.description=k.getAttribute("description");n.title=k.getAttribute("title");n.descriptionURI=k.getAttribute("descriptionURI");f.descriptions[t]=n}}b[g]=f}return b}});dojo.declare("com.ibm.mm.iwidget.parser.OpenSocialXMLParser",com.ibm.mm.iwidget.parser.WidgetParser,{constructor:function(a){this.xmlStr=a},namespaces:{},reservedAttributes:{iScope:"iScope",supportedModes:"supportedModes",id:"id",allowInstanceContent:"allowInstanceContent",lang:"lang","xmlns:iw":"xmlns:iw",
- supportedWindowStates:"supportedWindowStates","xml:lang":"xml:lang","xml:base":"xml:base"},parseWidgetDefinition:function(){var a=com.ibm.mm.enabler.xslt.loadXmlString(this.xmlStr),b=this.readRootElement(a);this.readAllChildNodes(a,b);b.publicEvents=this.readPublicEvents(a);b.resources=this.readResources(a);var c=this.readPayloadDefs(a);c&&(b.payloadDefs=c);b.eventDescriptions=this.readEventDescriptions(a);b.xmlStr=this.xmlStr;return new com.ibm.mm.iwidget.widget.IWidgetDefinitionImpl(b,this.xmlStr)},
- readRootElement:function(){var a={supportedModes:"view",id:null,name:null,allowInstanceContent:!1,lang:"en"};a.getType=dojo.hitch(a,function(){return com.ibm.mm.iwidget.Constants.OSGADGET_DEFINITION_TYPE});a.widgetEvents={};a.iScope=null;a.iDescriptor={};a.simpleAttributes={};a.supportedWindowStates="normal";return a},readAllChildNodes:function(a,b){var c=a.documentElement;if(c.children)for(var c=c.children,d=0;d<c.length;d++)c[d].nodeName&&("ModulePrefs"===c[d].nodeName?this.readModulePrefs(c[d],
- b):"UserPref"!==c[d].nodeName&&"Content"===c[d].nodeName&&(b.markup=this.readContent(c[d])))},readContent:function(a){for(var b={},a=a.childNodes,c="",d=0;d<a.length;d++){var e=a[d];4==e.nodeType?c=c.concat(e.nodeValue):3==e.nodeType&&(c=c.concat(e.nodeValue))}b.view={};b.view.content=c;return b},readMarkup:function(){return{}},readItemSets:function(){return{}},readModulePrefs:function(a,b){b.iDescriptor={mode:"view",name:""};var c={};if(a.attributes&&null!==a.attributes)for(var d=a.attributes,e=
- 0;e<d.length;e++)if(d[e]&&d[e].name&&"title"===d[e].name){var f=d[e].name,g={id:"idescriptor",onItemSetChanged:null,isPrivate:!0,items:{}},h=d[e].name,k=d[e].value,n={};n.id=h;n.readOnly=!1;0<=f.indexOf("__MSG_")?n.defaultLocale="en":n.value=k;g.items[h]=n;c.idescriptor=g}b.shareableItemSetsArr={};b.itemSetsArr=c},readPayloadDefs:function(){return{}},readPublicEvents:function(){return{}},readResources:function(){return[]},readEventDescriptions:function(){return{}}});dojo.declare("com.ibm.mm.iwidget.parser.WidgetParserFactory",
- null,{getWidgetParser:function(a){var a=a.replace(/^\s+/,"").replace(/\s+$/,""),b=this._isXML(a),c=this._isLegacy(a),d=this._isOpenSocialGadget(a);return b&&c&&!d?new com.ibm.mm.iwidget.parser.LegacyXMLParser(a):b&&!c&&!d?new com.ibm.mm.iwidget.parser.StandardXMLParser(a):b&&d?new com.ibm.mm.iwidget.parser.OpenSocialXMLParser(a):null},_isOpenSocialGadget:function(a){var b=!0;-1===a.indexOf("<Module>")&&(b=!1);return b},_isXML:function(a){var b=!0;-1!=a.indexOf('="http://www.w3.org/1999/xhtml"')&&
- (b=!1);return b},_isLegacy:function(a){var b=!0;-1!=a.indexOf('="http://www.ibm.com/xmlns/prod/iWidget"')&&(b=!1);return b}});com.ibm.mm.iwidget.parser.WidgetParserFactory=new com.ibm.mm.iwidget.parser.WidgetParserFactory;dojo.declare("com.ibm.mm.iwidget.services.WidgetLoadServiceImpl",null,{constructor:function(){this.widgetDef={};this.LOADING_TOKEN="LOADING_TOKEN";this.LOADING_ERROR_TOKEN="LOADING_ERROR_TOKEN";this.waitingqueue={}},getWidgetXML:function(a,b,c,d){ibmConfig.dojotest&&(b=!0);var e=
- this.widgetDef[a];if(e&&e==this.LOADING_TOKEN)this.waitingqueue[a]||(this.waitingqueue[a]=[]),this.waitingqueue[a].push({id:d,cb:c});else{if(e&&e.error&&e.error==this.LOADING_ERROR_TOKEN)return this.handleCallback(c,e.data,e.status);if(e)return this.handleCallback(c,e,"200");this.widgetDef[a]=this.LOADING_TOKEN;var f=this,d=a;if(0===d.indexOf("http")||0===d.indexOf("https")||0===d.indexOf("endpoint"))d=com.ibm.mm.enabler.utils.URLHelper.rewriteURL(d);dojo.xhrGet({url:d,load:function(b,d){var e=d.xhr,
- h=com.ibm.mm.iwidget.parser.WidgetParserFactory.getWidgetParser(e.responseText).parseWidgetDefinition();f.widgetDef[a]=h;f.handleCallback(c,h,e.status,e);var k=f.waitingqueue[a];if(k){for(var n in k)Object.prototype.hasOwnProperty.call(k,n)&&f.handleCallback(k[n].cb,h,e.status,e);f.waitingqueue[a]=null}},error:function(b,d){var e=d.xhr;f.widgetDef[a]={error:f.LOADING_ERROR_TOKEN,data:b,status:e.status};f.handleCallback(c,b,e.status,e);var h=f.waitingqueue[a];if(h){for(var k in h)Object.prototype.hasOwnProperty.call(h,
- k)&&f.handleCallback(h[k].cb,b,e.status,e);f.waitingqueue[a]=null}},handleAs:"text",sync:b})}},handleCallback:function(a,b,c,d){a&&a(b,c,d)}});com.ibm.mashups.services.ServiceManager.setService("widgetLoadService",new com.ibm.mm.iwidget.services.WidgetLoadServiceImpl);dojo.declare("com.ibm.mashups.iwidget.widget.Wire",null,{constructor:function(){},getSourceWidgetID:function(){},getSourceEventName:function(){},getTargetWidgetID:function(){},getTargetEventName:function(){}});dojo.declare("com.ibm.mm.iwidget.widget.WireImpl",
- com.ibm.mashups.iwidget.widget.Wire,{constructor:function(a,b){b&&(this.SourceWidget=b.SourceWidget,this.SourceEvent=b.SourceEvent,this.TargetEvent=b.TargetEvent);this.TargetWidget=a;this._isDirty=!1;this._type=null},TYPE_NEW:"NEW",TYPE_DELETE:"DELETE",getID:function(){return this.SourceWidget+"_"+this.SourceEvent+"_"+this.TargetWidget+"_"+this.TargetEvent},getSourceWidgetID:function(){return this.SourceWidget},getSourceEventName:function(){return this.SourceEvent},getTargetWidgetID:function(){return this.TargetWidget},
- getTargetEventName:function(){return this.TargetEvent},setDirty:function(a){this._isDirty=a},isDirty:function(){return this._isDirty},setType:function(a){this._type=a},getType:function(){return this._type},setSubHandler:function(a){this._subHandle=a},getSubHandler:function(){return this._subHandle},toString:function(){return this.getID()}});dojo.declare("com.ibm.mm.iwidget.widget.IWidgetWrapperStubImpl",null,{PREFIX_STUB:"_stub_",getID:function(){return this.id},getIWidgetInstance:function(){return this.widgetInstance?
- this.widgetInstance:this.widgetInstance=new com.ibm.mm.iwidget.widget.IWidgetInstanceImpl(this,this.rootElement,this.id)},setIWidgetDefinition:function(a){this.widgetDef=a},getIWidgetDefinition:function(){return this.loaded?new com.ibm.mm.iwidget.DeferredLoadImpl(this.getIWidgetInstance().widgetXMLUrl,this.id,this.widgetDef):new com.ibm.mm.iwidget.DeferredLoadImpl(this.getIWidgetInstance().widgetXMLUrl,this.id)},getMarkup:function(){return new com.ibm.mm.iwidget.DeferredLiveTextUnprocessStubImpl(this)},
- _getInstanceMarkupFromDOM:function(){return this.getIWidgetInstance()._getInstanceMarkup()},_deepFind:function(a,b,c,d){ret=null;for(c=b.getChildren(c);c.hasNext();){var e=c.next();if(b.hasChildren(e))ret=this._deepFind(a,b,e,d);else if(e.getLayoutNodeType()==com.ibm.mashups.enabler.layout.Constants.LAYOUT_CONTROL){var f=a.getWidgetWindow(e).start();if(f&&f.getID()==d)return e}}return ret},_getInstanceMarkup:function(a){if(com.ibm.mashups.enabler.services.IdentificationService.isAlienID(this.id))a(this._getInstanceMarkupFromDOM());
- else{var b=com.ibm.mashups.enabler.services.IdentificationService.isClientID(this.id),c=com.ibm.mashups.enabler.widget.Factory.getWidgetModel(),d=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel(),e=com.ibm.mashups.enabler.model.state.AccessorFactory.getSpaceAccessor(d).getSpaceID(),e=com.ibm.mashups.enabler.model.state.AccessorFactory.getPageAccessor(d,e).getPageID(),d=com.ibm.mashups.enabler.navigation.Factory.getNavigationModel(),e=d.find(e).start(),d=d.getLayoutModel(e),
- e=null;if(e=b?this._deepFind(c,d,d.getRoot().start(),this.id):d.find(this.id).start())b=e.getWidgetBody(),b.setFinishedCallback(a),b.start(!1)}},doRender:function(){try{this._updateTitle();this.getWires();this.subHandler={};this.eventSvr=com.ibm.mashups.services.ServiceManager.getService("eventService");var a=this.eventSvr.subscribeEvent(this.eventSvr.WIDGETEVENT_PREFIX+this.PREFIX_STUB+this.id,this,"handleEvent");this.subHandler[this.PREFIX_STUB+this.id]=[];this.subHandler[this.PREFIX_STUB+this.id].push(a);
- this._getInstanceMarkup(dojo.hitch(this,"doRenderContinue"))}catch(b){}},doRenderContinue:function(a){if(!(null===a||void 0===a)){var b=this._getDefaultMode();b||(b=iwConstants.mode_view);this.currentMode=b;this._handleSaveMode&&this._handleSaveMode();b=document.createElement("div");b.className=this.ns+"Content";this.rootElement.appendChild(b);b=this.rootElement.lastChild;dojo.addClass(b,this.currentMode);b.visibility="hidden";this.windowManager[this.currentMode]={id:this.id,root:b,active:!0,main:!0};
- var c=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel(),c=com.ibm.mashups.enabler.model.state.AccessorFactory.getWidgetAccessor(c,this.id),d=null;c&&(d=c.getWidgetState("cp"));this._createIframe(a,b,this.id,"false",this,d)}},destroy:function(){this.eventSvr._getHubAdapter(this.id).returnSubDomain(this._getSubDomain());var a=this.getIWidgetInstance().getWireModel();if(a)for(var b=a.getWires();0<b.length;)b=b[0].getSourceWidgetID(),a.removeWire(b),this.commit(),
- b=a.getWires();b=null;a&&(b=a.getTargets());if(b){var a=com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel(),c;for(c in b)if(Object.prototype.hasOwnProperty.call(b,c)){var d=a.find(c);d&&(d.getIWidgetInstance().getWireModel().removeWire(this.id),d.commit())}}for(var e in this.subHandler)if(Object.prototype.hasOwnProperty.call(this.subHandler,e))for(var f in this.subHandler[e])Object.prototype.hasOwnProperty.call(this.subHandler[e],f)&&this.eventSvr.unsubscribeEvent(this.subHandler[e][f]);
- this.eventSvr._getHubAdapter(this.id).removeIframeHubContainer(this.id);this.windowManager&&(this.windowManager=null)},update2:function(){},_getParent:function(){this.parent||(this.parent=com.ibm.mm.iwidget.Utils.getWidgetParent(this.rootElement));return this.parent=this.parent||null},_setParent:function(a){this.parent=a},_getPublishedEvents:function(){var a=this.getWidgetPublishedEvents(),b={};if(dojo.isArray(a))for(var c=0,d=a.length;c<d;c++)b[a[c].name]=a[c];return b},_getHandledEvents:function(){var a=
- this.getWidgetHandledEvents(),b={};if(dojo.isArray(a))for(var c=0,d=a.length;c<d;c++)b[a[c].name]=a[c];return b},getWidgetPublishedEvents:function(){var a=this._getPublicEvents();return a?a.getEvents({isPublished:"true"}):null},getWidgetHandledEvents:function(){var a=this._getPublicEvents();return a?a.getEvents({isHandled:"true"}):null},getWires:function(){return this.getIWidgetInstance().getWires()},handleEvent:function(a){var b=a.scope;b?"instance"==b?b=this.getIWidgetInstance():"eventmodel"==b&&
- (b=this._getPublicEvents()):b=this;var c=a.methodname;c&&(b[c]&&dojo.isFunction(b[c]))&&b[c].apply(b,a.params)},_handleOnModeChange:function(a){var b=this.currentMode;if(!a)return!1;dojo.isString(a)&&(a=dojo.fromJson(a));if(!a)return!1;var c=a.newMode||null,d=a.rootElementId||null;if(null!==c&&c==this.currentMode||null===c)return!1;var e={},f=this.windowManager[this.currentMode];if(f&&f.main&&null===d){e.methodname="_handleOnModeChange";e.params=[c];this.eventSvr._publishEvent("widgetevents."+this.id,
- e);var g={};g.id=this.id;g.oldMode=b;g.newMode=c;this.eventSvr._publishEvent(com.ibm.mashups.iwidget.Constants.WIDGET_MODECHANGED,g,this.hubId)}else if(f&&f.main&&null!==d)this._getInstanceMarkup(dojo.hitch(this,function(f){f=this._getInstanceMarkupForMode(f,c);this._createIframe(f,d,this.id+"_"+c,"true",this);b=this.currentMode;this.currentMode=c;this._handleSaveMode&&this._handleSaveMode();this.windowManager[this.currentMode]={id:this.id+"_"+c,root:d,active:!0,main:!1};e.methodname="_handleOnModeUpdated";
- e.params=[c];this.eventSvr._publishEvent("widgetevents."+this.id,e);dojo.publish(iwConstants.EVENTS.modeChanged,[this.id,b,c]);a={};a.id=this.id;a.oldMode=b;a.newMode=c;this.eventSvr._publishEvent(com.ibm.mashups.iwidget.Constants.WIDGET_MODECHANGED,a,this.hubId)}));else if((f=this.windowManager[c])&&f.main){e={methodname:"_handleOnModeChange"};e.params=[c];try{this.eventSvr._publishEvent("widgetevents."+this.id,e)}catch(h){console.log("catching exception!!!"+h)}this.eventSvr._getHubAdapter(this.id).removeIframeHubContainer(this.id+
- "_"+this.currentMode);try{var g=this.id+"_"+this.currentMode,k;for(k in this.subHandler[g])Object.prototype.hasOwnProperty.call(this.subHandler[g],k)&&this.eventSvr.unsubscribeEvent(this.subHandler[g][k])}catch(n){console.log("IWidgetWrapperStub:_handleOnModeChange unsubscribe exception:"+n)}delete this.windowManager[this.currentMode];b=this.currentMode;this.currentMode=c;this._handleSaveMode&&this._handleSaveMode();dojo.publish(iwConstants.EVENTS.modeChanged,[this.id,b,c]);a={};a.id=this.id;a.oldMode=
- b;a.newMode=c;this.eventSvr._publishEvent(com.ibm.mashups.iwidget.Constants.WIDGET_MODECHANGED,a,this.hubId)}},commit:function(a){var b=this.getIWidgetInstance(),c=b.getAttributes(),d=b.getIDescriptorItems(),b=b.getWireModel(),e={};c&&c._isDirty()&&(e.attributes=c);d&&d._isDirty()&&(e.idescriptors=d);b&&b.isDirty()&&(e.wiremodel=b.toJson());a||this.eventSvr._publishEvent(this.eventSvr.WIDGETEVENT_PREFIX+this.id,{methodname:"_handleDataSync",params:[e]},this.id);c&&c._isDirty()&&(this._writePropertiesToDOM(this,
- "attributes",c),c._setDirty(!1));d&&d._isDirty()&&(this._writePropertiesToDOM(this,"idescriptor",d),d._setDirty(!1));b&&b.isDirty()&&b.commit()},getPublicEvent:function(a){return this._getPublicEvents().find(a)},_getInstanceMarkupForMode:function(a,b){var c=document.createElement("div");c.innerHTML=a;var d=c.firstChild;d.id=this.id;var e=dojo.query("span."+this.ns+'ItemSet[title="'+iwConstants.IDESCRIPTOR+'"]',d),f=null;0===e.length?(f=document.createElement("span"),f.className=this.ns+"ItemSet",
- f.title=iwConstants.IDESCRIPTOR,f.style.display="none",f.style.visibility="hidden",d.appendChild(f)):f=e[0];for(var d=dojo.query("."+this.ns+'Item[href="#mode"]',f),e=0,g=d.length;e<g;e++){var h=d[e];f==h.parentNode&&f.removeChild(h)}d=document.createElement("a");d.className=this.ns+"Item";d.style.visibility="hidden";d.style.display="none";d.href="#mode";d.appendChild(document.createTextNode(b));f.appendChild(d);return c.innerHTML},_createIframe:function(a,b,c,d,e,f){var g=e,h=e.getCSSUrl();e.subHandler[c]=
- [];var k=e.eventSvr.subscribeEvent(e.eventSvr.WIDGETEVENT_PREFIX+c+".onFrameLoaded",null,function(){function b(a){var e=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel(),a={html:a,xml:g.widgetDef.widgetDef,isModal:d,hubId:c,cssUrl:h,navState:e._state};f&&(a.stateData=f);d&&"false"==d||(e=c.slice(0,c.lastIndexOf("_")),e=g.eventSvr._getHubAdapter().getContainer(e,!0).getIframe().id,a.mainframeId=e);g.eventSvr._publishEvent(g.eventSvr.WIDGETEVENT_PREFIX+c+".onWidgetLoading",
- a);a=g.eventSvr.subscribeEvent(com.ibm.mashups.iwidget.Constants.WIDGET_LOADED+"."+c,null,function(){"false"==d&&(g.loaded=!0,dojo.query("> ."+g.ns+"loading",g.rootElement).forEach(function(a){com.ibm.mm.enabler.utils.Dom.destroyNode(a)}),dojo.query("."+g.currentMode,g.rootElement).style({visibility:""}))});g.subHandler[c].push(a);a=g.eventSvr.subscribeEvent(com.ibm.mashups.iwidget.Constants.RESIZE_WIDGET+"."+g.id,g,"handleSizeChanged");g.subHandler[c].push(a)}e.isLoaded()&&d&&"false"==d?(e.loaded=
- !1,e._getInstanceMarkup(b)):b(a)});e.subHandler[c].push(k);var k=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME),n=window.location.protocol,y=window.location.hostname,t=k.getValue(com.ibm.mashups.enabler.services.ConfigConstants.SERVERDOMAIN);t&&"null"!=t&&(y=t);var t=window.location.port,q=window.location.pathname,s=k.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTEXT_ROOT),r=null;0<q.indexOf(s)&&(r=q.slice(0,q.indexOf(s)));
- e._getSubDomain()?(q=e._getSubDomain()+"."+y,k.getValue("sandbox.disable.subdomains")&&(q=y),n=""!=t?n+("//"+q+":"+t):n+("//"+q),r&&(n+=r),n+=k.getValue(com.ibm.mashups.enabler.services.ConfigConstants.CONTEXT_ROOT_ENABLER),e.eventSvr._getHubAdapter().createIframeHubContainer(c,b,n+"/widgetsandbox",d,null,null,dojo.hitch(this,"_onSecurityAlert"))):((b=unescape(e.getIWidgetInstance().getIDescriptorItems().getItemValue("title",dojo.locale)))||(b=e.getID()),k.getValue(com.ibm.mashups.enabler.services.ConfigConstants.SUBDOMAINREUSE),
- b=[],com.ibm.mm.iwidget.Utils.findElementByAttribute("query","> ."+e.ns+"loading",e.rootElement,b,!1),0<b.length&&(aNode=b[0],aNode.innerHTML=""))},_onSecurityAlert:function(a,b){if(b&&"OpenAjax.hub.SecurityAlert.FramePhish"==b){var c=this;setTimeout(function(){c._handleIframeMove(a)},0)}},_handleIframeMove:function(){this.eventSvr._getHubAdapter(this.id).returnSubDomain(this._getSubDomain());var a=this.windowManager[this.currentMode],b=a.id,c=a.root||null;null===c&&(a=this._getDefaultMode()||iwConstants.mode_view,
- a=this.windowManager[a]||null,null!==a&&(c=a.root||null));try{for(var d in this.subHandler[b])Object.prototype.hasOwnProperty.call(this.subHandler[b],d)&&this.eventSvr.unsubscribeEvent(this.subHandler[b][d])}catch(e){}this.eventSvr._getHubAdapter(b).removeIframeHubContainer(b);this._getInstanceMarkup(dojo.hitch(this,function(a){this._createIframe(a,c,b,"false",this)}))},_getSubDomain:function(){this.subDomain||(this.subDomain=this.eventSvr._getHubAdapter().getSubDomain());return this.subDomain},_handleDataSync:function(a){if(a&&
- a.attributes){var b=a.attributes;this._syncModifiableProperties(b,this.getIWidgetInstance().getAttributes());this._syncAttributes(b,this.getAttributes())}a&&a.wiremodel&&this._syncWireModel(a.wiremodel,this.getIWidgetInstance().getWireModel());this.commit(!0)},_syncWireModel:function(a,b){var c=a._wires,d;for(d in c)if(Object.prototype.hasOwnProperty.call(c,d)){var e=c[d];e._isDirty&&e._type&&"NEW"==e._type?b.addWire(e.SourceWidget,e.SourceEvent,e.TargetEvent):e._isDirty&&(e._type&&"DELETE"==e._type)&&
- b.removeWire(e.SourceWidget,e.SourceEvent,e.TargetEvent)}b._targets=a._targets},_syncModifiableProperties:function(a,b){b._updateProperties(a)},_syncAttributes:function(a,b){for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var d=a[c];d._dirty&&("removedItem"==d._change.changeType?b.removeItem(d.id):b.setItemValue(d.id,d.value,d.readOnly))}b.commit()},handleSizeChanged:function(a){var b=this.windowManager[this.currentMode],c=this.id;b.main||(c=this.id+"_"+this.currentMode);b=b.root.childNodes[0];
- if(a.newWidth){var d=parseInt(a.newWidth,10);dojo.style(b,"width",d-5+"px")}a.newHeight&&(d=parseInt(a.newHeight,10),dojo.style(b,"height",d-5+"px"));this.eventSvr._publishEvent(com.ibm.mashups.iwidget.Constants.RESIZE_WIDGET+c,a)},getCSSUrl:function(){var a=this;if(this.themeCSS)return this.themeCSS;dojo.forEach(document.getElementsByTagName("link"),function(b){if(b.href&&-1!=b.href.indexOf("theme.css")){var c=b.href.length-9;b.href.indexOf("theme.css")==c&&(a.themeCSS=b.href)}else b.href&&-1!=b.href.indexOf("theme_rtl.css")&&
- (c=b.href.length-13,b.href.indexOf("theme_rtl.css")==c&&(a.themeCSS=b.href))});return this.themeCSS},_handleOnNavStateChanged:function(a){if(a=a.payload){var b=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel();com.ibm.mashups.enabler.model.state.AccessorFactory.getWidgetAccessor(b,this.id).setWidgetState("cp",a);b.commit().start()}}});dojo.declare("com.ibm.mm.iwidget.RenderController",null,{constructor:function(a){this.widgetwrapper=a;this.widgetXMLUrl=this.widgetwrapper.getIWidgetInstance().widgetXMLUrl;
- this.iwStr=dojo.i18n.getLocalization("com.ibm.mm.enabler","iwStr");this.iwMessages=dojo.i18n.getLocalization("com.ibm.mm.enabler","iwMessages")},render:function(){this._loadWidgetDefinition()},_resourceBaseURL:new dojo.moduleUrl("com.ibm.mm.iwidget","image/"),_setLoading:function(){var a=document.createElement("div");a.className=this.widgetwrapper.ns+"loading";a.innerHTML=ibmConfig&&ibmConfig.loadingHTML?ibmConfig.loadingHTML:ibmConfig&&ibmConfig["loadingHTML.imageURL"]?"<img alt='"+this.iwStr.LOAD+
- "' src='"+ibmConfig["loadingHTML.imageURL"]+"' /> "+this.iwStr.LOAD:"<img alt='"+this.iwStr.LOAD+"' src='"+this._resourceBaseURL+"progress-anim.gif' /> "+this.iwStr.LOAD;this.widgetwrapper.rootElement.appendChild(a)},_loadWidgetDefinition:function(){if(this.widgetwrapper.loaded)return!1;this._setLoading();if(null!==this.widgetXMLUrl)com.ibm.mashups.services.ServiceManager.getService("widgetLoadService").getWidgetXML(this.widgetXMLUrl,!1,dojo.hitch(this,"handleWidgetInfoRetrieved"),this.widgetwrapper.id);
- else return!1;return!0},handleWidgetInfoRetrieved:function(a,b){var c;"200"==b||"0"==b?(this.widgetwrapper.setIWidgetDefinition(a),this.widgetDef=a,c=this.isSandboxed(),7>dojo.isIE&&c?(c=unescape(this.widgetwrapper.getIWidgetInstance().getIDescriptorItems().getItemValue("title",dojo.locale)),c||(c=this.widgetXMLUrl),this._handleInlineMessage("error",dojo.string.substitute(this.iwMessages.E_NODISPLAY_UNSECUREWIDGET_1,[c]))):this._doRender(c)):this._isWidgetInstalled()?(c=unescape(this.widgetwrapper.getIWidgetInstance().getIDescriptorItems().getItemValue("title",
- dojo.locale)),c||(c=this.widgetXMLUrl),this._handleInlineMessage("error",dojo.string.substitute(this.iwMessages.E_IWIDGETDEF_NOTAVAILABLE_1,[c]),a.message)):this._handleInlineWidgetNotInstalledMessage(this.iwStr.WIDGET_NOT_INSTALLED,this.iwStr.WIDGET_NOT_INSTALLED_SUB,a.message)},_isWidgetInstalled:function(){try{var a=com.ibm.mashups.enabler.catalog.Factory.getCatalogCategoryModel();a.setStrategy(new com.ibm.mashups.enabler.strategy.ListLoadAheadStrategy(25));for(var b=null,c=a.getRoot().start(),
- d=a.getChildren(c);d.hasNext();){var e=d.next(),b=a.getCatalogEntryModel(e),f=b.iterator();for(f.setCursorPosition(0);f.hasNext();){var g=f.next();if(0<=decodeURIComponent(this.widgetXMLUrl).indexOf(g.getDefinitionURL(!1)))return!0}}}catch(h){return!0}return!1},isSandboxed:function(){var a=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.SANDBOXENABLED);if(!a)return!1;var a=!1,
- b=this.widgetDef.getAttributes()||null;b&&(b=b.getItemValue("sandbox"),"undefined"!=typeof b&&null!==b&&"true"==b&&(a=!0));a||null!==this.widgetwrapper.rootElement.getAttribute("sandbox")&&"true"==this.widgetwrapper.rootElement.getAttribute("sandbox")&&(a=!0);a||0<this.widgetwrapper.rootElement.className.indexOf(iwConstants.CSSCLASS_INSTANCE.iwSandbox)&&(a=!0);a&&this._isSandboxDisabledWidget(this.widgetXMLUrl)&&(a=!1);return a},_isSandboxDisabledWidget:function(a){var b=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.WIDGETDEFID_SANDBOX_DISABLED),
- c=b;dojo.isString(c)&&(c=[b]);if(0===c.length)return!1;for(b=0;b<c.length;b++){if(dojo.string.trim(a)===dojo.string.trim(c[b])||-1!=dojo.string.trim(a).indexOf(dojo.string.trim(c[b]))&&0!==dojo.string.trim(c[b]).indexOf("/"))return!0;if(-1!=dojo.string.trim(a).indexOf(dojo.string.trim(c[b]))&&0===dojo.string.trim(c[b]).indexOf("/")&&-1!=dojo.string.trim(a).indexOf(":")){var d=a.split("//"),e=d[0],d=d[1].split("/")[0];if(e==window.location.protocol&&window.location.host==d)return!0;if(e==window.location.protocol&&
- "http:"==e&&0===d.indexOf(window.location.host)){if("80"==d.substr(d.indexOf(":")+1))return!0}else if(e==window.location.protocol&&("https:"==e&&0===d.indexOf(window.location.host))&&"443"==d.substr(d.indexOf(":")+1))return!0}}return!1},_handleInlineMessage:function(){var a=[];com.ibm.mm.iwidget.Utils.findElementByAttribute("query","> ."+this.widgetwrapper.ns+"loading",this.widgetwrapper.rootElement,a,!1);a[0].innerHTML=""},_handleInlineWidgetNotInstalledMessage:function(a,b){var c=[];com.ibm.mm.iwidget.Utils.findElementByAttribute("query",
- "> ."+this.widgetwrapper.ns+"loading",this.widgetwrapper.rootElement,c,!1);var c=c[0],d=[];d[d.length]='<div style="margin:15px">';d[d.length]='<div class="widgetNotInstalledImage">';d[d.length]="</div>";d[d.length]='<div class="widgetNotInstalledText">';d[d.length]=a;d[d.length]="</div>";b&&0<b.length&&(d[d.length]='<div class="widgetNotInstalledSubText">',d[d.length]=b,d[d.length]="</div>");d[d.length]="</div>";c.innerHTML=d.join("")},_doRender:function(a){var b=com.ibm.mashups.services.ServiceManager.getService("eventService");
- a?dojo.mixin(this.widgetwrapper,new com.ibm.mm.iwidget.widget.IWidgetWrapperStubImpl):(b._getHubAdapter().createInlineHubContainer(this.widgetwrapper.id),b._getHubAdapter().createInlineHubClient(this.widgetwrapper.id));this.widgetwrapper.doRender()}});dojo.declare("com.ibm.mm.iwidget.model.WidgetModelExtendedImpl",com.ibm.mm.iwidget.model.WidgetModelDefaultImpl,{_onWindowUnload:function(){var a=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel();a&&com.ibm.mashups.enabler.model.state.AccessorFactory.getPageModeAccessor(a).setPageMode("unload");
- try{for(var b in this.widgetArr)Object.prototype.hasOwnProperty.call(this.widgetArr,b)&&this._unloadWidget(b)}catch(c){console.log("_onWindowUnload "+c.message)}},renderWidget:function(a){"undefined"!=typeof a&&(!a.loaded&&!a.loading)&&(a.loading=!0,(new com.ibm.mm.iwidget.RenderController(a)).render())},getWidgetById:function(a){return this.find(a)}});com.ibm.mm.iwidget.model.WidgetModelImpl=com.ibm.mm.iwidget.model.WidgetModelExtendedImpl;dojo.declare("com.ibm.mm.iwidget.services.EventServiceExtendedImpl",
- com.ibm.mm.iwidget.services.EventServiceDefaultImpl,{registerExtServices:function(){var a=this;this.subscribeEvent(com.ibm.mashups.iwidget.Constants.WIDGET_WINDOWSTATECHANGED,null,function(b){a.fireEvent(b.id,"onWindowStateChanged",{newWindowState:b.newWindowState,oldWindowState:b.oldWindowState})},null,null)},subscribeWire:function(a,b,c,d){function e(b,e){h.fireEvent(c,d,e.payload,e.payloadType,a)}function f(e,f){f||console.log("eventService.subscribeWire subscribe failed source:"+a+" sourceEvent:"+
- b+" targetWidget:"+c+" targetEvent:"+d)}if("undefined"==typeof a||null===a||"undefined"==typeof b||null===b||"undefined"==typeof c||null===c||"undefined"==typeof d||null===d)return!1;var g=!0,h=this,k,n=this.hubAdapter._getInlineHubClient(c);if(n){k=this._generateWireId(a,b,c,d);if(this.subMgr[k])return!0;n=n.subscribe(this.WIDGETEVENT_PREFIX+a+"."+b,e,null,f);this.subMgr[k]=n;k={};k.targetWidget=c;k.sourceEvent=b;k.sourceWidget=a;k.targetEvent=d;this.fireEvent(a,"onNewWire",k)}this.hubAdapter.isInlineClient(c)||
- (k={methodname:"subscribeWire"},k.sourceWidget=a,k.sourceEvent=b,k.targetWidget=c,k.targetEvent=d,k.hubclient="main",this._publishEvent("eventservice."+c,k),g=!0);return g},publishWire:function(a,b,c,d){c=this._serializePayload(c);if("undefined"==typeof a||null===a||"undefined"==typeof b||null===b)return!1;var e=this.hubAdapter._getInlineHubClient(a);e&&e.publish(this.WIDGETEVENT_PREFIX+a+"."+b,{payload:c,payloadType:d});return!0},_serializePayload:function(a){"object"==typeof a&&a.toJson&&(a=a.toJson());
- return a},unSubscribeWire:function(a,b,c,d){if("undefined"==typeof a||null===a||"undefined"==typeof b||null===b||"undefined"==typeof c||null===c||"undefined"==typeof d||null===d)return!1;var e;if(this.hubAdapter._getInlineHubClient(c)){e=this._generateWireId(a,b,c,d);var f=this.subMgr[e];f&&(this.unsubscribeEvent(f,c),delete this.subMgr[e]);e={};e.targetWidget=c;e.targetEvent=d;e.sourceWidget=a;e.sourceEvent=b;this.fireEvent(c,"onRemoveWire",e);this.fireEvent(a,"onRemoveWire",e);this.publishEvent(iwConstants.EVENTS.unSubscribeWire,
- {wires:[e]})}this.hubAdapter.isInlineClient(c)||(e={methodname:"unSubscribeWire"},e.sourceWidget=a,e.sourceEvent=b,e.targetWidget=c,e.targetEvent=d,e.hubclient="main",this._publishEvent("eventservice."+c,e),rc=!0);return!0},addWire:function(a,b,c,d){if("undefined"==typeof a||null===a||"undefined"==typeof b||null===b||"undefined"==typeof c||null===c||"undefined"==typeof d||null===d)return!1;var e=!1;if(this.hubAdapter.isInlineClient(c)){if(e=this.subscribeWire(a,b,c,d)){var f=com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel().getWidgetById(c);
- if("undefined"!=typeof f&&null!==f){var g={};g.SourceWidget=a;g.SourceEvent=b;g.TargetEvent=d;f=f.getIWidgetInstance();g=new com.ibm.mm.iwidget.widget.WireImpl(c,g);f._addWire(g)}}}else e="eventservice."+c,g={methodname:"addWire"},g.params=arguments,g.hubclient="main",this._publishEvent(e,g),e=!0;return e},removeWire:function(a,b,c,d){if("undefined"==typeof a||null===a||"undefined"==typeof b||null===b||"undefined"==typeof c||null===c||"undefined"==typeof d||null===d)return!1;var e=!1;if(this.hubAdapter.isInlineClient(c)){if(e=
- this.unSubscribeWire(a,b,c,d)){var f=com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel().getWidgetById(c);if("undefined"!=typeof f&&null!==f){var g={};g.SourceWidget=a;g.SourceEvent=b;g.TargetEvent=d;f=f.getIWidgetInstance();g=new com.ibm.mm.iwidget.widget.WireImpl(c,g);f._removeWire(g.getID())}}}else e="eventservice."+c,g={methodname:"removeWire"},g.params=arguments,g.hubclient="main",this._publishEvent(e,g),e=!0;return e}});ibmConfig.insideSandbox||com.ibm.mashups.services.ServiceManager.setService("eventService",
- "com.ibm.mm.iwidget.services.EventServiceExtendedImpl");ibmConfig.enablerLayerModules&&0<=dojo.indexOf(ibmConfig.enablerLayerModules,"CoreModel")&&dojo.require("com.ibm.mm.enabler.iwidget.services.EventServiceModel");dojo.declare("com.ibm.mm.iwidget.services.IFrameEventServiceImpl",com.ibm.mashups.iwidget.services.EventService,{constructor:function(){this.subMgr={};this.eventQueue=[];this._hubClient=null;this.getHubClient()},getType:function(){return com.ibm.mm.iwidget.Constants.eventservice.type.IFRAME},
- PREFIX_IFRAME:"_iframe_",getHubClient:function(){if(this._hubClient)return this._hubClient;var a=this;(new OpenAjax.hub.IframeHubClient({HubClient:{onSecurityAlert:function(){}}})).connect(function(b){var c=b.getClientID(),c=c.slice(8);a.setId(c);a._hubClient=b;a._subscribeEventService();for(var d in a.eventQueue)Object.prototype.hasOwnProperty.call(a.eventQueue,d)&&(b=a.eventQueue[d],b[0]="widgetevents."+c+b[0],a._subscribeEvent.apply(a,b))});return null},disconnectHubClient:function(){this._hubClient&&
- (this._hubClient.disconnect(),this._hubClient=null)},setId:function(a){this.id=a},getId:function(){return this.id},_subscribeEventService:function(){var a=this;this._hubClient.subscribe("eventservice."+this.getId(),function(b,c){var d=c.methodname;"subscribeWire"==d||"unSubscribeWire"==d?(d=a[c.methodname])&&d.apply(a,[c.sourceWidget,c.sourceEvent,c.targetWidget,c.targetEvent]):d&&(d=a[c.methodname])&&d.apply(a,c.params)},this,this._subscribeCallback)},_subscribeCallback:function(){},WIDGETEVENT_PREFIX:iwConstants.WIDGETEVENT_PREFIX,
- WILDCARD_PREFIX:iwConstants.WILDCARD_PREFIX,subscribeWire:function(a,b,c,d){if("undefined"==typeof a||null===a||"undefined"==typeof b||null===b||"undefined"==typeof c||null===c||"undefined"==typeof d||null===d)return!1;var e=this,f=this._hubClient.subscribe(this.WIDGETEVENT_PREFIX+a+"."+b,function(b,f){e.fireEvent(c,d,f.payload,f.payloadType,a)},null,function(){}),g=this._generateWireId(a,b,c,d);this.subMgr[g]=f;f={};f.targetWidget=c;f.sourceEvent=b;f.sourceWidget=a;f.targetEvent=d;this.fireEvent(a,
- "onNewWire",f);return!0},publishWire:function(a,b,c,d){c=this._serializePayload(c);if("undefined"==typeof a||null===a||"undefined"==typeof b||null===b)return!1;this._hubClient.publish(this.WIDGETEVENT_PREFIX+a+"."+b,{payload:c,payloadType:d});return!0},_serializePayload:function(a){"object"==typeof a&&a.toJson&&(a=a.toJson());return a},unSubscribeWire:function(a,b,c,d){if("undefined"==typeof a||null===a||"undefined"==typeof b||null===b||"undefined"==typeof c||null===c||"undefined"==typeof d||null===
- d)return!1;var e=this._generateWireId(a,b,c,d),f=this.subMgr[e];f&&(this._unsubscribeEvent(f,d),delete this.subMgr[e]);e={};e.targetWidget=c;e.targetEvent=d;e.sourceWidget=a;e.sourceEvent=b;this.fireEvent(c,"onRemoveWire",e);this.fireEvent(a,"onRemoveWire",e);this._publishEvent(iwConstants.EVENTS.unSubscribeWire,{wires:[e]})},fireEvent:function(a,b,c,d,e){var e=new com.ibm.mm.iwidget.IEventImpl(b,d,c,e),f=com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel().find(a);if("undefined"!=typeof f&&
- null!==f)if(f.isLoaded())f.handleEvent(e);else{var g=dojox.uuid.generateRandomUuid(),a=this._subscribeEvent(com.ibm.mashups.iwidget.Constants.WIDGET_LOADED+"."+f.id,null,dojo.partial(function(a,b,c){b.handleEvent(c);(b=a.subMgr[g])&&a._unsubscribeEvent(b)},this,f,e));this.subMgr[g]=a}else e={methodname:"fireEvent"},e.hubclient=this.getId(),e.params=[a,b,c,d],this._publishEvent("eventservice.main",e)},publishEvent:function(){},_publishEvent:function(a,b){"undefined"==typeof b||null===b?this._hubClient.publish(a,
- ""):this._hubClient.publish(a,b)},broadcastEvent:function(){},broadcastEvents:function(){},_handleBroadcastEventsCache:function(){var a={methodname:"_handleBroadcastEventsCache"};a.hubclient=this.getId();a.params=[];this._publishEvent("eventservice.main",a)},subscribeEvent:function(){},_subscribeEvent:function(a,b,c,d,e){if(this._hubClient)return this._hubClient.subscribe(a,function(a,d){b&&c&&(c=dojo.hitch(b,c));c&&c.apply(this,[d])},null,function(a,c,e){b&&d&&(d=dojo.hitch(b,d));d&&d.apply(this,
- [a,c,e])});this.eventQueue.push(arguments)},_unsubscribeEvent:function(a){a&&this._hubClient.unsubscribe(a)},unsubscribeEvent:function(){},_generateWireId:function(a,b,c,d){return a+"_"+b+"_"+c+"_"+d}});ibmConfig.insideSandbox&&com.ibm.mashups.services.ServiceManager.setService("eventService","com.ibm.mm.iwidget.services.IFrameEventServiceImpl");dojo.declare("com.ibm.mm.iwidget.widget.IWidgetDefinitionExtendedImpl",com.ibm.mm.iwidget.widget.IWidgetDefinitionDefaultImpl,{getResources:function(){this.resources||
- (this.resources=dojo.map(this.widgetDef.resources,function(a){return new com.ibm.mm.iwidget.widget.ResourceImpl(a)}));return this.resources},getPublishedEventsNames:function(){var a=[];this.widgetDef.publicEvents&&com.ibm.mm.enabler.utils.Misc.forIn(this.widgetDef.publicEvents,function(b,c){(!b.isPublished||b.isPublished&&"true"==b.isPublished)&&a.push(c)});return a},getHandledEventsNames:function(){var a=[];this.widgetDef.publicEvents&&com.ibm.mm.enabler.utils.Misc.forIn(this.widgetDef.publicEvents,
- function(b,c){b.onEvent&&a.push(c)});return a},getPublishedEvent:function(a){if(!this.widgetDef.publicEvents)return null;if((a=this.getPublicEvent(a)||null)&&(!a.isPublished||a.isPublished&&"false"==a.isPublished))a=null;return a},getHandledEvent:function(a){if(!this.widgetDef.publicEvents)return null;(a=this.getPublicEvent(a)||null)&&(a.onEvent||(a=null));return a},getPublicEvent:function(a){if(!this.widgetDef.publicEvents)return null;if(this.eventsCache&&this.eventsCache[a])return new com.ibm.mm.iwidget.IEventDescriptionImpl(this.eventsCache[a]);
- var b=this.widgetDef.publicEvents[a],c=null,d={};if(b){d.name=b.id;b.onEvent?(d.handlingFn=b.onEvent,d.isHandled=!0):d.isHandled=!1;d.isPublished=!!b.isPublished;d.attributes={};d.localizedAttributes={};var e=null;com.ibm.mm.enabler.utils.Misc.forIn(b,function(a,b){"description"==b?e=a:"id"!=b&&"onEvent"!=b&&(d.attributes[b]=a)});b=null;if(e&&(b=this._getEventDescription(e)||null))c=b.lang,c||(c=this.getDefaultLanguage())||(c="en"),d.lang=c,b.payloadType&&(d.type=b.payloadType),b.aliases&&(d.attributes.aliases=
- b.aliases),b.descriptions&&(d.localizedAttributes=b.descriptions),"undefined"==typeof d.localizedAttributes[c]&&(d.localizedAttributes[c]={}),b.title&&(d.localizedAttributes[c].title=b.title),b.description&&(d.localizedAttributes[c].description=b.description),b.descriptionURI&&(d.localizedAttributes[c].descriptionURI=b.descriptionURI);this.eventsCache||(this.eventsCache={});this.eventsCache[a]=d;c=new com.ibm.mm.iwidget.IEventDescriptionImpl(d)}return c},_getEventDescription:function(a){var b=null;
- this.widgetDef.eventDescriptions&&(b=this.widgetDef.eventDescriptions[a]);return b},_getPublicEvents:function(){var a={};com.ibm.mm.enabler.utils.Misc.forIn(this.widgetDef.publicEvents,function(b,c){var d=this.getPublicEvent(c)||null;d&&(a[c]=d)},this);return a},getWidgetPublishedEvents:function(){return this.getPublishedEvents()},getWidgetHandledEvents:function(){return this.getHandledEvents()},getPublishedEvents:function(){var a=[];dojo.forEach(this.getPublishedEventsNames(),function(b){(b=this.getPublicEvent(b)||
- null)&&a.push(b)},this);return a},getHandledEvents:function(){var a=[];dojo.forEach(this.getHandledEventsNames(),function(b){(b=this.getPublicEvent(b)||null)&&a.push(b)},this);return a},getPayloadDefs:function(){return this.widgetDef.payloadDefs},getPayloadDef:function(a){a=this.widgetDef.payloadDefs[a];return"undefined"==typeof a?null:a},getPayloadDefNames:function(){var a=[];com.ibm.mm.enabler.utils.Misc.forIn(this.widgetDef.payloadDefs,function(b){a.push(b)});return a},_getShareableItemSets:function(){var a=
- this.widgetDef.shareableItemSetsArr;if(a)for(var b in a)if(Object.prototype.hasOwnProperty.call(a,b))return a;return null},toSpecObject:function(){if(this.specObject)return this.specObject;var a={};if(!this.xmlStr)return a;var b=com.ibm.mm.enabler.xslt.loadXmlString(this.xmlStr);if(b=com.ibm.mashups.enabler.xml.XPath.evaluateEntry("/iw:iwidget",b,this.namespaces)){this._addAttributesToJson(b,a);var c=[];c.push({elementName:"eventDescription",keyNames:["id"]});c.push({elementName:"alt",keyNames:["lang",
- "xml:lang"]});this._addElements(b,c,a);c=[];c.push({elementName:"event",keyNames:["id"]});this._addElements(b,c,a);c=[];c.push({elementName:"itemSet",keyNames:["id"]});c.push({elementName:"item",keyNames:["id"]});c.push({elementName:"alt",keyNames:["lang","xml:lang"]});this._addElements(b,c,a);c=[];c.push({elementName:"resource",keyNames:["uri","src"],elemsAsAtt:["skipLoad"]});this._addElements(b,c,a);c=[];c.push({elementName:"content",keyNames:["mode"]});this._addElements(b,c,a,!0)}return this.specObject=
- a},_addAttributesToJson:function(a,b){dojo.forEach(a.attributes,function(a){b["_"+a.nodeName.replace(":","_")]=a.nodeValue})},_addElements:function(a,b,c,d){if(dojo.isArray(b)&&0!==b.length){var e=b[0].elementName,f=b[0].keyNames,g=b[0].elemsAsAtt,h=null;1<b.length&&(h=b[1].elementName);var k=c[e+"s"]={};(a=com.ibm.mashups.enabler.xml.XPath.evaluateXPath("iw:"+e,a,this.namespaces))&&dojo.forEach(a,function(a){for(var c,e=0,n=f.length;e<n&&!(c=a.getAttribute(f[e]));e++);if(c){var s=k[c]={};this._addAttributesToJson(a,
- s);g&&dojo.forEach(g,function(b){var c="_"+b;if(!(c in s)||!s[c])(b=com.ibm.mashups.enabler.xml.XPath.evaluateEntry("iw:"+b,a,this.namespaces))&&dojo.forEach(b.childNodes,function(a){4==a.nodeType&&a.nodeValue&&(s[c]=a.nodeValue)})},this);h&&(c=b.slice(1),this._addElements(a,c,s));d&&(s.value=dojo.map(a.childNodes||[],function(a){return 4===a.nodeType||3===a.nodeType?a.nodeValue:""}).join(""))}},this)}}});com.ibm.mm.iwidget.widget.IWidgetDefinitionImpl=com.ibm.mm.iwidget.widget.IWidgetDefinitionExtendedImpl;
- dojo.declare("com.ibm.mashups.iwidget.services.WireProviderFactoryService",null,{SERVICE_NAME:"WireProviderFactoryService",createWireProvider:function(){},setFactory:function(){},removeFactory:function(){}});com.ibm.mashups.iwidget.services.WireProviderFactoryService.SERVICE_NAME=com.ibm.mashups.iwidget.services.WireProviderFactoryService.prototype.SERVICE_NAME;dojo.declare("com.ibm.mashups.iwidget.widget.WireProviderFactory",null,{createWireProvider:function(){},getSupportedPersistenceMode:function(){}});
- dojo.declare("com.ibm.mm.iwidget.widget.ModifiableWireModelImpl",null,{constructor:function(a){this._dirty=!1;this._instance=a;this.svc=com.ibm.mashups.services.ServiceManager.getService("eventService")},toJson:function(){var a={};a._dirty=this._dirty;this._wires&&(a._wires=dojo.clone(this._wires));this._targets&&(a._targets=dojo.clone(this._targets));return a},isDirty:function(){return this._dirty},setDirty:function(a){this._dirty=a},registerTargets:function(a,b,c){this._targets||(this._targets=
- {});this._targets[a]||(this._targets[a]=[]);this._targets[a].push({tw:a,te:b,sw:this._instance.id,se:c});this._dirty=!0},getTargets:function(){return!this._targets?null:this._targets},removeTargets:function(a,b,c){this._targets&&(this._targets[a]&&!b&&!c)&&(delete this._targets[a],this._dirty=!0)},_addWire:function(a,b){if(null===(this._findWire(a.getID())||null))this._wires||(this._wires=[]),b&&!0===b||(a.setDirty(!0),a.setType(a.TYPE_NEW),this._dirty=!0),this._wires.push(a),this.svc.subscribeWire(a.SourceWidget,
- a.SourceEvent,this._instance.id,a.TargetEvent)},_removeWire:function(a){var b=this._findWire(a)||null;if(null!==b)for(var c in this._wires)if(typeof this._wires[c].getID === "function" && typeof this._wires[c].setDirty === "function" && typeof this._wires[c].setType === "function" && this._wires[c].getID()==a){this._wires[c].setDirty(!0);this._wires[c].setType(this._wires[c].TYPE_DELETE);this.svc.unSubscribeWire(b.SourceWidget,b.SourceEvent,this._instance.id,b.TargetEvent);this._dirty=!0;break}},addWire:function(a,b,c){var d={};d.SourceWidget=a;d.SourceEvent=b;d.TargetEvent=c;a=new com.ibm.mm.iwidget.widget.WireImpl(this._instance.id,d);
- this._addWire(a)},removeWire:function(a,b,c){var d={},a=a||null,b=b||null,c=c||null;if(null!==a&&null!==b&&null!==c)d.SourceWidget=a,d.SourceEvent=b,d.TargetEvent=c,a=new com.ibm.mm.iwidget.widget.WireImpl(this._instance.id,d),this._removeWire(a.getID());else if(null!==a)for(var e in this._wires)(typeof this._wires[e].getSourceWidgetID === "function" &&this._wires[e].getSourceWidgetID()==a)&&((typeof this._wires[e].setDirty === "function" && this._wires[e].setDirty(!0)),(typeof this._wires[e].setType === "function"&&this._wires[e].setType(this._wires[e].TYPE_DELETE)),b=this._wires[e],this.svc.unSubscribeWire(a,b.SourceEvent,b.TargetWidget,b.TargetEvent),
- this._dirty=!0)},_findWire:function(a){this._wires=this._wires||null;var b=null;if(null!==this._wires)for(var c in this._wires)if(typeof this._wires[c].getID === "function"&&this._wires[c].getID()==a)if(b=this._wires[c],b.isDirty()&&null!==b.getType()&&b.getType()==b.TYPE_DELETE)this._removeFromDOM(b),delete this._wires[c],b=null;else break;return b||null},getWires:function(){this._wires||this._loadWires();var a=[],b;for(b in this._wires)if(Object.prototype.hasOwnProperty.call(this._wires,b)){var c=this._wires[b];!0===c.isDirty()&&null!==c.getType()&&
- c.getType()==c.TYPE_DELETE||a.push(c)}return a},_loadWires:function(){this._wires=[];var a=this._instance.ns,b=[];com.ibm.mm.iwidget.Utils.findElementByAttribute("query","> ."+a+"ReceivedEvent",this._instance.rootElement,b,!0);for(var c=["SourceWidget","SourceEvent","TargetEvent"],d=["SourceEvent","TargetEvent"],e=0;e<b.length;e++){for(var f=b[e],g={},h=!0,k=0;2>k;k++){var n=[];com.ibm.mm.iwidget.Utils.findElementByAttribute("query","> ."+a+d[k],f,n,!1);if(0===n.length)h=!1;else if(0===k){var y=n[0].getAttribute("href")||
- null;if(null!==y){var t=y.indexOf("#");-1!=t&&(y=y.substring(t+1));g[c[0]]=y;g[c[1]]=n[0].innerHTML}}else g[c[2]]=n[0].innerHTML}h&&this._addWire(new com.ibm.mm.iwidget.widget.WireImpl(this._instance.id,g),!0)}},commit:function(){if(!0===this.isDirty()){for(var a in this._wires)if(Object.prototype.hasOwnProperty.call(this._wires,a)){var b=this._wires[a];b.isDirty()&&null!==b.getType()&&b.getType()==b.TYPE_NEW?(this._addToDOM(b),b.setDirty(!1),b.setType(null)):b.isDirty()&&(null!==b.getType()&&b.getType()==
- b.TYPE_DELETE)&&(this._removeFromDOM(b),this._wires.splice(a,1))}this.setDirty(!1)}},_addToDOM:function(a){var b=a.getSourceWidgetID(),c=a.getSourceEventName(),a=a.getTargetEventName(),d=document.createElement("span");d.className=this._instance.ns+"ReceivedEvent";var e=document.createElement("a");e.className=this._instance.ns+"SourceEvent";e.setAttribute("href","#"+b);e.innerHTML=c;b=document.createElement("span");b.className=this._instance.ns+"TargetEvent";b.innerHTML=a;d.appendChild(e);d.appendChild(b);
- this._instance.rootElement.appendChild(d)},_removeFromDOM:function(a){for(var b=a.getSourceWidgetID(),c=a.getSourceEventName(),a=a.getTargetEventName(),d=dojo.query("."+this._instance.ns+"ReceivedEvent",this._instance.rootElement),e=com.ibm.mashups.services.ServiceManager.getService("iwidgetFragmentService"),f=0;f<d.length;f++){var g=d[f],h=dojo.query("."+this._instance.ns+"SourceEvent",g)[0],k=h.innerHTML,n=dojo.query("."+this._instance.ns+"TargetEvent",g)[0];if(e.getKeyFromHref(h)==b&&k==c&&n.innerHTML==
- a){dojo.destroy(g);break}}}});dojo.declare("com.ibm.mm.iwidget.widget.DOMWireProviderFactoryImpl",com.ibm.mashups.iwidget.widget.WireProviderFactory,{constructor:function(){this.modes=["DOM"]},createWireProvider:function(a){return new com.ibm.mm.iwidget.widget.ModifiableWireModelImpl(a)},getSupportedPersistenceMode:function(){return this.modes}});dojo.declare("com.ibm.mm.iwidget.services.WireProviderFactoryServiceImpl",com.ibm.mashups.iwidget.services.WireProviderFactoryService,{constructor:function(){this._factories=
- {}},createWireProvider:function(a,b){b&&com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.iwidget.services.ContainerService.SERVICE_NAME).registerOnChangeListener(com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_WIRES,b);var c,d=a.id;c=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.iwidget.services.ContainerService.SERVICE_NAME).getPersistenceMode(com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_WIRES);if(dojo.hasClass(a.rootElement,com.ibm.mm.iwidget.services.WireProviderFactoryServiceImpl.STANDALONE_CLASS)||
- !c)c=com.ibm.mm.iwidget.services.WireProviderFactoryServiceImpl.DEFAULT_PERSISTENCE;if("undefined"!==typeof c&&c==com.ibm.mashups.enabler.widget.Constants.PERSISTENCE_MODE_MODEL){var e=com.ibm.mashups.enabler.widget.Factory.getWidgetModel(),f=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel(),f=com.ibm.mashups.enabler.model.state.AccessorFactory.getPageAccessor(f,_cc9).getPageID(),d=com.ibm.mm.iwidget.Utils.getModelID(d);e.findWidgetWindow(d,f).start()||(c=com.ibm.mm.iwidget.services.WireProviderFactoryServiceImpl.DEFAULT_PERSISTENCE,
- this.widgetWrapper&&dojo.isFunction(this.widgetWrapper._getResourceBundle)&&this.widgetWrapper._getResourceBundle())}return!(c in this._factories)?null:this._factories[c].createWireProvider(a,c)},setFactory:function(a,b){this._factories[a]=b},removeFactory:function(a){a in this._factories&&delete this._factories[a]}});com.ibm.mm.iwidget.services.WireProviderFactoryServiceImpl.DEFAULT_PERSISTENCE=com.ibm.mashups.enabler.widget.Constants.PERSISTENCE_MODE_DOM;com.ibm.mm.iwidget.services.WireProviderFactoryServiceImpl.STANDALONE_CLASS=
- com.ibm.mm.iwidget.Constants.CSSCLASS_PREFIXED_INSTANCE.iwStandalone;com.ibm.mashups.services.ServiceManager.setService(com.ibm.mashups.iwidget.services.WireProviderFactoryService.SERVICE_NAME,new com.ibm.mm.iwidget.services.WireProviderFactoryServiceImpl);com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.iwidget.services.WireProviderFactoryService.SERVICE_NAME).setFactory(com.ibm.mashups.enabler.widget.Constants.PERSISTENCE_MODE_DOM,new com.ibm.mm.iwidget.widget.DOMWireProviderFactoryImpl);
- dojo.declare("com.ibm.mm.iwidget.widget.IWidgetInstanceExtendedImpl",com.ibm.mm.iwidget.widget.IWidgetInstanceDefaultImpl,{_addWire:function(a){return this.getWireModel()._addWire(a)},_removeWire:function(a){return this.getWireModel()._removeWire(a)},addWire:function(a,b,c){return this.getWireModel().addWire(a,b,c)},removeWire:function(a,b,c){return this.getWireModel().removeWire(a,b,c)},getWires:function(){return this.getWireModel().getWires()},getWireModel:function(){this.wiremodel||(this.wiremodel=
- com.ibm.mashups.services.ServiceManager.getService("WireProviderFactoryService").createWireProvider(this,{context:this,callback:"_wireProviderModeChange",unregister:function(a){this.wrapper.unregisterArray.push(a)}}));return this.wiremodel},_wireProviderModeChange:function(){var a=null;this.wiremodel&&(a=this.wiremodel.getTargets());this.wiremodel=com.ibm.mashups.services.ServiceManager.getService("WireProviderFactoryService").createWireProvider(this);if(a)for(var b in a)for(var c=a[b],d=0,e=c.length;d<
- e;d++)this.wiremodel.registerTargets(c[d].tw,c[d].te,c[d].se);this.getWires()},_getPublicEvents:function(){if(!this.events){this.events={};var a=[];com.ibm.mm.iwidget.Utils.findElementByAttribute("query","> ."+this.ns+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwEvent,this.rootElement,a,!0);var b=[];com.ibm.mm.iwidget.Utils.findElementByAttribute("query","> ."+this.ns+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwEventDescription,this.rootElement,b,!0);if(0<a.length)for(var c=0;c<a.length;c++){var d=
- a[c],e=this._getEventDescription(d,b),d=d.getAttribute("title");this.events[d]=e}}return this.events},_getEventDescription:function(a,b){var c=a.getAttribute("title"),d=dojo.query("> ."+this.ns+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwDescRef,a),e=null;d&&(e=d[0]);var f=null;e&&(f=e.getAttribute("href"),0===f.indexOf("#")&&(f=f.slice(1),f=unescape(f)));for(var d=null,g=0;g<b.length;g++){var h=b[g];if(h.getAttribute("title")==f){d=h;break}}var k={};k.name=c;c=e.innerHTML;if(c=c.replace(/^\s*/,
- "").replace(/\s*$/,""))k.alias=c;c=a.className;0<c.indexOf(this.ns+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwPublished)&&(k.isPublished=!0);0<c.indexOf(this.ns+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwHandled)&&(k.isHandled=!0);c=[];c.push(this.ns+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwHandler);c.push(this.ns+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwNewWire);c.push(this.ns+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwRemoveWire);for(e=0;e<c.length;e++)if(f=dojo.query("> ."+
- c[e],a))if(f=f[0])switch(e){case 0:k.handlingFn=f.innerHTML;break;case 1:k.attributes=k.attributes?k.attributes:{};k.attributes.onNewWire=f.innerHTML;break;case 2:k.attributes=k.attributes?k.attributes:{},k.attributes.onRemoveWire=f.innerHTML}if(d){if((c=dojo.query("> ."+(this.ns+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwPayloadType),d))&&c[0])k.type=c[0].innerHTML.replace(/^\s*/,"").replace(/\s*$/,"");k.localizedAttributes={};c=this.ns+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwValue;
- (e=dojo.query("> ."+(this.ns+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwTitle),d))&&e[0]&&dojo.query("> ."+c,e[0]).forEach(function(a){var b=a.getAttribute("lang"),a=a.innerHTML.replace(/^\s*/,"").replace(/\s*$/,"");k.localizedAttributes[b]||(k.localizedAttributes[b]={});k.localizedAttributes[b].title=a});e=this.ns+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwDescription;c=this.ns+com.ibm.mm.iwidget.Constants.CSSCLASS_INSTANCE.iwValue;(d=dojo.query("> ."+e,d))&&d[0]&&dojo.query("> ."+c,
- d[0]).forEach(function(a){var b=a.getAttribute("lang"),a=a.innerHTML.replace(/^\s*/,"").replace(/\s*$/,"");k.localizedAttributes[b]||(k.localizedAttributes[b]={});k.localizedAttributes[b].description=a})}return new com.ibm.mm.iwidget.IEventDescriptionImpl(k)}});com.ibm.mm.iwidget.widget.IWidgetInstanceImpl=com.ibm.mm.iwidget.widget.IWidgetInstanceExtendedImpl;dojo.declare("com.ibm.mashups.iwidget.services.WidgetEventModelFactoryService",null,{SERVICE_NAME:"WidgetEventModelFactoryService",createEventModel:function(){},
- setFactory:function(){},removeFactory:function(){}});com.ibm.mashups.iwidget.services.WidgetEventModelFactoryService.SERVICE_NAME=com.ibm.mashups.iwidget.services.WidgetEventModelFactoryService.prototype.SERVICE_NAME;dojo.declare("com.ibm.mashups.iwidget.model.EventModelFactory",null,{createEventModel:function(){},getSupportedPersistenceMode:function(){}});dojo.declare("com.ibm.mashups.iwidget.model.EventModel",null,{constructor:function(a){this.wrapper=a},find:function(){return null},eventExists:function(){return!1},
- createEvent:function(){return null},removeEvent:function(){},isUpdateEventRequired:function(){},updateEvent:function(){},getEvents:function(){}});dojo.declare("com.ibm.mm.enabler.utils.EventModelHelperImpl",null,{_PredefinedFields:{alias:"alias",name:"name",type:"type",lang:"lang",isPublished:"isPublished",isHandled:"isHandled",handlingFn:"handlingFn"},checkMatch:function(a,b){var c=!0,d,e;for(e in b)if(Object.prototype.hasOwnProperty.call(b,e)&&b[e])if("undefined"!=typeof this._PredefinedFields[e])if(e==
- this._PredefinedFields.isPublished&&(!0===b[e]||"true"==b[e])){if(d=a.isPublished,!d||!(!0===d||"true"==d)){c=!1;break}}else if(e==this._PredefinedFields.isPublished&&("false"==b[e]||!1===b[e])){if(d=a.isPublished,!d||!(!1===d||"false"==d)){c=!1;break}}else if(e==this._PredefinedFields.isPublished&&("false"==b[e]||!1===b[e])){if(!this._checkBoolean(dojo.toJson(a),e,"false")){c=!1;break}}else if(e==this._PredefinedFields.isHandled&&(!0===b[e]||"true"==b[e])){if(!a[this._PredefinedFields.handlingFn]){c=
- !1;break}}else if(e==this._PredefinedFields.isHandled&&("false"==b[e]||!1===b[e])){if(a[this._PredefinedFields.handlingFn]){c=!1;break}}else{if(!(a[e]&&a[e]==b[e])){c=!1;break}}else if(!a.attributes||!(a.attributes[e]&&a.attributes[e]==b[e])){c=!1;break}return c},_checkBoolean:function(a,b,c){return-1!=a.indexOf('"'+b+'":'+c)?!0:-1!=a.indexOf('"'+b+'":"'+c+'"')?!0:!1}});dojo.declare("com.ibm.mashups.enabler.utils.EventModelHelper",null,{});com.ibm.mashups.enabler.utils.EventModelHelper=new com.ibm.mm.enabler.utils.EventModelHelperImpl;
- dojo.declare("com.ibm.mm.iwidget.model.DOMEventModelImpl",com.ibm.mashups.iwidget.model.EventModel,{constructor:function(a){this.wrapper=a;this.eventDescriptionPool={};var b=a.widgetDef._getPublicEvents(),a=a.getIWidgetInstance()._getPublicEvents(),b=b?b:null;if(a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);if(b){c={};for(var d in b)Object.prototype.hasOwnProperty.call(b,d)&&(c[d]=b[d]);this.eventDescriptionPool=c}},find:function(a){var b=this.eventDescriptionPool[a];return b?
- b:this.wrapper.handledEvents&&this.wrapper.handledEvents[a]?this.wrapper.handledEvents[a][0]:this.wrapper.publishedEvents&&this.wrapper.publishedEvents[a]?this.wrapper.publishedEvents[a][0]:null},eventExists:function(a){return this.eventDescriptionPool[a]?!0:!1},_getEventDescObj:function(a){var b=a,c=a.declaredClass;if("undefined"==typeof c||null===c)b=new com.ibm.mm.iwidget.IEventDescriptionImpl(a);return b},createEvent:function(a){a=this._getEventDescObj(a);if(this.eventExists(a.name))return!1;
- this.eventDescriptionPool[a.name]=a;return!0},removeEvent:function(a){this.eventExists(a)&&delete this.eventDescriptionPool[a];return!0},removeEvents:function(a){for(var b=0;b<a.length;b++)this.removeEvent(a[b]);return!0},isUpdateEventRequired:function(a){a=this._getEventDescObj(a);if(this.eventExists(a.name)){var b=this.eventDescriptionPool[a.name],c=b.type||"",c=-1==c.indexOf("}")?c:c.substring(c.indexOf("}")+1),d=a.type||"",d=-1==d.indexOf("}")?d:d.substring(d.indexOf("}")+1);return b.alias!=a.alias||
- b.name!=a.name||c!=d||b.isHandled!=a.isHandled||b.isPublished!=a.isPublished?!0:!1}return!0},updateEvent:function(a){a=this._getEventDescObj(a);if(this.eventExists(a.name))this.eventDescriptionPool[a.name]=a;else return!1;return!0},setEvents:function(a){for(var b=!0,c=0;c<a.length;c++){var d=a[c],e=this.createEvent(d),e=e||!1;!1===e&&(e=this.updateEvent(d));e=e||!1;!0===b&&(b=e)}return b},getEvents:function(a){if("undefined"==typeof a||null===a)return this._getEventsInArray(this.eventDescriptionPool);
- var b=[];a.isHandled&&"true"==a.isHandled&&this.wrapper.handledEvents&&this._addEvents(b,this.wrapper.handledEvents);a.isPublished&&"true"==a.isPublished&&this.wrapper.publishedEvents&&this._addEvents(b,this.wrapper.publishedEvents);if(dojo.isString(a))try{a=dojo.fromJson(a)}catch(c){return null}for(var d in this.eventDescriptionPool)if(Object.prototype.hasOwnProperty.call(this.eventDescriptionPool,d)){var e=this.eventDescriptionPool[d];com.ibm.mashups.enabler.utils.EventModelHelper.checkMatch(e._getInternalJsonObj(),
- a)&&b.push(e)}return 0===b.length?null:b},_getEventsInArray:function(a){var b=[],c;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(a[c]);return 0===b.length?null:b},_addEvents:function(a,b){for(var c in b)if(Object.prototype.hasOwnProperty.call(b,c)){var d=b[c],e;for(e in d)Object.prototype.hasOwnProperty.call(d,e)&&a.push(d[e])}}});dojo.declare("com.ibm.mm.iwidget.model.DOMEventModelFactoryImpl",com.ibm.mashups.iwidget.model.EventModelFactory,{constructor:function(){this.modes=["DOM"]},
- createEventModel:function(a){return new com.ibm.mm.iwidget.model.DOMEventModelImpl(a)},getSupportedPersistenceMode:function(){return this.modes}});dojo.declare("com.ibm.mm.iwidget.services.WidgetEventModelFactoryServiceImpl",com.ibm.mashups.iwidget.services.WidgetEventModelFactoryService,{constructor:function(){this._factories={}},createEventModel:function(a,b){b&&com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.iwidget.services.ContainerService.SERVICE_NAME).registerOnChangeListener(com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_EVENTS,
- b);return new com.ibm.mm.enabler.DeferredImpl(this,function(b,d){var e=a.id,f=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.iwidget.services.ContainerService.SERVICE_NAME).getPersistenceMode(com.ibm.mashups.iwidget.services.ContainerService.PROVIDER_EVENTS);if(dojo.hasClass(a.rootElement,com.ibm.mm.iwidget.services.WidgetEventModelFactoryServiceImpl.STANDALONE_CLASS)||!f)f=com.ibm.mm.iwidget.services.WidgetEventModelFactoryServiceImpl.DEFAULT_PERSISTENCE;var g;if("undefined"!==
- typeof f&&f==com.ibm.mashups.enabler.widget.Constants.PERSISTENCE_MODE_MODEL){var h=com.ibm.mashups.enabler.widget.Factory.getWidgetModel(),k=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel(),n=com.ibm.mashups.enabler.model.state.AccessorFactory.getSpaceAccessor(k).getSpaceID(),k=com.ibm.mashups.enabler.model.state.AccessorFactory.getPageAccessor(k,n).getPageID(),e=com.ibm.mm.iwidget.Utils.getModelID(e),h=h.findWidgetWindow(e,k);h.setFinishedCallback(dojo.hitch(this,
- function(d,e){d||(f=com.ibm.mm.iwidget.services.WidgetEventModelFactoryServiceImpl.DEFAULT_PERSISTENCE,dojo.isFunction(a._getResourceBundle)&&a._getResourceBundle());g=f in this._factories?this._factories[f].createEventModel(a,f):null;b.finish(g,e)}));h.start(d)}else g||(g=f in this._factories?this._factories[f].createEventModel(a,f):null),b.finish(g,200);return g})},setFactory:function(a,b){this._factories[a]=b},removeFactory:function(a){a in this._factories&&delete this._factories[a]}});com.ibm.mm.iwidget.services.WidgetEventModelFactoryServiceImpl.DEFAULT_PERSISTENCE=
- com.ibm.mashups.enabler.widget.Constants.PERSISTENCE_MODE_DOM;com.ibm.mm.iwidget.services.WidgetEventModelFactoryServiceImpl.STANDALONE_CLASS=com.ibm.mm.iwidget.Constants.CSSCLASS_PREFIXED_INSTANCE.iwStandalone;com.ibm.mashups.services.ServiceManager.setService(com.ibm.mashups.iwidget.services.WidgetEventModelFactoryService.SERVICE_NAME,new com.ibm.mm.iwidget.services.WidgetEventModelFactoryServiceImpl);com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.iwidget.services.WidgetEventModelFactoryService.SERVICE_NAME).setFactory(com.ibm.mashups.enabler.widget.Constants.PERSISTENCE_MODE_DOM,
- new com.ibm.mm.iwidget.model.DOMEventModelFactoryImpl);dojo.declare("com.ibm.mashups.iwidget.itemset.ShareableItemSet",null,{constructor:function(){},setItemValue:function(){return this},getItemValue:function(){return null},getAllNames:function(){return null},removeItem:function(){return null},commit:function(){return null},addListener:function(){return null},removeListener:function(){return!0}});dojo.declare("com.ibm.mm.iwidget.itemset.ShareableItemSetImpl",com.ibm.mashups.iwidget.itemset.ShareableItemSet,
- {constructor:function(a,b,c){this.DELETE_TOKEN="DELETE_TOKEN";this.parent=a;c&&(this.id=c);b&&(this.id=b.id,this.alias=b.alias?b.alias:null,this.defData=b);this.mapping={};this.items={};if(b){var a=b.items,d;for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&(b=d,c=a[d].alias?a[d].alias:null,this.items[d]={id:b},c&&(this.mapping[c]=b,this.items[d].alias=c))}this.navigationStateModel=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel();d=this.alias;d||(d=this.id);
- this.shareableAccessor=com.ibm.mashups.enabler.model.state.AccessorFactory.getShareableParameterSetAccessor(this.navigationStateModel,d,"global");this._isDirty=!1},addListener:function(a){var b=this.alias;b||(b=this.id);var c=this;return this.shareableAccessor.registerListener(function(b){if(!c._isSender){var e=b.changes?b.changes:null;if(e)for(var f=0;f<e.length;f++){var g=e[f].alias;c.mapping&&c.mapping[g]&&(e[f].id=c.mapping[g])}0<e.length&&(b=new com.ibm.mm.iwidget.IEventImpl("onItemSetChanged",
- null,b),dojo.isString(a)&&(e=c.parent._getHandlerScope(a))&&(a=dojo.hitch(e,a)),a(b))}})},removeListener:function(a){return this.shareableAccessor.removeListener(a)},setItemValue:function(a,b){if(!a||!b)return null;"undefined"!=typeof this._isDirty&&!this._isDirty&&(this._isDirty=!0,this._changedItems={});var c=this._resolveMapping(a);c||(c=a);this._changedItems=this._changedItems?this._changedItems:{};this._changedItems[c]=b;return this},getItemValue:function(a){var b=this._resolveMapping(a);b||
- (b=a);if(this._isDirty&&this._changedItems){if(this._changedItems[b]&&this._changedItems[b]!=this.DELETE_TOKEN)return this._changedItems[b];if(this._changedItems[b]&&this._changedItems[b]==this.DELETE_TOKEN)return null}(a=this.shareableAccessor.getItemValue(b))||(a=null);return a},getAllNames:function(){var a=this.shareableAccessor.getAllNames();if(this._isDirty){for(var b={},c=0;c<a.length;c++){var d=a[c];b[d]=d}if(this._changedItems)for(var e in this._changedItems)this._changedItems[e]&&this._changedItems[e]==
- this.DELETE_TOKEN&&b[e]?b[e]=null:this._changedItems[e]&&!b[e]&&(b[e]=e);var a=[],f;for(f in b)Object.prototype.hasOwnProperty.call(b,f)&&a.push(f)}for(b=0;b<a.length;b++)f=a[b],this.mapping[f]&&(a[b]=this.mapping[f]);return 0===a.length?null:a},removeItem:function(a){"undefined"!=typeof this._isDirty&&!this._isDirty&&(this._isDirty=!0,this._changedItems={});var b=this.getAllNames();if(null===b)return null;for(var c=!1,d=0;d<b.length;d++)b[d]==a&&(c=!0);if(!c)return null;(b=this._resolveMapping(a))||
- (b=a);this._changedItems=this._changedItems?this._changedItems:{};this._changedItems[b]=this.DELETE_TOKEN;return this},getItemSetDescription:function(){return null},commit:function(){this._isDirty&&(this._isSender=!0,this.shareableAccessor._setItems(this._changedItems),this.navigationStateModel.commit().start(),this._isSender=!1);this._changedItems=null;this._isDirty=!1},_resolveMapping:function(a){return!a||!this.items?null:this.items[a]&&this.items[a].alias?this.items[a].alias:null}});com.ibm.mm.iwidget.itemset.ShareableItemSetFactory=
- com.ibm.mm.iwidget.itemset.ShareableItemSetImpl;ibmConfig.enablerLayerModules&&0<=dojo.indexOf(ibmConfig.enablerLayerModules,"CoreModel")&&dojo.require("com.ibm.mm.iwidget.itemset.ShareableItemSetExtendedModelImpl");dojo.declare("com.ibm.mm.iwidget.DeferredLiveTextUnprocessImpl",com.ibm.mm.enabler.DeferredImpl,{constructor:function(a){this.wrapper=a},start:function(a){a||(dojo.isFunction(this.wrapper.iScope._onGetMarkup)&&this.wrapper.iScope._onGetMarkup(),a=dojo.clone(this.wrapper.rootElement),dojo.publish("/com/ibm/mashups/livetext/livetextunchange",
- [a,!0,null,null,dojo.hitch(this,this._unchangeCompleteCallback),this.includeParent]))},setIncludeParent:function(a){this.includeParent=a},getIncludeParent:function(){return this.includeParent},_unchangeCompleteCallback:function(a){dojo.isFunction(this.getFinishedCallback())&&this.finish(a,200)}});dojo.declare("com.ibm.mm.iwidget.widget.IWidgetWrapperExtendedImpl",com.ibm.mm.iwidget.widget.IWidgetWrapperDefaultImpl,{getMarkup:function(){return new com.ibm.mm.iwidget.DeferredLiveTextUnprocessImpl(this)},
- destroy:function(){if(this.widgetDef){var a=this.widgetDef._getShareableItemSets();if(a){var b=null,c;for(c in a)if(Object.prototype.hasOwnProperty.call(a,c)&&this.shareableItemSets.listeners[c])for(var d=0,e=this.shareableItemSets.listeners[c].length;d<e;++d){var f=this.shareableItemSets.listeners[c][d],b=this.shareableItemSets.itemsets[c];b.removeListener(f)}}}this.inherited(arguments);a=0;for(b=this.unregisterArray.length;a<b;a++)dojo.unsubscribe(this.unregisterArray[a])},_getResourceBundle:function(){this.iwMessages||
- (this.iwMessages=dojo.i18n.getLocalization("com.ibm.mm.enabler","iwMessages"));return this.iwMessages},_logUpdateMarkupError:function(){this._getResourceBundle()},_loadWidgetSharedResource:function(a){var b=this.widgetDef.getResources();this._getResourceBundle();if("undefined"!=typeof b&&null!==b){var c=b.length-1;-1==c&&a();var d=[],e=[],f;for(f in b)if(Object.prototype.hasOwnProperty.call(b,f)){var g=b[f];g.isImage()||g.isCSS()?e.push(g):d.push(g)}for(b=0;b<e.length;b++)d.push(e[b]);for(var h=this,
- e=function(b,d,e,f){e&&(f&&d.isJS())&&(h.error="true",h.data||(h.data=[]),d=dojo.string.substitute(h.iwMessages.E_RESOURCE_LOAD_FAIL_2,[d.src,e.message]),h.data.push({data:d,status:f}));c==b&&(h.error&&"true"==h.error?(dojo.query("> ."+h.ns+"loading",h.rootElement).forEach(function(a){a.innerHTML="";(a=h.getIWidgetInstance().getIDescriptorItems().getItemValue("title",dojo.locale))?unescape(a):h.getIWidgetInstance();h.widgetDef&&h.widgetDef.getWidgetId();var a="",b=dojo.isArray(h.data)?h.data[0]:h.data,
- a="",c;for(c in b)Object.prototype.hasOwnProperty.call(b,c)&&"data"==c&&(a=a.concat("'"+b[c]+"'").concat("\n"))}),h.error=null,h.data=null):a&&a())},b=0;b<d.length;b++)f=d[b],"undefined"!=typeof f&&null!==f&&com.ibm.mashups.services.ServiceManager.getService("resourceLoadService").loadResource(f,this.id,dojo.partial(e,b,f))}},handleEvent:function(a){var b=a.declaredClass;if("undefined"!=typeof b&&null!==b&&"com.ibm.mm.iwidget.IEventImpl"==b)return this._handleEvent(a.name,a);b=a.scope;"undefined"!=
- typeof b&&null!==b?"instance"==b?b=this.getIWidgetInstance():"eventmodel"==b&&(b=this._getPublicEvents()):b=this;var c=a.methodname;"undefined"!=typeof c&&null!==c&&b[c]&&dojo.isFunction(b[c])&&b[c].apply(b,a.params)},_handleEvent:function(a,b){b=this._deserializePayload(b);if("undefined"==typeof a||null===a)return!1;if(this.loaded)try{if(a==iwConstants.EVENTS.onNavStateChanged)return this._handleOnNavStateChanged(b);if(a==iwConstants.EVENTS.onWindowStateChanged){var c=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel();
- com.ibm.mashups.enabler.model.state.AccessorFactory.getWidgetAccessor(c,this.id).setWindowState(b.payload.newWindowState);var d=dojo.contentBox(this.rootElement.parentNode);this.handleSizeChanged({newWidth:Math.max(0,d.w),newHeight:Math.max(0,d.h)});return this._handleEventInternal(a,b)}if(a==iwConstants.EVENTS.onModeChanged){if(this._inIframe()){c={methodname:"_handleOnModeChange"};c.hubclient=this.hubId;c.params=[b.payload];this.eventSvr._publishEvent(iwConstants.WIDGETEVENT_PREFIX+("_stub_"+this.id),
- c,this.hubId);return}return this._handleModeChange(b)}return"onNewWire"==a?this._handleNewWire(b):"onRemoveWire"==a?this._handleRemoveWire(b):this._handleEventInternal(a,b)}catch(e){}else this._eventqueue||(this._eventqueue={}),this._eventqueue[a]=b},getPublicEventHandler:function(a){var b=this._getPublicEvents()||null;if(!b)return null;var c=b.find(a)||null;if(!c)return null;var d=c.handlingFn||null;if(!d){var e=c.getAttribute("isComplete");"undefined"!==typeof e&&!1===e&&(d=iwConstants.EVENTS.onIncompleteEventDescription,
- c=new com.ibm.mm.iwidget.IEventImpl(d,null,{eventDescription:c}),this._handleEventInternal(d,c),c=b.find(a),d=c.handlingFn)}a=null;d&&(dojo.isFunction(d)?a=d:(b=this._getHandlerScope(d)||null)&&(a=dojo.hitch(b,d)));return a},getPublishedEvents:function(){this.publishedEvents||(this.publishedEvents={});return this.publishedEvents},getHandledEvents:function(){this.handledEvents||(this.handledEvents={});return this.handledEvents},_inIframe:function(){if(this._isInIframe)return this._isInIframe;var a=
- !1,b=this.eventSvr.getType();"undefined"!=typeof b&&b==com.ibm.mm.iwidget.Constants.eventservice.type.IFRAME&&(a=!0);return this._isInIframe=a},setMainframeId:function(a){this._mainframeId=a},setModal:function(a){this._isModal=a},isModal:function(){return this._isModal?this._isModal:!1},_handleDataSync:function(a){"undefined"!=typeof a.attributes&&null!==a.attributes&&this._syncModifiableProperties(a.attributes,this.getIWidgetInstance().getAttributes());"undefined"!=typeof a.idescriptors&&null!==
- a.idescriptors&&this._syncModifiableProperties(a.idescriptors,this.getIWidgetInstance().getIDescriptorItems());"undefined"!=typeof a.wiremodel&&null!==a.wiremodel&&this._syncWireModel(a.wiremodel,this.getIWidgetInstance().getWireModel());this.commit(!0)},_syncModifiableProperties:function(a,b){var c=a._items;if(a._dirty)for(var d in c)if(Object.prototype.hasOwnProperty.call(c,d)){var e=d,f=c[d];if(dojo.isString(f))f&&f==b.DELETE_TOKEN&&b.removeItem(e);else{var f=c[d].readOnly?c[d].readOnly:!1,g=c[d].values;
- if("undefined"!=typeof g&&null!==g)for(var h in g)if(Object.prototype.hasOwnProperty.call(g,h)){var k=g[h];k&&k==b.DELETE_TOKEN?b.removeItemValue(e,h):k&&b.setItemValue(e,k,f,h)}}}},_syncWireModel:function(a,b){var c=a._wires,d;for(d in c)if(Object.prototype.hasOwnProperty.call(c,d)){var e=c[d];e._isDirty&&e._type&&"NEW"==e._type?b.addWire(e.SourceWidget,e.SourceEvent,e.TargetEvent):e._isDirty&&(e._type&&"DELETE"==e._type)&&b.removeWire(e.SourceWidget,e.SourceEvent,e.TargetEvent)}b._targets=a._targets},
- setStateData:function(a){this.stateData=a},updateState:function(){var a;if(this._inIframe())this.stateData&&(a=new com.ibm.mm.iwidget.IEventImpl(iwConstants.EVENTS.onNavStateChanged,null,this.stateData),this._handleEventInternal(iwConstants.EVENTS.onNavStateChanged,a));else if(a=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel(),a=com.ibm.mashups.enabler.model.state.AccessorFactory.getWidgetAccessor(a,this.id)||null)if(a=a.getWidgetState("cp"))a=new com.ibm.mm.iwidget.IEventImpl(iwConstants.EVENTS.onNavStateChanged,
- "json",a),this._handleEventInternal(iwConstants.EVENTS.onNavStateChanged,a)},_handleOnNavStateChanged:function(a){if(this._inIframe()){var b={methodname:"_handleOnNavStateChanged"};b.params=[a];this.eventSvr._publishEvent(this.eventSvr.WIDGETEVENT_PREFIX+"_stub_"+this.id,b)}else if(a=a.payload)b=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel(),com.ibm.mashups.enabler.model.state.AccessorFactory.getWidgetAccessor(b,this.id).setWidgetState("cp",a),b.commit().start()},
- _initialize:function(a){var b=this.widgetDef.getDefaultLanguage()||null;this.defaultLanguage=b?b:"en";b=this._getInitDefaultMode()||null;b||(b=iwConstants.mode_view);this.currentMode=b;this._handleSaveMode();this._initManagedItemSet();this._getShareableItemSets();this._getPublicEvents(dojo.hitch(this,function(){this.getWires();a&&a()}))},getPublicEvent:function(a){return this._getPublicEvents().find(a)},_getPublicEvents:function(a){if(!this.publicEvents){var b=com.ibm.mashups.services.ServiceManager.getService("WidgetEventModelFactoryService").createEventModel(this,
- {context:this,callback:"_eventProviderModeChange",unregister:function(a){this.unregisterArray.push(a)}});b.setFinishedCallback(dojo.hitch(this,function(b){this.publicEvents=b;a&&a(this.publicEvents)}));var c=a?!1:!0;ibmConfig.dojotest&&(c=!0);b.start(c)}return this.publicEvents},_eventProviderModeChange:function(){var a=this.publicEvents,b=com.ibm.mashups.services.ServiceManager.getService("WidgetEventModelFactoryService").createEventModel(this,{context:this,callback:"_eventProviderModeChange",unregister:function(a){this.unregisterArray.push(a)}});
- b.setFinishedCallback(dojo.hitch(this,function(a){this.publicEvents=a}));b.start(!0);if(a=a.getEvents({isHandled:"true"}))for(b=0;b<a.length;b++){var c=a[b],d=this.getPublicEvent(c.name);c&&d&&d.copyRuntimeProperties(c)}},_getPublishedEvents:function(){var a=this.getWidgetPublishedEvents()||null,b={};if(a){var c=0;for(c;c<a.length;c++)b[a[c].name]=a[c]}return b},_getHandledEvents:function(){var a=this.getWidgetHandledEvents()||null,b={};if(a){var c=0;for(c;c<a.length;c++)b[a[c].name]=a[c]}return b},
- getWidgetPublishedEvents:function(){var a=this._getPublicEvents();return a?a.getEvents({isPublished:"true"}):null},getWidgetHandledEvents:function(){var a=this._getPublicEvents();return a?a.getEvents({isHandled:"true"}):null},getWires:function(){return this.getIWidgetInstance().getWires()},_handleNewWire:function(a){var b=a.payload;this.getIWidgetInstance().getWireModel().registerTargets(b.targetWidget,b.targetEvent,b.sourceEvent);this.commit();var b=b.sourceEvent,c=this._getPublicEvents();if(!c)return!1;
- if(b=c.find(b))if(b=b.getOnNewWire()){if((c=this._getHandlerScope(b))&&dojo.isFunction(c))c(a);else if(c&&dojo.isObject(c))c[b](a);return!0}return!1},_handleRemoveWire:function(a){var b=a.payload,c=b.targetEvent;this.id==b.sourceWidget&&(c=b.sourceEvent);b=this._getPublicEvents()||null;if(!b)return!1;if(c=b.find(c)||null)if(c=c.getOnRemoveWire()){if((b=this._getHandlerScope(c))&&dojo.isFunction(b))b(a);else if(b&&dojo.isObject(b))b[c](a);return!0}return!1},_getShareableItemSets:function(){if(this.shareableItemSets)return this.shareableItemSets;
- this.shareableItemSets={};this.shareableItemSets.mapping={};this.shareableItemSets.itemsets={};this.shareableItemSets.listeners={};var a=this.widgetDef._getShareableItemSets();if(a){var b=null,c;for(c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var b=new com.ibm.mm.iwidget.itemset.ShareableItemSetFactory(this,a[c]),d=a[c].onItemSetChanged||null;d&&(this.shareableItemSets.listeners[c]||(this.shareableItemSets.listeners[c]=[]),this.shareableItemSets.listeners[c].push(b.addListener(d)));this.shareableItemSets.itemsets[c]=
- b;(b=a[c].alias||null)&&(this.shareableItemSets.mapping[b]=b)}}return this.shareableItemSets},_getShareableItemSet:function(a){var b=this._getShareableItemSets();if(b&&b.mapping[a])return b.itemsets[b.mapping[a]];if(b&&b.itemsets[a])return b.itemsets[a];var c=new com.ibm.mm.iwidget.itemset.ShareableItemSetFactory(this.widgetwrapper,null,name);b.itemsets[a]=c;return b.itemsets[a]},_executeCallbackQueue:function(){com.ibm.mashups.services.ServiceManager.getService("resourceLoadService").executeCallbackQueue(this.id)},
- _handleSaveMode:function(){var a=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel(),b=com.ibm.mashups.enabler.model.state.AccessorFactory.getWidgetAccessor(a,this.id),c=b.getWidgetMode();c!=this.currentMode&&!(null===c&&this.currentMode==com.ibm.mm.iwidget.Constants.mode.VIEW)&&(b.setWidgetMode(this.currentMode),a.commit().start())},_transform:function(a,b){var c=this.getPublicEvent(a);c&&(c.type&&b.type)&&(c=new com.ibm.mm.iwidget.IEventImpl(c.name,c.type,b.payload,
- null),(c=(new com.ibm.mm.enabler.utils.EventTransformerImpl)._transform(b,c)||null)&&(b=c));return b},_getModeFromNavStateModel:function(){var a=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel();return com.ibm.mashups.enabler.model.state.AccessorFactory.getWidgetAccessor(a,this.id).getWidgetMode()}});com.ibm.mm.iwidget.widget.IWidgetWrapperImpl=com.ibm.mm.iwidget.widget.IWidgetWrapperExtendedImpl;ibmConfig.enablerLayerModules&&0<=dojo.indexOf(ibmConfig.enablerLayerModules,
- "CoreModel")&&dojo.require("com.ibm.mm.enabler.iwidget.widget.IWidgetWrapperModelImpl");dojo.declare("com.ibm.mashups.livetext.CallbackModel",null,{preProcessCallbackFunc:function(){},postProcessCallbackFunc:function(){}});dojo.declare("com.ibm.mashups.livetext.ConfigEntry",null,{constructor:function(){},isEqual:function(){}});dojo.declare("com.ibm.mm.livetext.ConfigEntryImpl",com.ibm.mashups.livetext.ConfigEntry,{constructor:function(a,b,c,d,e,f,g){this.match=a;this.wait=f;this.procEnc=b;this.mod=
- c;this.path=d;this.baseCls=e;this.id=g},isEqual:function(a){return a&&a.match==this.match&&a.wait==this.wait&&a.procEnc==this.procEnc&&a.mod==this.mod&&a.path==this.path&&a.baseCls==this.baseCls&&a.id==this.id}});com.ibm.mashups.livetext.ConfigEntry=com.ibm.mm.livetext.ConfigEntryImpl;dojo.declare("com.ibm.mashups.livetext.Exception",null,{constructor:function(){},getMessage:function(){}});dojo.declare("com.ibm.mashups.livetext.LivetextBatchModel",null,{processTag:function(){},unprocessTag:function(){}});
- dojo.declare("com.ibm.mashups.livetext.LivetextModel",null,{processTag:function(){},unprocessTag:function(){}});dojo.declare("com.ibm.mashups.livetext.ServiceModel",null,{SERVICE_NAME:"livetextService",init:function(){},onTagChanged:function(){},onUnchangeTag:function(){},onTagContentChanged:function(){},onAddConfigEntry:function(){},onRemoveConfigEntry:function(){}});com.ibm.mashups.livetext.ServiceModel.SERVICE_NAME=com.ibm.mashups.livetext.ServiceModel.prototype.SERVICE_NAME;dojo.declare("com.ibm.mm.livetext.ServiceModelImpl",
- com.ibm.mashups.livetext.ServiceModel,{_initialized:!1,_tagTypes:null,_rootContainer:null,tagChanged:"/com/ibm/mashups/livetext/livetextchanged",unchangeTag:"/com/ibm/mashups/livetext/livetextunchange",tagStatusChange:"/com/ibm/mashups/livetext/livetextchanged",tagContentChanged:"/com/ibm/mashups/livetext/livetextcontentchanged",entryAdded:"/com/ibm/mashups/livetext/configentryadded",entryRemoved:"/com/ibm/mashups/livetext/configentryremoved",constructor:function(){com.ibm.mm.livetext.ServiceModelStatic?
- console.warn("WARNING: Do not create the LiveText Framework multiple times!"):(com.ibm.mm.livetext.ServiceModelStatic=!0,dojo.subscribe(this.entryAdded,this,"onAddConfigEntry"),dojo.subscribe(this.entryRemoved,this,"onRemoveConfigEntry"))},init:function(a){this._initialized?console.warn("WARNING: Do not initialize the LiveText Framework multiple times!"):(this._initialized=!0,a||(a={}),this._loadTags(a),dojo.subscribe(this.tagChanged,this,"onTagChanged"),dojo.subscribe(this.unchangeTag,this,"onUnchangeTag"),
- dojo.subscribe(this.tagContentChanged,this,"onTagContentChanged"),dojo.publish(this.tagContentChanged,[a.node||document,"continueAfterException"in a?a.continueAfterException:!0,a.preProcessCallbackFunc,a.postProcessCallbackFunc]))},_getNodes:function(a,b){var c=[];if("undfined"==b||!b)return console.error("Why are we having tagType undefined ::::"),c;var d,e=0;if("undefined"!=b.processEnclosedTags&&b.processEnclosedTags)return c=b.match,d=[],c=dojo.query(c,a),c.forEach(function(a){d.push(a)}),d;var f=
- b.match.split(",");d=[];var g=[],e=0;for(l=f.length;e<l;e++)c=dojo.query(f[e]+" "+f[e],a),c.forEach(function(a){d.push(a)}),dojo.query(f[e],a).forEach(function(a){g.push(a)});for(;0<d.length;){c=d[0];for(e=0;e<g.length;)if(c==g[e]){d.splice(0,1);g.splice(e,1);break}else e++}return g},onTagChanged:function(a,b,c,d){for(var e=null,f=0,g=this._tagTypes.length;f<g;f++)e=this._tagTypes[f],this._processTypeTag(a,e,b,c,d,!0)},onUnchangeTag:function(a,b,c,d,e){for(var f=null,g=0,h=this._tagTypes.length;g<
- h;g++)f=this._tagTypes[g],this._unprocessTypeTag(a,f,b,c,d,!1);dojo.isFunction(e)&&e(a)},onTagContentChanged:function(a,b,c,d){for(var e=null,f=0,g=this._tagTypes.length;f<g;f++)e=this._tagTypes[f],this._processTypeTag(a,e,b,c,d,!1)},_processTypeTag:function(a,b,c,d,e,f){b=b||null;if(null!==b){var g=[];f&&this._checkRoot(a,b)&&(g[0]=a);g=g.concat(this._getNodes(a,b));f=[];f=f.concat(g);if(0<f.length){b.loaded=b.loaded||null;null===b.loaded&&this._loadTagHandler(b);var h=[];if(dojo.isFunction(d))try{d(a,
- f,b)}catch(k){console.debug(k)}if(b.tagHandler instanceof com.ibm.mashups.livetext.LivetextBatchModel)try{b.tagHandler.processTag(g,b)}catch(n){h[h.length]=n}else for(var d=0,y=g.length;d<y;d++)try{b.tagHandler.processTag(g[d])}catch(t){if(h[h.length]=t,c)break}if(dojo.isFunction(e))try{e(a,f,h,b)}catch(q){console.debug(q)}}}},_unprocessTypeTag:function(a,b,c,d,e,f){var g=[];f&&this._checkRoot(a,b)&&(g[0]=a);var g=g.concat(this._getNodes(a,b)),f=[],f=f.concat(g),h=[];if(dojo.isFunction(d))try{d(a,
- f,b)}catch(k){console.debug(k)}if(0<f.length)if(b.loaded=b.loaded||null,null===b.loaded&&this._loadTagHandler(b),b.tagHandler instanceof com.ibm.mashups.livetext.LivetextBatchModel)try{b.tagHandler.unprocessTag(nodes,b)}catch(n){h[h.length]=n}else for(var d=0,y=g.length;d<y;d++)try{b.tagHandler.unprocessTag(g[d])}catch(t){if(h[h.length]=t,c)break}if(dojo.isFunction(e))try{e(a,f,h,b)}catch(q){console.debug(q)}},_checkRoot:function(a,b){var c=!1,a=a||null;if(null!==a&&a.nodeType){var d,e,f;this._rootContainer||
- (this._rootContainer=dojo.create("div",{style:{display:"none"}},dojo.body()));d=document.createElement("div");this._rootContainer.appendChild(d);e=a.cloneNode(!1);d.appendChild(e);f=(f=this._getNodes(d,b))||null;null!==f&&0<f.length&&(c=!0);dojo.destroy(e);dojo.destroy(d);delete e;delete d;delete f}return c},_loadTags:function(){this._tagTypes=this._tagTypes||null;if(null===this._tagTypes){var a=this;ibmConfig.livetextService?this._tagTypes=ibmConfig.livetextService:dojo.xhrGet({url:dojo.moduleUrl("com.ibm.mm.livetext",
- "tagservice.entries.cfg"),handleAs:"text",sync:!0,load:function(b){a._tagTypes=dojo.fromJson(b)},error:function(a){console.dir(a)}})}},onAddConfigEntry:function(a,b){this._loadTags();dojo.some(this._tagTypes,function(b){return a.isEqual(b)})||(b?this._tagTypes.unshift({match:a.match,processEnclosedTags:a.procEnc,waitOnPreTag:a.wait,module:a.mod,path:a.path,baseClass:a.baseCls,id:a.id}):this._tagTypes.push({match:a.match,processEnclosedTags:a.procEnc,waitOnPreTag:a.wait,module:a.mod,path:a.path,baseClass:a.baseCls,
- id:a.id}))},onRemoveConfigEntry:function(a){this._loadTags();for(var b=0;;b<this._tagTypes.length)a.isEqual(this._tagTypes[b])?this._tagTypes[b].splice(b,1):b++},parseDom:function(a,b){dojo.publish(this.tagChanged,[b])},_loadTagHandler:function(a){try{dojo.registerModulePath(a.module,a.path);dojo.require(a.baseClass);var b=dojo.fromJson("{create:function(){return new "+a.baseClass+"()}}");a.tagHandler=b.create();a.loaded=!0}catch(c){}}});com.ibm.mashups.services.ServiceManager.setService(com.ibm.mashups.livetext.ServiceModel.SERVICE_NAME,
- "com.ibm.mm.livetext.ServiceModelImpl");dojo.declare("tagservices.skins",null,{skinIdPrefix:"mm_ibm_skin_",allSkins:[],allVars:[],tempSkinHtmlObj:null,tempSkinJsObj:null,isProcessing:0,waitingList:[],subscribeHandler:null,skinAttachEvent:"/skinservice/attachEnd",processTag:function(a){this.tempSkinHtmlObj={};this.tempSkinJsObj={};if(a){var b=a.getAttribute("skin");this._getSkinTemplate(b,a)}},unprocessTag:function(a){var b=this._findSkinNode(a);b.parentNode.insertBefore(a,b);com.ibm.mm.enabler.utils.Dom.destroyNode(b)},
- _findSkinNode:function(a){for(var b=a;b&&b.id!=this.skinIdPrefix+a.id;)b=b.parentNode;return b},_getSkinTemplate:function(a,b){if(this.allSkins[a])this.startAttatchSkin(a,b);else{var c=this,d=this._getSkinResourceUrl(a,"skin.html"),e=this._getSkinResourceUrl(a,"skin.js");dojo.xhrGet({url:d,handleAs:"text",sync:!0,load:function(d){dojo.xhrGet({url:e,handleAs:"json",sync:!0,load:function(e){d=d.replace(/<\!--.*--\>\s*/,"");c.allSkins[a]=d;c.allVars[a]=e;c.startAttatchSkin(a,b)},error:function(){c.allSkins[a]=
- d;c.startAttatchSkin(a,b)}})},error:function(){}})}},startAttatchSkin:function(a,b){0===this.isProcessing?this.executeReplaceSkin(a,b):this.addToWaitingList(a,b)},chooseNext:function(){if(0!==this.waitingList.length){var a=this.waitingList.pop();this.executeReplaceSkin(a.skin,a.tag)}},addToWaitingList:function(a,b){this.subscribeHandler||(this.subscribeHandler=dojo.subscribe(this.skinAttachEvent,this,"chooseNext"));var c={};c.skin=a;c.tag=b;this.waitingList.push(c)},executeReplaceSkin:function(a,
- b){this.isProcessing=1;var c=this.allSkins[a];if(c){var d=this._getNodeToReplace(b),e=d.parentNode,f=dojox.uuid.generateRandomUuid().replace(/\-/g,""),g=this._getArgs(a,b,f);if(!g)return;var h=this._getSkinResourceUrl(a,"skin.css");com.ibm.mm.builder.utils.htmlUtil.loadCss(h);builderConfig.isBidi&&(h=this._getSkinResourceUrl(a,"skin_rtl.css"),com.ibm.mm.builder.utils.htmlUtil.loadCss(h));c=dojo.string.substitute(c,g);c=c.replace(/\/>/g,"></div>");c=this._getNodeFromMarkup(c);dojo.addClass(c,"mumWidgetTitleBar");
- e.replaceChild(c,d);e=dojo.byId(f);e.parentNode.replaceChild(b,e);!dojo.hasClass(d,"iw-iWidget")&&dojo.hasClass(d,"mm_iWidget");d={};d.widgetId=b.id;d.skinNodeId=c.id;d.skinParam=g;com.ibm.mashups.services.ServiceManager.getService("eventService").broadcastEvent("com.ibm.mashups.builder.skinLoaded",d)}this.isProcessing=0;dojo.publish(this.skinAttachEvent,[null])},_getSkinResourceUrl:function(a,b){try{var c=com.ibm.mm.builder.utils.skinUtil._getSkinModel(),d=com.ibm.mm.builder.utils.skinUtil.getSkinNode(a)||
- com.ibm.mm.builder.utils.skinUtil.getDefaultSkin();return c.findResourceURL(d,b)}catch(e){}return null},_getArgs:function(a,b,c){var d={},e=this.allVars[a];e&&dojo.mixin(d,e);d.widgetBody="<div id='"+c+"'/>";d.skinId=this.skinIdPrefix+b.id;d.process||(d.process=function(){});d.process(a,b.id);return d},_getNodeMarkup:function(a){var b=document.createElement("div");b.appendChild(a.cloneNode(!0));a=b.innerHTML;b.removeChild(b.firstChild);return a},_getNodeFromMarkup:function(a){var b=document.createElement("div");
- b.innerHTML=a;return b.removeChild(b.firstChild)},_getNodeToReplace:function(a){var b=dojo.byId(this.skinIdPrefix+a.id);b||(b=a);return b},_showParent:function(a){for(a=a.parentNode;a;)a=a.parentNode}});dojo.declare("tagservices.widgets",null,{queue:[],queueHandle:null,queueRendering:!0,constructor:function(){queueRendering=com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.enabler.services.ConfigService.SERVICE_NAME).getValue(com.ibm.mashups.enabler.services.ConfigConstants.QUEUE_RENDERING)},
- processTag:function(a){var b=dojo.attr(a,"id");if("undefined"!=typeof b){var c=dojo.attr(a,"lazyLoad"),d=com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel().find(b);null===d&&(d=com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel().createWidget(a));d&&(!c||c&&"true"!=c?!0===queueRendering&&!dojo.hasClass(a,"iw-Standalone")?(this.queue.push({priority:dojo.position(a).y,widgetId:b}),this.processQueue(!1)):com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel().renderWidget(d):d.lazyLoad=
- !0)}},processQueue:function(a){if(0<this.queue.length){if(a)for(;0<this.queue.length;){if(a=this.queue.shift(),a=com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel().find(a.widgetId)){com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel().renderWidget(a);break}}else this.queue.sort(function(a,b){return a.priority-b.priority});if(!this.queueHandle){var b=this;this.queueHandle=setTimeout(function(){b.queueHandle=setTimeout(function(){b.queueHandle=null;dojo.hitch(b,b.processQueue)(!0)},
- 5)},0)}}},unprocessTag:function(a){for(var b=["iw-","mm_"],c=0,d=b.length;c<d;c++)for(var e=dojo.query("."+b[c]+iwConstants.CSSCLASS_INSTANCE.iwContent,a),f=0;f<e.length;f++)com.ibm.mm.enabler.utils.Dom.destroyNode(e[f])}})});
|