//>>built define("dojox/atom/io/model",["dojo/_base/kernel","dojo/_base/declare","dojo/_base/lang","dojo/date/stamp","dojox/xml/parser"],function(_1,_2,_3,_4,_5){ var _6=_1.getObject("dojox.atom.io.model",true); _6._Constants={"ATOM_URI":"http://www.w3.org/2005/Atom","ATOM_NS":"http://www.w3.org/2005/Atom","PURL_NS":"http://purl.org/atom/app#","APP_NS":"http://www.w3.org/2007/app"}; _6._actions={"link":function(_7,_8){ if(_7.links===null){ _7.links=[]; } var _9=new _6.Link(); _9.buildFromDom(_8); _7.links.push(_9); },"author":function(_a,_b){ if(_a.authors===null){ _a.authors=[]; } var _c=new _6.Person("author"); _c.buildFromDom(_b); _a.authors.push(_c); },"contributor":function(_d,_e){ if(_d.contributors===null){ _d.contributors=[]; } var _f=new _6.Person("contributor"); _f.buildFromDom(_e); _d.contributors.push(_f); },"category":function(obj,_10){ if(obj.categories===null){ obj.categories=[]; } var cat=new _6.Category(); cat.buildFromDom(_10); obj.categories.push(cat); },"icon":function(obj,_11){ obj.icon=_5.textContent(_11); },"id":function(obj,_12){ obj.id=_5.textContent(_12); },"rights":function(obj,_13){ obj.rights=_5.textContent(_13); },"subtitle":function(obj,_14){ var cnt=new _6.Content("subtitle"); cnt.buildFromDom(_14); obj.subtitle=cnt; },"title":function(obj,_15){ var cnt=new _6.Content("title"); cnt.buildFromDom(_15); obj.title=cnt; },"updated":function(obj,_16){ obj.updated=_6.util.createDate(_16); },"issued":function(obj,_17){ obj.issued=_6.util.createDate(_17); },"modified":function(obj,_18){ obj.modified=_6.util.createDate(_18); },"published":function(obj,_19){ obj.published=_6.util.createDate(_19); },"entry":function(obj,_1a){ if(obj.entries===null){ obj.entries=[]; } var _1b=obj.createEntry?obj.createEntry():new _6.Entry(); _1b.buildFromDom(_1a); obj.entries.push(_1b); },"content":function(obj,_1c){ var cnt=new _6.Content("content"); cnt.buildFromDom(_1c); obj.content=cnt; },"summary":function(obj,_1d){ var _1e=new _6.Content("summary"); _1e.buildFromDom(_1d); obj.summary=_1e; },"name":function(obj,_1f){ obj.name=_5.textContent(_1f); },"email":function(obj,_20){ obj.email=_5.textContent(_20); },"uri":function(obj,_21){ obj.uri=_5.textContent(_21); },"generator":function(obj,_22){ obj.generator=new _6.Generator(); obj.generator.buildFromDom(_22); }}; _6.util={createDate:function(_23){ var _24=_5.textContent(_23); if(_24){ return _4.fromISOString(_3.trim(_24)); } return null; },escapeHtml:function(str){ return str.replace(/&/gm,"&").replace(//gm,">").replace(/"/gm,""").replace(/'/gm,"'"); },unEscapeHtml:function(str){ return str.replace(/</gm,"<").replace(/>/gm,">").replace(/"/gm,"\"").replace(/'/gm,"'").replace(/&/gm,"&"); },getNodename:function(_25){ var _26=null; if(_25!==null){ _26=_25.localName?_25.localName:_25.nodeName; if(_26!==null){ var _27=_26.indexOf(":"); if(_27!==-1){ _26=_26.substring((_27+1),_26.length); } } } return _26; }}; _6.Node=_1.declare(null,{constructor:function(_28,_29,_2a,_2b,_2c){ this.name_space=_28; this.name=_29; this.attributes=[]; if(_2a){ this.attributes=_2a; } this.content=[]; this.rawNodes=[]; this.textContent=null; if(_2b){ this.content.push(_2b); } this.shortNs=_2c; this._objName="Node"; this.nodeType="Node"; },buildFromDom:function(_2d){ this._saveAttributes(_2d); this.name_space=_2d.namespaceURI; this.shortNs=_2d.prefix; this.name=_6.util.getNodename(_2d); for(var x=0;x<_2d.childNodes.length;x++){ var c=_2d.childNodes[x]; if(_6.util.getNodename(c)!="#text"){ this.rawNodes.push(c); var n=new _6.Node(); n.buildFromDom(c,true); this.content.push(n); }else{ this.content.push(c.nodeValue); } } this.textContent=_5.textContent(_2d); },_saveAttributes:function(_2e){ if(!this.attributes){ this.attributes=[]; } var _2f=function(_30){ var _31=_30.attributes; if(_31===null){ return false; } return (_31.length!==0); }; if(_2f(_2e)&&this._getAttributeNames){ var _32=this._getAttributeNames(_2e); if(_32&&_32.length>0){ for(var x in _32){ var _33=_2e.getAttribute(_32[x]); if(_33){ this.attributes[_32[x]]=_33; } } } } },addAttribute:function(_34,_35){ this.attributes[_34]=_35; },getAttribute:function(_36){ return this.attributes[_36]; },_getAttributeNames:function(_37){ var _38=[]; for(var i=0;i<_37.attributes.length;i++){ _38.push(_37.attributes[i].nodeName); } return _38; },toString:function(){ var xml=[]; var x; var _39=(this.shortNs?this.shortNs+":":"")+this.name; var _3a=(this.name=="#cdata-section"); if(_3a){ xml.push(""); }else{ xml.push("<"); xml.push(_39); if(this.name_space){ xml.push(" xmlns='"+this.name_space+"'"); } if(this.attributes){ for(x in this.attributes){ xml.push(" "+x+"='"+this.attributes[x]+"'"); } } if(this.content){ xml.push(">"); for(x in this.content){ xml.push(this.content[x]); } xml.push("\n"); }else{ xml.push("/>\n"); } } return xml.join(""); },addContent:function(_3b){ this.content.push(_3b); }}); _6.AtomItem=_1.declare(_6.Node,{constructor:function(_3c){ this.ATOM_URI=_6._Constants.ATOM_URI; this.links=null; this.authors=null; this.categories=null; this.contributors=null; this.icon=this.id=this.logo=this.xmlBase=this.rights=null; this.subtitle=this.title=null; this.updated=this.published=null; this.issued=this.modified=null; this.content=null; this.extensions=null; this.entries=null; this.name_spaces={}; this._objName="AtomItem"; this.nodeType="AtomItem"; },_getAttributeNames:function(){ return null; },_accepts:{},accept:function(tag){ return Boolean(this._accepts[tag]); },_postBuild:function(){ },buildFromDom:function(_3d){ var i,c,n; for(i=0;i<_3d.attributes.length;i++){ c=_3d.attributes.item(i); n=_6.util.getNodename(c); if(c.prefix=="xmlns"&&c.prefix!=n){ this.addNamespace(c.nodeValue,n); } } c=_3d.childNodes; for(i=0;i\n"); return s.join(""); },buildFromDom:function(_61){ this._saveAttributes(_61); this.label=this.attributes.label; this.scheme=this.attributes.scheme; this.term=this.attributes.term; if(this._postBuild){ this._postBuild(); } }}); _6.Content=_1.declare(_6.Node,{constructor:function(_62,_63,src,_64,_65){ this.tagName=_62; this.value=_63; this.src=src; this.type=_64; this.xmlLang=_65; this.HTML="html"; this.TEXT="text"; this.XHTML="xhtml"; this.XML="xml"; this._useTextContent="true"; this.nodeType="Content"; },_getAttributeNames:function(){ return ["type","src"]; },_postBuild:function(){ },buildFromDom:function(_66){ var _67=_66.getAttribute("type"); if(_67){ _67=_67.toLowerCase(); if(_67=="xml"||"text/xml"){ _67=this.XML; } }else{ _67="text"; } if(_67===this.XML){ if(_66.firstChild){ var i; this.value=""; for(i=0;i<_66.childNodes.length;i++){ var c=_66.childNodes[i]; if(c){ this.value+=_5.innerXML(c); } } } }else{ if(_66.innerHTML){ this.value=_66.innerHTML; }else{ this.value=_5.textContent(_66); } } this._saveAttributes(_66); if(this.attributes){ this.type=this.attributes.type; this.scheme=this.attributes.scheme; this.term=this.attributes.term; } if(!this.type){ this.type="text"; } var _68=this.type.toLowerCase(); if(_68==="html"||_68==="text/html"||_68==="xhtml"||_68==="text/xhtml"){ this.value=this.value?_6.util.unEscapeHtml(this.value):""; } if(this._postBuild){ this._postBuild(); } },toString:function(){ var s=[]; s.push("<"+this.tagName+" "); if(!this.type){ this.type="text"; } if(this.type){ s.push(" type=\""+this.type+"\" "); } if(this.xmlLang){ s.push(" xml:lang=\""+this.xmlLang+"\" "); } if(this.xmlBase){ s.push(" xml:base=\""+this.xmlBase+"\" "); } if(this.type.toLowerCase()==this.HTML){ s.push(">"+_6.util.escapeHtml(this.value)+"\n"); }else{ s.push(">"+this.value+"\n"); } var ret=s.join(""); return ret; }}); _6.Link=_1.declare(_6.Node,{constructor:function(_69,rel,_6a,_6b,_6c){ this.href=_69; this.hrefLang=_6a; this.rel=rel; this.title=_6b; this.type=_6c; this.nodeType="Link"; },_getAttributeNames:function(){ return ["href","jrefLang","rel","title","type"]; },_postBuild:function(){ },buildFromDom:function(_6d){ this._saveAttributes(_6d); this.href=this.attributes.href; this.hrefLang=this.attributes.hreflang; this.rel=this.attributes.rel; this.title=this.attributes.title; this.type=this.attributes.type; if(this._postBuild){ this._postBuild(); } },toString:function(){ var s=[]; s.push("\n"); return s.join(""); }}); _6.Person=_1.declare(_6.Node,{constructor:function(_6e,_6f,_70,uri){ this.author="author"; this.contributor="contributor"; if(!_6e){ _6e=this.author; } this.personType=_6e; this.name=_6f||""; this.email=_70||""; this.uri=uri||""; this._objName="Person"; this.nodeType="Person"; },_getAttributeNames:function(){ return null; },_postBuild:function(){ },accept:function(tag){ return Boolean(this._accepts[tag]); },buildFromDom:function(_71){ var c=_71.childNodes; for(var i=0;i\n"); if(this.name){ s.push("\t"+this.name+"\n"); } if(this.email){ s.push("\t"+this.email+"\n"); } if(this.uri){ s.push("\t"+this.uri+"\n"); } s.push("\n"); return s.join(""); }}); _6.Generator=_1.declare(_6.Node,{constructor:function(uri,_74,_75){ this.uri=uri; this.version=_74; this.value=_75; },_postBuild:function(){ },buildFromDom:function(_76){ this.value=_5.textContent(_76); this._saveAttributes(_76); this.uri=this.attributes.uri; this.version=this.attributes.version; if(this._postBuild){ this._postBuild(); } },toString:function(){ var s=[]; s.push(""+this.value+"\n"); var ret=s.join(""); return ret; }}); _6.Entry=_1.declare(_6.AtomItem,{constructor:function(id){ this.id=id; this._objName="Entry"; this.feedUrl=null; },_getAttributeNames:function(){ return null; },_accepts:{"author":true,"content":true,"category":true,"contributor":true,"created":true,"id":true,"link":true,"published":true,"rights":true,"summary":true,"title":true,"updated":true,"xmlbase":true,"issued":true,"modified":true},toString:function(_77){ var s=[]; var i; if(_77){ s.push(""); s.push("\n"); s.push(""+(this.id?this.id:"")+"\n"); if(this.issued&&!this.published){ this.published=this.issued; } if(this.published){ s.push(""+_4.toISOString(this.published)+"\n"); } if(this.created){ s.push(""+_4.toISOString(this.created)+"\n"); } if(this.issued){ s.push(""+_4.toISOString(this.issued)+"\n"); } if(this.modified){ s.push(""+_4.toISOString(this.modified)+"\n"); } if(this.modified&&!this.updated){ this.updated=this.modified; } if(this.updated){ s.push(""+_4.toISOString(this.updated)+"\n"); } if(this.rights){ s.push(""+this.rights+"\n"); } if(this.title){ s.push(this.title.toString()); } if(this.summary){ s.push(this.summary.toString()); } var _78=[this.authors,this.categories,this.links,this.contributors,this.extensions]; for(var x in _78){ if(_78[x]){ for(var y in _78[x]){ s.push(_78[x][y]); } } } if(this.content){ s.push(this.content.toString()); } s.push("\n"); return s.join(""); },getEditHref:function(){ if(this.links===null||this.links.length===0){ return null; } for(var x in this.links){ if(this.links[x].rel&&this.links[x].rel=="edit"){ return this.links[x].href; } } return null; },setEditHref:function(url){ if(this.links===null){ this.links=[]; } for(var x in this.links){ if(this.links[x].rel&&this.links[x].rel=="edit"){ this.links[x].href=url; return; } } this.addLink(url,"edit"); }}); _6.Feed=_1.declare(_6.AtomItem,{_accepts:{"author":true,"content":true,"category":true,"contributor":true,"created":true,"id":true,"link":true,"published":true,"rights":true,"summary":true,"title":true,"updated":true,"xmlbase":true,"entry":true,"logo":true,"issued":true,"modified":true,"icon":true,"subtitle":true},addEntry:function(_79){ if(!_79.id){ throw new Error("The entry object must be assigned an ID attribute."); } if(!this.entries){ this.entries=[]; } _79.feedUrl=this.getSelfHref(); this.entries.push(_79); },getFirstEntry:function(){ if(!this.entries||this.entries.length===0){ return null; } return this.entries[0]; },getEntry:function(_7a){ if(!this.entries){ return null; } for(var x in this.entries){ if(this.entries[x].id==_7a){ return this.entries[x]; } } return null; },removeEntry:function(_7b){ if(!this.entries){ return; } var _7c=0; for(var i=0;i\n"); s.push("\n"); s.push(""+(this.id?this.id:"")+"\n"); if(this.title){ s.push(this.title); } if(this.copyright&&!this.rights){ this.rights=this.copyright; } if(this.rights){ s.push(""+this.rights+"\n"); } if(this.issued){ s.push(""+_4.toISOString(this.issued)+"\n"); } if(this.modified){ s.push(""+_4.toISOString(this.modified)+"\n"); } if(this.modified&&!this.updated){ this.updated=this.modified; } if(this.updated){ s.push(""+_4.toISOString(this.updated)+"\n"); } if(this.published){ s.push(""+_4.toISOString(this.published)+"\n"); } if(this.icon){ s.push(""+this.icon+"\n"); } if(this.language){ s.push(""+this.language+"\n"); } if(this.logo){ s.push(""+this.logo+"\n"); } if(this.subtitle){ s.push(this.subtitle.toString()); } if(this.tagline){ s.push(this.tagline.toString()); } var _7e=[this.alternateLinks,this.authors,this.categories,this.contributors,this.otherLinks,this.extensions,this.entries]; for(i in _7e){ if(_7e[i]){ for(var x in _7e[i]){ s.push(_7e[i][x]); } } } s.push(""); return s.join(""); },createEntry:function(){ var _7f=new _6.Entry(); _7f.feedUrl=this.getSelfHref(); return _7f; },getSelfHref:function(){ if(this.links===null||this.links.length===0){ return null; } for(var x in this.links){ if(this.links[x].rel&&this.links[x].rel=="self"){ return this.links[x].href; } } return null; }}); _6.Service=_1.declare(_6.AtomItem,{constructor:function(_80){ this.href=_80; },buildFromDom:function(_81){ var i; this.workspaces=[]; if(_81.tagName!="service"){ return; } if(_81.namespaceURI!=_6._Constants.PURL_NS&&_81.namespaceURI!=_6._Constants.APP_NS){ return; } var ns=_81.namespaceURI; this.name_space=_81.namespaceURI; var _82; if(typeof (_81.getElementsByTagNameNS)!="undefined"){ _82=_81.getElementsByTagNameNS(ns,"workspace"); }else{ _82=[]; var _83=_81.getElementsByTagName("workspace"); for(i=0;i<_83.length;i++){ if(_83[i].namespaceURI==ns){ _82.push(_83[i]); } } } if(_82&&_82.length>0){ var _84=0; var _85; for(i=0;i<_82.length;i++){ _85=(typeof (_82.item)==="undefined"?_82[i]:_82.item(i)); var _86=new _6.Workspace(); _86.buildFromDom(_85); this.workspaces[_84++]=_86; } } },getCollection:function(url){ for(var i=0;i