Logger.debug("Processing eviewImpl.js");
ServiceInfo=Class.create();
ServiceInfo.prototype={initialize:function(_1){
this.data=_1;
},getSelectionLayers:function(){
return this.data.layers.findAll(function(_2){
return _2.selectable||_2.identifiable;
});
},getLayer:function(_3){
return this.data.layers.find(function(_4){
return _4.name==_3;
});
},getLayerByLabel:function(_5){
return this.data.layers.find(function(_6){
return _6.label==_5;
});
},getQueriesForLayer:function(_7){
return this.data.queries.findAll(function(_8){
return _8.layer==_7;
});
},getQuery:function(_9,_a){
return this.data.queries.find(function(_b){
return (_b.label==_a&&_b.layer==_9);
});
},getQueryByName:function(_c){
return this.data.queries.find(function(_d){
return (_d.name==_c);
});
},getAttributeReportsForLayer:function(_e){
return this._getReportsForLayer(_e,"attribute");
},getMailMergeReportsForLayer:function(_f){
return this._getReportsForLayer(_f,"mailmerge");
},getPrintReportsForLayer:function(_10){
return this._getReportsForLayer(_10,"print");
},getMapReportsForLayer:function(_11){
return this._getReportsForLayer(_11,"map");
},getTab:function(_12){
return this.data.tabs.find(function(tab){
return tab.tabName==_12;
});
},getButton:function(_14){
return this.data.tabs.find(function(tab){
if(tab.tabName!="COMMON"){
return tab.buttons.find(function(_16){
return _16.buttonName==_14;
});
}
});
},_getReportsForLayer:function(_17,_18){
return this.data.reports.findAll(function(_19){
if(_17==null){
return _19.type==_18;
}else{
return _19.layer==_17&&_19.type==_18;
}
});
}};
MapProperties=Class.create();
MapProperties.prototype={initialize:function(){
this.selectionLayer=null;
this.highlight=null;
this.scale=-1;
this.checkScale=false;
this.imageWidth=-1;
this.imageHeight=-1;
this.extent=null;
this.drawMap=true;
this.drawLegend=false;
this.initialExtent=null;
this.limitExtent=null;
this.fullExtent=null;
this.backupExtent=null;
this.layers={};
}};
Logger.debug("Creating mapProperties");
var mapProperties=new MapProperties();
MapHistory=Class.create();
MapHistory.prototype={initialize:function(){
this.root=null;
this.curr=null;
this.insertNext=true;
this.mapHistoryChanged=new YAHOO.util.CustomEvent("MAP_HISTORY_CHANGED");
},insert:function(_1a){
if(!this.insertNext){
this.insertNext=true;
return;
}
if(this.root==null){
_1a.prev=null;
}else{
if(this.curr==_1a){
return;
}
this.curr.next=_1a;
_1a.prev=this.curr;
}
this.curr=_1a;
if(this.curr.prev==null){
this.root=this.curr;
}
this.mapHistoryChanged.fire();
},hasACurrent:function(){
return (this.curr!=null);
},hasANext:function(){
return (this.curr!=null&&this.curr.next!=null);
},hasAPrevious:function(){
return (this.curr!=null&&this.curr.prev!=null);
},current:function(){
return (this.curr==null?null:this.curr);
},next:function(){
return (this.curr==null||this.curr.next==null?null:this.curr.next);
},previous:function(){
return (this.curr==null||this.curr.prev==null?null:this.curr.prev);
},goHome:function(){
this.curr=this.root;
return (this.curr!=null);
},goForward:function(){
var ok=(this.curr.next!=null);
if(ok){
this.curr=this.curr.next;
this.mapHistoryChanged.fire();
}
return (ok);
},goBackward:function(){
var ok=(this.curr.prev!=null);
if(ok){
this.curr=this.curr.prev;
this.mapHistoryChanged.fire();
}
return (ok);
}};
function favButtonAdded(_1d,_1e){
var _1f=_1e[0];
var _20=new Object();
_20.requestName="savesession";
_20.favourite=_1f.button.buttonName;
_20.action="add";
EView.sendRequest(_20,function(_21){
});
}
function favButtonRemoved(_22,_23){
var _24=_23[0];
var _25=new Object();
_25.requestName="savesession";
_25.favourite=_24.button.buttonName;
_25.action="remove";
EView.sendRequest(_25,function(_26){
});
}
SelectionManager=Class.create();
SelectionManager.prototype={initialize:function(){
this.activeLayer=null;
this.layers=null;
this.reports=null;
this.selectionSizeEvent=new YAHOO.util.CustomEvent("SELECTION_SIZE_CHANGED");
this.selectionsChanged=new YAHOO.util.CustomEvent("SELECTION_CHANGED");
this.activeLayerEvent=new YAHOO.util.CustomEvent("ACTIVE_LAYER_CHANGED");
},updateSelections:function(_27){
selections=_27.selections;
var _28=this;
selections.each(function(_29){
var _2a=_28.getLayer(_29.name);
Logger.debug("updating the selections for layer: "+_29.name);
if(_2a==null){
Logger.warn("Could not find the layer for to update the selections of: "+_29.name);
}else{
_2a.selection=_29;
_28.selectionSizeEvent.fire(_2a);
}
});
this.selectionsChanged.fire();
},getLayer:function(_2b){
return this.layers.find(function(_2c){
return _2c.name==_2b;
});
},setActiveLayer:function(_2d){
this.activeLayer=_2d;
this.activeLayerEvent.fire(this.activeLayer);
},getActiveLayer:function(){
return this.activeLayer;
},isLayerSelectable:function(){
return this.activeLayer.selectable;
},getSelectionSize:function(){
if(!this.activeLayer.selection){
return 0;
}
return this.activeLayer.selection.size;
},areLayersDocumented:function(){
return this.layers.findAll(function(_2e){
return _2e.documented;
}).length>0;
},isLayerDocumented:function(){
return this.activeLayer.documented;
},isLayerExternal:function(){
return this.activeLayer.external;
},areReportsAvailable:function(_2f,_30){
return this.reports.findAll(function(_31){
if(_2f==null){
return _31.type==_30;
}else{
return _31.layer==_2f&&_31.type==_30;
}
}).length>0;
},isLayerGridded:function(_32){
if(_32==null){
return this.layers.findAll(function(_33){
return _33.grid;
}).length>0;
}else{
return this.getLayer(_32).grid;
}
}};
ListManager=Class.create();
ListManager.prototype={initialize:function(){
this._lists={};
},populateList:function(_34,_35,_36){
DWRUtil.removeAllOptions(_36);
DWRUtil.addOptions(_36,[" "]);
if(this._lists[_34]!=null){
this._listPopulator(this._lists[_34],_35,_36);
return;
}
var _37=new Object();
_37.requestName="serviceinfo";
_37.list=_34;
var _38=this;
EView.sendRequest(_37,function(_39){
_38._lists[_34]=_39.list;
_38._listPopulator(_39.list,_35,_36);
});
},_listPopulator:function(_3a,_3b,_3c){
if(_3b!=null){
DWRUtil.addOptions(_3c,_3a);
DWRUtil.setValue(_3c,_3b);
}else{
DWRUtil.addOptions(_3c,_3a);
}
}};
Logger.debug("Creating listManager");
var listManager=new ListManager();
Logger.debug("Creating mapHistory");
var mapHistory=new MapHistory();
Logger.debug("Creating selectionManager");
var selectionManager=new SelectionManager();
favouriteAdded.subscribe(favButtonAdded);
favouriteRemoved.subscribe(favButtonRemoved);
Logger.debug("Finished processing eviewImpl.js");


