/******************************************************************************* * 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';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>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=[];0g&0>2]>>g%4)%256)}return e},nextRandomB64Str:function(a){for(var b=this.nextRandomOctets(a),c="",g=0;g>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;gq;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;en)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;0a.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;1a.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").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;dthis.max_version&&(p=-1E3);b[c]=p}d=-1;p=1E3;c=0;for(a=b.length;cp&&(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=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#%{}|\\^~[]`"Z',constructor:function(){},isUnsafeChar:function(a){return-1=a.charCodeAt(0)||123<=a.charCodeAt(0)?!0:!1},zEncode:function(a){for(var b= "",c=0;c>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>2, f=b&3,b=a[e++],g,m,p,h,k="";0>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>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);1f;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(athis.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/g,">").replace(/&/g,"&"); b+=''}return b+""},_extractDigest:function(a,b){var c,d=a.getParameter("digest");d?c=d:(d=b.indexOf("digest!"),0\n\n"+b+"\n"+a+"\n"+(new Date).toGMTString()+ "\n"+c+""}});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 ."+(this.ns+"Definition"),this.rootElement,a,!1);a&&0 ."+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+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"+c,d++);var c=dojo.create("div",{innerHTML:c}),e=dojo.isIE||dojo.isWebKit||dojo.isOpera,f=c.childNodes||null;if(null!==f&&0"),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&&ba.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=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;dthis.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 ."+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&&0this.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),0b?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;ab?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")&&(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 ."+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 ."+e.ns+"loading",e.rootElement,b,!1),0 "+this.iwStr.LOAD:""+this.iwStr.LOAD+" "+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.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]='
';d[d.length]='
';d[d.length]="
";d[d.length]='
';d[d.length]=a;d[d.length]="
";b&&0',d[d.length]=b,d[d.length]="
");d[d.length]="";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 ."+a+"ReceivedEvent",this._instance.rootElement,b,!0);for(var c=["SourceWidget","SourceEvent","TargetEvent"],d=["SourceEvent","TargetEvent"],e=0;ek;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 ."+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 ."+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 ."+ 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 ."+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\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,">");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="
";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