From 745302799320418c5704316e70b52f1340731ff9 Mon Sep 17 00:00:00 2001
From: Helena Jank <jank@uni-potsdam.de>
Date: Mon, 27 Apr 2015 18:36:17 +0200
Subject: [PATCH] + added translations to unsatisfied attributes in order to
 extend search for relevant components

---
 js/modules/aggregator/aggregator.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/js/modules/aggregator/aggregator.js b/js/modules/aggregator/aggregator.js
index 3c44715..bb5b76c 100644
--- a/js/modules/aggregator/aggregator.js
+++ b/js/modules/aggregator/aggregator.js
@@ -618,7 +618,16 @@ define(['easejs', 'MathUuid','widget',
 		 * @param {Array} _componentTypes An array of components classes that should be searched for (e.g. Widget, Interpreter and Aggregator).
 		 */
         'private getComponentsForUnsatisfiedAttributeTypes': function(_unsatisfiedAttributes, _all, _componentTypes) {
-			// ask the discoverer for components that satisfy the requested components
+        	var attrs = _unsatisfiedAttributes.getItems();
+        	var translations = this.discoverer.getTranslations();        	
+
+        	for (attribute in attrs) {        		
+            	for (translation in translations) {
+                	_unsatisfiedAttributes.put(translations[translation].getSynonym(attrs[attribute]));        		
+            	}
+        	}
+        	
+        	// ask the discoverer for components that satisfy the requested components        	
             var relevantComponents = this.discoverer.getComponentsByAttributes(_unsatisfiedAttributes, _all, _componentTypes);
             console.log("I found "+relevantComponents.length+" component(s) of type "+_componentTypes+" that might satisfy the requested attributes.");
 
-- 
GitLab