--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/corpus-common-addon/app/services/geonames-resolver.js Tue Sep 27 23:43:29 2016 +0200
@@ -0,0 +1,28 @@
+import * as constants from 'corpus-common-addon/utils/constants';
+
+import ResolverService from 'corpus-common-addon/services/resolver-service';
+
+export default ResolverService.extend({
+
+ storeKeyBase: 'geonames',
+ apiPath: '/api/v1/geonames/',
+ resDocRoot: 'geonamesids',
+
+ init() {
+ this._super(...arguments);
+ },
+
+ processId: function(id) {
+ var geonamesId = id;
+ var m = id.match(constants.GEONAMES_BASE_URLS);
+ if (m) {
+ geonamesId = id.slice(m[0].length);
+ }
+ return geonamesId.replace(/\/+$/, '');
+ },
+
+ getReturnDictKey: function(id) { return id; },
+
+ getLabel: function(id) { return this.getName(id); }
+
+});