Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
contactJS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MOTIVATE
contactJS
Commits
29533a09
Commit
29533a09
authored
9 years ago
by
Helena Jank
Browse files
Options
Downloads
Patches
Plain Diff
- undid latest changes to aggregator (extension of unsatisfied attributes)
+ added synonyms to attribute type
parent
8be5fd14
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/modules/aggregator/aggregator.js
+0
-9
0 additions, 9 deletions
js/modules/aggregator/aggregator.js
js/modules/attribute/attributeType.js
+39
-2
39 additions, 2 deletions
js/modules/attribute/attributeType.js
with
39 additions
and
11 deletions
js/modules/aggregator/aggregator.js
+
0
−
9
View file @
29533a09
...
@@ -618,15 +618,6 @@ define(['easejs', 'MathUuid','widget',
...
@@ -618,15 +618,6 @@ define(['easejs', 'MathUuid','widget',
* @param {Array} _componentTypes An array of components classes that should be searched for (e.g. Widget, Interpreter and Aggregator).
* @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
)
{
'
private getComponentsForUnsatisfiedAttributeTypes
'
:
function
(
_unsatisfiedAttributes
,
_all
,
_componentTypes
)
{
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
// ask the discoverer for components that satisfy the requested components
var
relevantComponents
=
this
.
discoverer
.
getComponentsByAttributes
(
_unsatisfiedAttributes
,
_all
,
_componentTypes
);
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.
"
);
console
.
log
(
"
I found
"
+
relevantComponents
.
length
+
"
component(s) of type
"
+
_componentTypes
+
"
that might satisfy the requested attributes.
"
);
...
...
This diff is collapsed.
Click to expand it.
js/modules/attribute/attributeType.js
+
39
−
2
View file @
29533a09
...
@@ -32,10 +32,17 @@ define(['easejs',
...
@@ -32,10 +32,17 @@ define(['easejs',
* @protected
* @protected
* @type {ParameterList}
* @type {ParameterList}
* @memberof AttributeType#
* @memberof AttributeType#
* @desc
Name
of the Attribute
* @desc
additional parameters
of the Attribute
*/
*/
'
protected parameterList
'
:
[],
'
protected parameterList
'
:
[],
/**
* @alias synonymList
* @protected
* @type {Array}
* @memberof AttributeType#
* @desc Alternative names of the Attribute
*/
'
protected synonymList
'
:
[],
/**
/**
* Constructor: Initializes the ParameterList.
* Constructor: Initializes the ParameterList.
*
*
...
@@ -104,6 +111,20 @@ define(['easejs',
...
@@ -104,6 +111,20 @@ define(['easejs',
this
.
addParameter
(
_parameter
);
this
.
addParameter
(
_parameter
);
return
this
;
return
this
;
},
},
/**
* Builder for synonyms from translations, called by discoverer's buildAttribute().
*
* @public
* @alias withSynonyms
* @memberof AttributeType#
* @param {Translations} _translations Translations
* @returns {AttributeType}
*/
'
public withSynonyms
'
:
function
(
_translations
){
this
.
setSynonyms
(
_translations
);
return
this
;
},
/**
/**
* Returns the name.
* Returns the name.
...
@@ -196,6 +217,22 @@ define(['easejs',
...
@@ -196,6 +217,22 @@ define(['easejs',
'
public hasParameters
'
:
function
()
{
'
public hasParameters
'
:
function
()
{
return
this
.
parameterList
.
size
()
>
0
;
return
this
.
parameterList
.
size
()
>
0
;
},
},
/**
* Adds a list of synonyms.
*
* @public
* @alias setSynonyms
* @memberof AttributeType#
* @param {Array} _synonyms Array of synonyms
*/
'
public setSynonyms
'
:
function
(
_synonyms
){
for
(
synIndex
in
_synonyms
)
{
// TODO: needs to be adjusted to match actual type
this
.
synonymList
.
push
(
_synonyms
[
synIndex
]);
}
},
/**
/**
* Compares this instance with the given one.
* Compares this instance with the given one.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment