author | ymh <ymh.work@gmail.com> |
Mon, 19 Dec 2016 21:58:02 +0100 | |
changeset 477 | ce52f0fca330 |
parent 392 | 4fbe94af93e8 |
permissions | -rw-r--r-- |
392
4fbe94af93e8
Improve filter service. Centralize filter management in a single point
ymh <ymh.work@gmail.com>
parents:
305
diff
changeset
|
1 |
import * as utils from 'corpus-common-addon/utils/utils'; |
304
20071981ba2a
add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
|
20071981ba2a
add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
import ResolverService from 'corpus-common-addon/services/resolver-service'; |
20071981ba2a
add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
|
20071981ba2a
add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
export default ResolverService.extend({ |
20071981ba2a
add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
|
20071981ba2a
add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
storeKeyBase: 'geonames', |
305
ff6cf3fc5f40
api reorganisation and propagation if the changes + some code cleaning
ymh <ymh.work@gmail.com>
parents:
304
diff
changeset
|
8 |
apiPath: '/api/v1/resolvers/geonames/', |
304
20071981ba2a
add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
resDocRoot: 'geonamesids', |
20071981ba2a
add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
|
392
4fbe94af93e8
Improve filter service. Centralize filter management in a single point
ymh <ymh.work@gmail.com>
parents:
305
diff
changeset
|
11 |
init(...args) { |
4fbe94af93e8
Improve filter service. Centralize filter management in a single point
ymh <ymh.work@gmail.com>
parents:
305
diff
changeset
|
12 |
this._super(args); |
4fbe94af93e8
Improve filter service. Centralize filter management in a single point
ymh <ymh.work@gmail.com>
parents:
305
diff
changeset
|
13 |
}, |
4fbe94af93e8
Improve filter service. Centralize filter management in a single point
ymh <ymh.work@gmail.com>
parents:
305
diff
changeset
|
14 |
|
4fbe94af93e8
Improve filter service. Centralize filter management in a single point
ymh <ymh.work@gmail.com>
parents:
305
diff
changeset
|
15 |
processId: function (id) { |
4fbe94af93e8
Improve filter service. Centralize filter management in a single point
ymh <ymh.work@gmail.com>
parents:
305
diff
changeset
|
16 |
return utils.getGeonamesCode(id); |
304
20071981ba2a
add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
}, |
20071981ba2a
add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
|
392
4fbe94af93e8
Improve filter service. Centralize filter management in a single point
ymh <ymh.work@gmail.com>
parents:
305
diff
changeset
|
19 |
getReturnDictKey: function (id) { |
4fbe94af93e8
Improve filter service. Centralize filter management in a single point
ymh <ymh.work@gmail.com>
parents:
305
diff
changeset
|
20 |
return id; |
304
20071981ba2a
add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
21 |
}, |
20071981ba2a
add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
22 |
|
392
4fbe94af93e8
Improve filter service. Centralize filter management in a single point
ymh <ymh.work@gmail.com>
parents:
305
diff
changeset
|
23 |
getLabel: function (id) { |
4fbe94af93e8
Improve filter service. Centralize filter management in a single point
ymh <ymh.work@gmail.com>
parents:
305
diff
changeset
|
24 |
return this.getName(id); |
4fbe94af93e8
Improve filter service. Centralize filter management in a single point
ymh <ymh.work@gmail.com>
parents:
305
diff
changeset
|
25 |
} |
304
20071981ba2a
add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
26 |
|
20071981ba2a
add location and geonames resolvers and api
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
27 |
}); |