amalgame/commit

start cleaning up focus node versus selected node confusions

authorJacco van Ossenbruggen
Fri Nov 11 17:50:45 2016 +0100
committerJacco van Ossenbruggen
Fri Nov 11 17:50:45 2016 +0100
commitaaa04810f66b5e86211be5d5f7620e5cd8eb0aaf
tree70df248bde2190e0bb23eaf8e8b56d200e385cfc
parentaef09c6e5acb5aaf13c52e38b828fefeea3d826c
Diff style: patch stat
diff --git a/applications/builder.pl b/applications/builder.pl
index 9df72fd..84ec3b6 100644
--- a/applications/builder.pl
+++ b/applications/builder.pl
@@ -179,7 +179,7 @@ yui_script(Strategy, Focus) -->
 			 json{strategy:Strategy,
 			       paths:PathD,
 			       nodes:Nodes,
-			       selected:FocusNode,
+			       focus:FocusNode,
 			       readonly:Read_only
 			     })
 	     ]).
diff --git a/applications/evaluater.pl b/applications/evaluater.pl
index ecdebb5..88ef434 100644
--- a/applications/evaluater.pl
+++ b/applications/evaluater.pl
@@ -105,11 +105,12 @@ html_sidebar -->
 %
 %	Emit YUI object.
 
-yui_script(Strategy, Mapping) -->
+yui_script(Strategy, Focus) -->
 	{ findall(K-V, js_path(K, V), Paths),
 	  findall(M-C, js_module(M,C), Modules),
 	  pairs_keys(Modules, Includes),
-	  (   is_reference_mapping(Strategy, Mapping)
+	  js_focus_node(Strategy, Focus, FocusNode),
+	  (   is_reference_mapping(Strategy, Focus)
 	  ->  js_mappings_metadata(Strategy, Mappings, [references(only)])
 	  ;   js_mappings_metadata(Strategy, Mappings, [references(exclude)])
 	  )
@@ -123,7 +124,7 @@ yui_script(Strategy, Mapping) -->
 			 config{strategy:Strategy,
 			       paths:json(Paths),
 			       mappings:Mappings,
-			       selected:Mapping
+			       focus:FocusNode
 			       })
 	     ]).
 
diff --git a/web/js/builder.js b/web/js/builder.js
index 5ad2616..3dacc76 100644
--- a/web/js/builder.js
+++ b/web/js/builder.js
@@ -18,7 +18,7 @@ YUI.add('builder', function(Y) {
 		strategy: { value: null },
 		readonly: { value: true },
 		paths:    { value: {} },
-		selected: { value: {} },
+		focus:    { value: {} },
 		nodes:    { value: {} },
 		currentConcept: { value: null } // selected concept from SKOS browser
 	};
@@ -47,7 +47,7 @@ YUI.add('builder', function(Y) {
 			this.infobox.after("nodeUpdate", this._onNodeUpdate, this);
 			this.infobox.on("evaluate", this._onEvaluate, this);     // used for hints
 			this.infobox.on("submit", this._onControlSubmit, this);  // used for hints
-			this.infobox.on("nodeSelect", this._onSelectedChange, this); // used for hints
+			this.infobox.on("nodeSelect", this._onFocusChange, this); // used for hints
 
 			// handlers for graph and mapping
 			this.strategy_viz.on("nodeSelect", this._onNodeSelect, this);
@@ -62,16 +62,17 @@ YUI.add('builder', function(Y) {
 				this.controls.set("nodes", nodes);
 			}, this);
 
-			this.on("selectedChange", this._onSelectedChange, this);
+			this.on("focusChange", this._onFocusChange, this);
 		},
 
-		_onSelectedChange: function(o) {
-			var selected = o.newVal?o.newVal:o.data.newVal ;
-			this.strategy_viz.set("selected", selected);
-			this.infobox.set("selected", selected);
-			this.controls.set("selected", selected);
-			this.mapping.set("selected", selected);
-			this.vocabulary.set("selected", selected);
+		_onFocusChange: function(o) {
+			Y.log("_onFocusChange"); Y.log(o);
+			var focus = o.newVal?o.newVal:o.data.newVal ;
+			this.strategy_viz.set("focus", focus);
+			this.infobox.set("focus", focus);
+			this.controls.set("focus", focus);
+			this.mapping.set("focus", focus);
+			this.vocabulary.set("focus", focus);
 		},
 
 		onWindowResize : function() {
@@ -117,7 +118,7 @@ YUI.add('builder', function(Y) {
 			this.strategy_viz = new Y.StratViz({
 				paths:this.get("paths"),
 				strategy: this.get("strategy"),
-				selected: this.get("selected")
+				focus: this.get("focus")
 			}).render(NODE_GRAPH);
 		},
 
@@ -126,7 +127,7 @@ YUI.add('builder', function(Y) {
 				srcNode: NODE_INFO,
 				strategy: this.get("strategy"),
 				nodes: this.get("nodes"),
-				selected: this.get("selected"),
+				focus: this.get("focus"),
 				readonly: this.get('readonly'),
 				paths: this.get("paths")
 			});
@@ -135,7 +136,7 @@ YUI.add('builder', function(Y) {
 		_initControls : function() {
 			this.controls = new Y.Controls({
 				srcNode: NODE_CONTROLS,
-				selected: this.get("selected"),
+				focus: this.get("focus"),
 				nodes: this.get("nodes")
 			});
 		},
@@ -145,14 +146,14 @@ YUI.add('builder', function(Y) {
 				builder: this,
 				paths: this.get("paths"),
 				strategy: this.get("strategy"),
-				selected: this.get("selected")
+				focus: this.get("focus")
 			});
 		},
 		
 		_initVocabulary : function() {
 			this.vocabulary = new Y.Vocabulary({
 				paths:this.get("paths"),
-				selected: this.get("selected"),
+				focus: this.get("focus"),
 				strategy: this.get("strategy")
 			});
 			this.vocabulary.on("conceptChange", this._onConceptChange, this);
@@ -197,7 +198,7 @@ YUI.add('builder', function(Y) {
 					// setting the properties will then initiate the components
 					// to fetch the latests stats
 					oSelf.set("nodes", r.nodes);
-					oSelf.set("selected", r.focus);
+					oSelf.set("focus", r.focus);
 				}}
 			});
 		},
@@ -214,7 +215,7 @@ YUI.add('builder', function(Y) {
 				on:{success:function(e,o) {
 					var r = Y.JSON.parse(o.responseText);
 					oSelf.set("nodes", r.nodes);
-					oSelf.set("selected", r.focus);
+					oSelf.set("focus", r.focus);
 					if (!data.strategy == r.strategy) {
 						// strategy changed name, we need to fully reload ...
 						var l = window.location;
@@ -241,7 +242,7 @@ YUI.add('builder', function(Y) {
 				on:{success:function(e,o) {
 					var r = Y.JSON.parse(o.responseText);
 					oSelf.set("nodes", r.nodes);
-					oSelf.set("selected", r.focus);
+					oSelf.set("focus", r.focus);
 				}}
 			})
 		},
@@ -249,8 +250,6 @@ YUI.add('builder', function(Y) {
 		_onNodeSelect : function(e) {
 			this.infobox.set('loading', true);
 			this.updateNodeList(e.uri);
-			// var selected = this.get("nodes")[e.uri];
-			// this.set("selected", selected);
 		},
 
 		updateNodeList : function(nodeURI) {
@@ -263,7 +262,7 @@ YUI.add('builder', function(Y) {
 				on:{success:function(e,o) {
 					   var nodes = Y.JSON.parse(o.responseText);
 					   oSelf.set("nodes", nodes);
-					   oSelf.set("selected", nodes[nodeURI]);
+					   oSelf.set("focus", nodes[nodeURI]);
 			 	}}
 			})
 		},
diff --git a/web/js/controls.js b/web/js/controls.js
index 3d937b1..10c108e 100644
--- a/web/js/controls.js
+++ b/web/js/controls.js
@@ -21,7 +21,7 @@ YUI.add('controls', function(Y) {
 	Controls.NAME = "controls";
 	Controls.ATTRS = {
 		srcNode: { value: null },
-		selected: { value: null }, // selected node
+		focus: { value: null }, // focus node
 		currentConcept: { value: null }, // selected concept from SKOS browser
 		nodes: { value: [] }
 	};
@@ -64,8 +64,8 @@ YUI.add('controls', function(Y) {
 			NODE_CONCEPT_INPUTS.on('focus', this.currentConceptChange, this);
 			this.after('currentConceptChange', this.currentConceptChange, this);
 
-			// toggle the controls when selected is changed
-			this.after('selectedChange', this.syncUI, this);
+			// toggle the controls when focus is changed
+			this.after('focusChange', this.syncUI, this);
 			this.after('nodesChange', this.syncUI, this);
 			this.after('nodesChange', function(e) { Y.log('nodesChange in controls'); Y.log(e);});
 
@@ -95,7 +95,7 @@ YUI.add('controls', function(Y) {
 				input = NODE_INPUT.get("value"),
 				source = NODE_SOURCE.get("value"),
 				target = NODE_TARGET.get("value"),
-				selected = this.get("selected"),
+				focus = this.get("focus"),
 				data = this._getFormData(node);
 
 			// The input is selected based on the type of the control
@@ -104,8 +104,8 @@ YUI.add('controls', function(Y) {
 			    node.hasClass("preloaded") ) {
 				data.source = source;
 				data.target = target;
-			} else if(selected) {
-				data.input = selected.uri;
+			} else if(focus) {
+				data.input = focus.uri;
 			}
 			Y.log(data);
 			this.fire("submit", {data:data});
@@ -158,11 +158,11 @@ YUI.add('controls', function(Y) {
 		},
 
 		syncUI : function() {
-			var selected = this.get("selected");
-			type = selected ? selected.type : "";
+			var focus = this.get("focus");
+			type = focus ? focus.type : "";
 			Y.log('syncUI controls');
+			Y.log(focus);
 			Y.log(type);
-			Y.log(selected);
 
 			// add mapping selection radio buttons with available mappings to components that need them
 			this._setMappingSelecter();
@@ -192,10 +192,10 @@ YUI.add('controls', function(Y) {
 				NODE_TARGET_BTN.removeAttribute("disabled");
 				var current =  Y.one("#sourceLabel").get("value");
 				if (!current) {
-				  // auto set source to selected if no source yet:
-				  this._valueSet(selected, "source");
+				  // auto set source to focus if no source yet:
+				  this._valueSet(focus, "source");
 				}
-				var target = this._findOnlyOtherVocab(selected);
+				var target = this._findOnlyOtherVocab(focus);
 				if (target) {
 				  // auto set target if only one other vocab exists:
 				  this._valueSet(target, "target");
@@ -203,7 +203,7 @@ YUI.add('controls', function(Y) {
 			}
 			if(type=="mapping" || type=="vocab" ) { 
 				 NODE_INPUT_BTN.removeAttribute("disabled");
-				 this._valueSet(selected, "input");
+				 this._valueSet(focus, "input");
 			}
 
 			var preloadedSelecter = Y.one(".preloaded select option")
@@ -271,16 +271,16 @@ YUI.add('controls', function(Y) {
 
 
 		_valueSetAndSyncUI: function(e, which) {
-		       var selected =  this.get("selected");
-		       this._valueSet(selected, which);
+		       var focus =  this.get("focus");
+		       this._valueSet(focus, which);
 		       this.syncUI();
 		},
 
-		_valueSet : function(selected, which) {
-			if(selected) {
-				if (which != 'target') this._setLanguageOptions(selected, which);
-				Y.one("#"+which+'Label').set("value", selected.label);
-				Y.one("#"+which).set("value", selected.uri);
+		_valueSet : function(focus, which) {
+			if(focus) {
+				if (which != 'target') this._setLanguageOptions(focus, which);
+				Y.one("#"+which+'Label').set("value", focus.label);
+				Y.one("#"+which).set("value", focus.uri);
 			}
 		},
 
diff --git a/web/js/evaluater.js b/web/js/evaluater.js
index 88a267c..fc0afff 100644
--- a/web/js/evaluater.js
+++ b/web/js/evaluater.js
@@ -20,7 +20,7 @@ YUI.add('evaluater', function(Y) {
 		strategy:   { value: null  },
 		paths:      { value: {}    },
 		mappings:   { value: {}    },
-		selected:   { value: null  },
+		focus:      { value: null  },
 		editmode:   { value: 'eval'}, // or edit. 
 		allsources: { value: false },
 		alltargets: { value: false }
@@ -50,28 +50,28 @@ YUI.add('evaluater', function(Y) {
 			NODE_SOURCE_ALL.on("click", this._fetchDetail, this);
 			NODE_TARGET_ALL.on("click", this._fetchDetail, this);
 
-			var selected = this.get('selected');
-			if (selected) {
-				var isReference =this.get('mappings')[selected].agStatus == 'reference' 
-				this.mappinglist.fire('mappingSelect', {uri:selected, isReference:isReference});
+			var uri = this.get('focus').uri;
+			if (uri) {
+				var isReference =this.get('mappings')[uri].agStatus == 'reference' 
+				this.mappinglist.fire('mappingSelect', {uri:uri, isReference:isReference});
 			}
 
 		},
 
 		_initInfo : function() {
-			var selected = this.get("selected");
+			var focus = this.get("focus");
 			this.infoDS = new Y.DataSource.IO({
 				source: this.get("paths").mappinginfo
 			});
-			if(selected) {
-				this._fetchInfo(selected);
+			if(focus) {
+				this._fetchInfo(focus);
 			}
 		},
 
 		_initList : function() {
 			this.mappinglist = new Y.MappingList({
 				mappings:this.get("mappings"),
-				selected:this.get("selected")
+				focus:this.get("focus")
 			}).render(NODE_MAPPING_LIST);
 			this.on('mappingsChange', function(e) { 
 				this.mappinglist.set('mappings', e.newVal); 
@@ -95,13 +95,12 @@ YUI.add('evaluater', function(Y) {
 					}
 			}
 			});
-
 			this.mappingtable = new Y.MappingTable({
 				srcNode: NODE_MAPPING_TABLE,
 				datasource:DS,
 				showRelation:true,
 				strategy: this.get("strategy"),
-				focus:this.get("selected")
+				focus:this.get("focus")
 			});
 		},
 
@@ -114,8 +113,9 @@ YUI.add('evaluater', function(Y) {
 		},
 
 		_onMappingSelect : function(e) {
+			focus = this.get("mappings")[e.uri];
 			if (e.isReference) this.set('editmode', "edit"); else this.set('editmode', "eval");
-			this.set("selected", e.uri);
+			this.set("focus", focus);
 			this.detailOverlay.set("visible", false);
 			this._fetchInfo(e.uri);
 			this.mappingtable.set("mapping", e.uri);
@@ -140,8 +140,9 @@ YUI.add('evaluater', function(Y) {
 			this.detailOverlay.set("visible", false);
 			var cs = this._getSelection();
 			var c = cs[0];
-			c.strategy = this.get("strategy");
-			c.mapping   = this.get("selected");
+			c.strategy  = this.get("strategy");
+			c.focus     = this.get("focus");
+			c.mapping   = this.get("focus").uri;
 			c.editmode  = this.get("editmode");
 			c.applyTo   = nav == "setall"?"all":"one";
 			c.remove    = nav == "delete";
@@ -234,7 +235,7 @@ YUI.add('evaluater', function(Y) {
 					} else { // applyTo == setall or !conceptsUnchanged
 			  			oSelf.mappingtable.loadData(); // reload if too much has changed
 					}
-					oSelf._fetchInfo(c.mapping);
+					oSelf._fetchInfo(c.focus);
 					if (r.mapping.uri && r.mapping.stats) {
 						mappings[r.mapping.uri].stats = r.mapping.stats;
 					       	oSelf.set("mappings", mappings);
@@ -243,10 +244,10 @@ YUI.add('evaluater', function(Y) {
 			});
 		},
 
-		_fetchInfo : function(uri) {
-			if(uri) {
+		_fetchInfo : function(focus) {
+			if(focus.uri) {
 				this.infoDS.sendRequest({
-					request:'?url='+uri+'&strategy='+this.get("strategy"),
+					request:'?url='+focus.uri+'&strategy='+this.get("strategy"),
 					callback:{success:function(o) {
 						var HTML = o.response.results[0].responseText;
 						NODE_INFO.setContent(HTML);
@@ -272,7 +273,7 @@ YUI.add('evaluater', function(Y) {
 			// call the server
 			var data = {
 				strategy:  this.get("strategy"),
-				mapping:   this.get("selected"),
+				mapping:   this.get("focus").uri,
 				source:    this._source,
 				target:    this._target,
 				fillmode:  'fill-in',
@@ -318,9 +319,9 @@ YUI.add('evaluater', function(Y) {
 			// Activate skos autocompletion on sourceuri, targeturi input nodes:	
 			var paths    = this.get("paths");
 			var mappings = this.get('mappings');
-			var selected = this.get('selected');
-			var svoc = encodeURIComponent(mappings[selected].stats.vocs.source.uri);
-			var tvoc = encodeURIComponent(mappings[selected].stats.vocs.target.uri);
+			var uri = this.get('focus').uri;
+			var svoc = encodeURIComponent(mappings[uri].stats.vocs.source.uri);
+			var tvoc = encodeURIComponent(mappings[uri].stats.vocs.target.uri);
 			var SourceConfig = { 
 				// our skos-specific ac attrs:
 				caller: this,
diff --git a/web/js/infobox.js b/web/js/infobox.js
index b9b3e2b..f8831b9 100644
--- a/web/js/infobox.js
+++ b/web/js/infobox.js
@@ -50,7 +50,7 @@ YUI.add('infobox', function(Y) {
 		nodes : {
 			value: null
 		},
-		selected: {
+		focus: {
 			value: null
 		}
 	};
@@ -59,7 +59,7 @@ YUI.add('infobox', function(Y) {
 
 		initializer : function(config) {
 			var content = this.get("srcNode"),
-				selected = this.get("selected"),
+				focus = this.get("focus"),
 				nodes = this.get("nodes");
 
 			this.bd = content.one('.bd');
@@ -71,7 +71,7 @@ YUI.add('infobox', function(Y) {
 			NODE_UPDATE.on("click", this._onNodeUpdate, this);
 			NODE_EVAL.on("click", this._onNodeEvaluate, this);
 
-			this.after('selectedChange', this.syncUI, this);
+			this.after('focusChange', this.syncUI, this);
 			this.on('loadingChange', this._onLoadingChange, this);
 
 			this.syncUI();
@@ -80,17 +80,17 @@ YUI.add('infobox', function(Y) {
 		syncUI : function() {
 			var oSelf = this,
 				paths = this.get("paths"),
-				selected = this.get("selected"),
+				focus = this.get("focus"),
 				strategy = this.get("strategy");
 
 			// update the node properties that we already have
-			this._setProperties(selected);
+			this._setProperties(focus);
 
 			// fetch new info
 			this.set("loading", true);
 			Y.io(paths.info, {
 				data: {
-					'url':selected.uri,
+					'url':focus.uri,
 					'strategy':strategy
 				},
 				on:{
@@ -120,7 +120,7 @@ YUI.add('infobox', function(Y) {
 		},
 
 		_onNodeUpdate : function() {
-			var sel = this.get("selected"),
+			var sel = this.get("focus"),
 				uri = sel.uri,
 				namespace = NODE_NAMESPACE.get("value"),
 				label = NODE_LABEL.get("value"),
@@ -147,7 +147,7 @@ YUI.add('infobox', function(Y) {
 		},
 
 		_onNodeDelete : function() {
-			var uri = this.get("selected").uri;
+			var uri = this.get("focus").uri;
 			this.set("lastAction", "nodeDelete");
 			Y.log("delete node: "+uri);
 			this.fire("deleteNode", {uri:uri});
@@ -156,7 +156,7 @@ YUI.add('infobox', function(Y) {
 		},
 
 		_onNodeEvaluate : function() {
-			var uri = this.get("selected").uri;
+			var uri = this.get("focus").uri;
 			this.set("lastAction", "nodeEvaluate");
 			Y.log("evaluate node: "+uri);
 			this.fire("evaluate", {data:{focus:uri}});
@@ -170,7 +170,7 @@ YUI.add('infobox', function(Y) {
 
 		_onDeepStats : function(e) {
 				 e.currentTarget.set('innerHTML', 'computing statistics ...');
-				 var voc = this.get("selected").uri;
+				 var voc = this.get("focus").uri;
 				 var paths = this.get("paths");
 				 var strategy = this.get("strategy");
 				 var oSelf = this;
@@ -189,22 +189,22 @@ YUI.add('infobox', function(Y) {
 
 		 },
 
-		_setProperties : function(selected) {
+		_setProperties : function(focus) {
 			var strategy = this.get("strategy"),
 				content = this.get("srcNode");
 
-			if(selected) {
-				var uri = selected.uri,
-					link = selected.link||uri,
-					local = selected.local||uri,
-					label = selected.label||uri,
-					type = selected.type||"",
-					comment = selected.comment||"",
-					abbrev = selected.abbrev||"?",
-					namespace = selected.namespace||"",
-					status = selected.status || "",
-					relation = selected.default_relation || "",
-					sec_inputs = selected.secondary_inputs|| [];
+			if(focus) {
+				var uri = focus.uri,
+					link = focus.link||uri,
+					local = focus.local||uri,
+					label = focus.label||uri,
+					type = focus.type||"",
+					comment = focus.comment||"",
+					abbrev = focus.abbrev||"?",
+					namespace = focus.namespace||"",
+					status = focus.status || "",
+					relation = focus.default_relation || "",
+					sec_inputs = focus.secondary_inputs|| [];
 
 				this.emptyNode.addClass("hidden");
 				NODE_DELETE.removeAttribute("disabled");
@@ -267,7 +267,7 @@ YUI.add('infobox', function(Y) {
 
 		_createHint : function() {
 				var oSelf = this;
-				var focus = this.get("selected").uri
+				var focus = this.get("focus").uri
 				NODE_HINT.setContent('Loading next hint, please wait...');
 				Y.io(this.get("paths").hint,
 				     {
@@ -300,7 +300,7 @@ YUI.add('infobox', function(Y) {
 
 		_updateParameters : function() {
 			var paramnode = this.get("srcNode").one('.parameters'),
-				sec_inputs = this.get("selected").secondary_inputs || [];
+				sec_inputs = this.get("focus").secondary_inputs || [];
 
 			if (paramnode && sec_inputs.length > 0) {
 			  paramnode.prepend(this.formatMappingList(sec_inputs));
@@ -308,7 +308,7 @@ YUI.add('infobox', function(Y) {
 			}
 		},
 
-		formatMappingList : function(selected) {
+		formatMappingList : function(focus) {
 			var HTML = "";
 			var nodes = this.get("nodes");
 			for (var uri in nodes) {
@@ -319,7 +319,7 @@ YUI.add('infobox', function(Y) {
 					label = m.label + ' (' + m.local +')';
 				}
 				if(m.type == "mapping") {
-					var index = selected.indexOf(uri);
+					var index = focus.indexOf(uri);
 					var checked = (index == -1)?'':'checked';
 					HTML += '<div><input type="checkbox" name="secondary_input" value="'
 					+uri+'" ' +checked +' class="' + checked +'">'
diff --git a/web/js/mapping.js b/web/js/mapping.js
index 0fa986a..1366859 100644
--- a/web/js/mapping.js
+++ b/web/js/mapping.js
@@ -16,8 +16,8 @@ YUI.add('mapping', function(Y) {
 	Mapping.NAME = "mapping";
 	Mapping.ATTRS = {
 		strategy : { value: null },
- 		selected : { value: null },
- 		builder : { value: null },
+ 		focus    : { value: null },
+ 		builder  : { value: null },
 		paths:{
 			value:{
 				mapping:"/amalgame/data/mapping",
@@ -41,7 +41,7 @@ YUI.add('mapping', function(Y) {
 			NODE_MAPPING_TABLE.addClass("hidden");
 			
 			// bind the modules
-			this.after("selectedChange", this._onSelectedChange, this);
+			this.after("focusChange", this._onSelectedChange, this);
 			this.mappingtable.on("rowSelect", this._onCorrespondenceSelect, this);
 
 			NODE_DETAIL.all(".next").on("click", this._onSubmit, this, "next");
@@ -54,8 +54,8 @@ YUI.add('mapping', function(Y) {
 		},
 
 		_initTable : function() {
-			var selected = this.get("selected"),
-				mapping = (selected.type=="mapping") ? selected.uri : null;
+			var focus = this.get("focus");
+			if (focus.type != "mapping") focus = null;
 				
 			// We define a datasource to simplify
 			// access to the mappings later and add caching support
@@ -77,7 +77,7 @@ YUI.add('mapping', function(Y) {
 				srcNode: NODE_MAPPING_TABLE,
 				datasource:DS,
 				strategy: this.get("strategy"),
-				mapping:mapping
+				focus: focus
 			});
 		},
 
@@ -94,10 +94,10 @@ YUI.add('mapping', function(Y) {
 		},
 
 		_onSelectedChange : function() {
-			var selected = this.get("selected");
+			var focus = this.get("focus");
 			this.detailOverlay.set("visible", false);
-			if(selected.type=="mapping") {
-				this.mappingtable.set("mapping", selected.uri);
+			if(focus.type=="mapping") {
+				this.mappingtable.set("focus", focus);
 				NODE_MAPPING_TABLE.removeClass("hidden");
 			} else {
 				NODE_MAPPING_TABLE.addClass("hidden");
@@ -105,7 +105,7 @@ YUI.add('mapping', function(Y) {
 		},
 
 		_onCorrespondenceSelect : function(e) {
-			this._selectedRow = e.row;
+			this._focusRow = e.row;
 			this._source = e.sourceConcept.uri;
 			this._target = e.targetConcept.uri;
 			this._fetchDetail();
@@ -118,7 +118,7 @@ YUI.add('mapping', function(Y) {
 			var cs = this._getSelection();
 			var c = cs[0];
 			c.strategy = this.get("strategy");
-			c.mapping   = this.get("selected").uri;
+			c.mapping   = this.get("focus").uri;
 			if (c.relation) {
 			  this._submitCorrespondence(c);
 			}
@@ -185,7 +185,7 @@ YUI.add('mapping', function(Y) {
 
 			var data = {
 				strategy:this.get("strategy"),
-				mapping:this.get("selected").uri,
+				mapping:this.get("focus").uri,
 				source: this._source,
 				target: this._target,
 				allsource: NODE_SOURCE_ALL.get("checked"),
diff --git a/web/js/mappingtable.js b/web/js/mappingtable.js
index 398253d..b370faf 100644
--- a/web/js/mappingtable.js
+++ b/web/js/mappingtable.js
@@ -13,7 +13,7 @@ YUI.add('mappingtable', function(Y) {
 	MappingTable.ATTRS = {
 		srcNode: { value: null },
 		strategy: { value: null },
-		mapping: { value: null },
+		focus: { value: null },
 		datasource: { value: null },
 		showRelation: { value: false },
 		vocs: { value: { source: null, target: null }},
@@ -79,14 +79,14 @@ YUI.add('mappingtable', function(Y) {
 			this.on('loadingChange', this._onLoadingChange, this);
 			
 			// get new data if mapping is changed
-			this.after('mappingChange', function() {this.loadData()}, this);
+			this.after('focusChange', function() {this.loadData()}, this);
 			this.table.delegate('click', this._onRowSelect, '.yui3-datatable-data tr', this);
 			this.loadData();
 		},
 
 		loadData : function(conf, recordsOnly) {
 			var oSelf = this,
-				mapping = this.get("mapping"),
+				s = this.get("focus"),
 				datasource = this.get("datasource"),
 				strategy = this.get("strategy"),
 				table = this.table,
@@ -102,8 +102,10 @@ YUI.add('mappingtable', function(Y) {
 					}
 					var vocs = o.response.meta.stats.vocs;
 					if (vocs) {
-						table.head.columns[0][SOURCE_COLUMN].label = 'source: ' + vocs.source.label;
-						table.head.columns[0][TARGET_COLUMN].label = 'target: ' + vocs.target.label;
+						var sL = vocs.source.label + ' (source terms from: ' + s.abbrev + '.' + s.label + ')';
+						var tL = vocs.target.label + ' (target terms from: ' + s.abbrev + '.' + s.label + ')';
+						table.head.columns[0][SOURCE_COLUMN].label = sL;
+						table.head.columns[0][TARGET_COLUMN].label = tL;
 						table.set("data", records);
 						table.syncUI();
 						oSelf.set("vocs", vocs);
@@ -112,9 +114,9 @@ YUI.add('mappingtable', function(Y) {
 				}
 			};
 
-			if(mapping) {
+			if(s) { // selected mapping s
 				conf = conf ? conf : {};
-				conf.url = mapping;
+				conf.url = s.uri;
 				conf.strategy=strategy;
 				conf.limit=this.get('rows');
 				this.set("loading", true);
@@ -146,7 +148,7 @@ YUI.add('mappingtable', function(Y) {
 				
 			var data = {
 					row:row,
-					selected:current,
+					focus:current,
 					sourceConcept: source,
 					targetConcept: target,
 					vocs: this.get("vocs"),
diff --git a/web/js/strategy_viz.js b/web/js/strategy_viz.js
index 975bb46..2abd95c 100644
--- a/web/js/strategy_viz.js
+++ b/web/js/strategy_viz.js
@@ -13,7 +13,7 @@ YUI.add('strategy_viz', function(Y) {
 	StratViz.ATTRS = {
 		strategy: { value: null },
 		paths: { value: null },
-		selected: { value: null }
+		focus: { value: null }
 	};
 
 	Y.extend(StratViz, Y.Widget, {
@@ -26,7 +26,7 @@ YUI.add('strategy_viz', function(Y) {
 		destructor : function() {},
 		renderUI : function() {},
 		bindUI : function() {
-			this.after("selectedChange", this.syncUI, this);
+			this.after("focusChange", this.syncUI, this);
 		},
 		
 		_bindSVG : function () {
@@ -40,7 +40,7 @@ YUI.add('strategy_viz', function(Y) {
 		},
 
 		syncUI : function() {
-			this.updateGraph(this.get("selected").uri);
+			this.updateGraph(this.get("focus").uri);
 		},
 		
 		updateGraph : function(uri) {
@@ -67,9 +67,9 @@ YUI.add('strategy_viz', function(Y) {
 		},
 						
 		_setSelection : function() {
-			var selected = this.get("selected").uri;
+			var focus = this.get("focus").uri;
   			this.get("contentBox").all("a").each(function(svgnode) {
-				if(svgnode.getAttribute("xlink:href") === selected) {
+				if(svgnode.getAttribute("xlink:href") === focus) {
 					svgnode.setAttribute("class", "selected");
 				}
 			});
diff --git a/web/js/vocabulary.js b/web/js/vocabulary.js
index d901884..981e880 100644
--- a/web/js/vocabulary.js
+++ b/web/js/vocabulary.js
@@ -1,4 +1,4 @@
-/* Widget displaying a columnbrowser for skos concepts when the current "selected" node is of type "vocab"
+/* Widget displaying a columnbrowser for skos concepts when the current "focus" node is of type "vocab"
  * Uses the browser from the skos_browser cpack.
  */
 
@@ -12,7 +12,7 @@ YUI.add('vocabulary', function(Y) {
 	Vocabulary.ATTRS = {
 		conceptscheme : { value: null },
 		strategy : { value: null },
-		selected : { value: null },
+		focus : { value: null },
 		concept  : { value: null },
 		paths:{ value:{
 				concepts:"/skosapi/concepts",
@@ -28,7 +28,7 @@ YUI.add('vocabulary', function(Y) {
 
 			this._initHeader();
 			this._initBrowser();
-			this.after("selectedChange", this._onSelectedChange, this);
+			this.after("focusChange", this._onSelectedChange, this);
 
 			this._currentMappings = {};
 		},
@@ -36,7 +36,7 @@ YUI.add('vocabulary', function(Y) {
 		_initHeader : function() {
 			var oSelf = this;
 
-			var selected = this.get("selected");
+			var focus = this.get("focus");
 			var mappingHeader = NODE_BROWSER.appendChild(Y.Node.create('<div class="header"></div>'));
 			var titleBox = mappingHeader.appendChild(Y.Node.create('<div class="title-box" title="click to show options"></div>'));
 			this.title = titleBox.appendChild(Y.Node.create('<span class="title"></span>'));
@@ -113,11 +113,11 @@ YUI.add('vocabulary', function(Y) {
 		},
 
 		_onSelectedChange : function() {
-			var selected = this.get("selected");
-			if(selected.type=="vocab") {
+			var focus = this.get("focus");
+			if(focus.type=="vocab") {
 				NODE_BROWSER.removeClass("hidden");
-				this.browser._updateColumn(0, selected.uri);
-				this.title.setContent(selected.label);
+				this.browser._updateColumn(0, focus.uri);
+				this.title.setContent(focus.label);
 				this.fetchMappings();
 			} else {
 				NODE_BROWSER.addClass("hidden");