Project

General

Profile

1
export class OpenaireProperties {
2
    private static productionMode:boolean = false;
3

    
4
    //base url
5
    private static baseLink = "https://demo.openaire.eu";
6

    
7
    //landing Pages
8
    private static baseSearchLink="/";
9
    private static searchLinkToPublication = "search/publication?articleId=";
10
    private static searchLinkToProject = "search/project?projectId=";
11
    private static searchLinkToDataProvider = "search/dataprovider?datasourceId=";
12
    private static searchLinkToDataset = "search/dataset?datasetId=";
13
    private static searchLinkToOrganization = "search/organization?organizationId=";
14
    //Search pages
15
    private static searchLinkToPublications = "search/find/publications";
16
    private static searchLinkToDataProviders = "search/find/dataproviders";
17
    private static searchLinkToProjects = "search/find/projects";
18
    private static searchLinkToDatasets = "search/find/datasets";
19
    private static searchLinkToOrganizations = "search/find/organizations";
20
    private static searchLinkToPeople = "search/find/people";
21
    public static searchLinkToCompatibleDataProviders = "search/content-providers";
22
    public static searchLinkToCompatibleDataProvidersTable = "search/content-providers-table";
23
    public static searchLinkToEntityRegistriesDataProviders = "search/entity-registries";
24
    public static searchLinkToEntityRegistriesDataProvidersTable = "search/entity-registries-table";
25
    public static searchLinkToJournals = "search/journals";
26
    public static searchLinkToJournalsTable = "search/journals-table";
27

    
28
    //Advanced Search for pages
29
    public static searchLinkToAdvancedPublications = "search/advanced/publications";
30
    public static searchLinkToAdvancedProjects = "search/advanced/projects";
31
    public static searchLinkToAdvancedDatasets = "search/advanced/datasets";
32
    public static searchLinkToAdvancedDataProviders = "search/advanced/dataproviders";
33
    public static searchLinkToAdvancedOrganizations = "search/advanced/organizations";
34
    public static searchLinkToAdvancedPeople = "search/advanced/people";
35

    
36

    
37
    private static metricsAPIURL = "https://beta.services.openaire.eu/usagestats/";
38
    private static framesAPIURL = "https://beta.openaire.eu/stats3/";
39

    
40
    private static loginAPIURL = "http://rudie.di.uoa.gr:8080/dnet%2Dopenaire%2Dusers%2D1.0.0%2DSNAPSHOT/api/users/authenticates"
41
    //"http://scoobydoo.di.uoa.gr:8080/uoa-user-management-1.0.0-SNAPSHOT/api/users/authenticates";
42
    private static loginAPIURL_pm = "https://beta.services.openaire.eu/uoa-user-management/api/users/authenticates";
43

    
44
    private static claimsAPIURL = "http://scoobydoo.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/";
45
    private static claimsAPIURL_pm = "https://beta.services.openaire.eu/claims/rest/claimsService/";
46

    
47
     private static searchAPIURLLAst_pm     = "https://beta.services.openaire.eu/search/v2/api/";
48
     private static searchAPIURLLAst     = "https://beta.services.openaire.eu/search/v2/api/";
49
//    private static searchAPIURLLAst     = "http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
50

    
51
    private static searchResourcesAPIURL_pm     = "https://beta.services.openaire.eu/search/v2/api/resources";
52
    private static searchResourcesAPIURL     = "https://beta.services.openaire.eu/search/v2/api/resources";
53
    // private static searchResourcesAPIURL     = "http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/resources";
54

    
55

    
56
    private static csvAPIURL_pm = "https://beta.services.openaire.eu/search/v2/api/";//publications?format=csv
57
    // private static csvAPIURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";//publications?format=csv
58

    
59
   private static csvAPIURL = "https://beta.services.openaire.eu/search/v2/api/";//publications?format=csv
60

    
61
    private static searchCrossrefAPIURL = "https://api.crossref.org/works";
62
    // private static searchDataciteAPIURL = "https://search.datacite.org/api";
63
    private static searchDataciteAPIURL = "https://api.datacite.org/works";
64

    
65
    private static searchOrcidURL    = "https://pub.orcid.org/";
66

    
67
    // Identifiers
68
    private static pmidURL    = "http://www.ncbi.nlm.nih.gov/pubmed/";
69
    private static doiURL     = "https://dx.doi.org/";
70
    private static cordisURL  = "http://cordis.europa.eu/projects/";
71
    private static pmcURL     = "http://europepmc.org/articles/";
72
    private static handleURL  = "http://hdl.handle.net/";
73

    
74
    // Zenodo's url
75
    private static zenodo   = "https://zenodo.org/";
76
    // Open access link
77
    private static openAccess = "https://www.openaire.eu/support/faq#article-id-234";
78
    // Open access repository link
79
    private static openAccessRepo = "https://www.openaire.eu/support/faq#article-id-310";
80
    // FP7 link
81
    private static fp7Guidlines = "https://www.openaire.eu/open-access-in-fp7-seventh-research-framework-programme";
82
    // H2020 link
83
    private static h2020Guidlines = "https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020";
84
    // ERC Guidlines
85
    private static ercGuidlines = "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf";
86
    // helpdesk link
87
    private static helpdesk = "https://www.openaire.eu/support/helpdesk";
88

    
89
    private static uploadService_pm = "https://demo.openaire.eu/upload";
90
    private static uploadService = "http://scoobydoo.di.uoa.gr:8000/upload";
91

    
92
    private static vocabulariesAPI ="https://beta.services.openaire.eu/provision/mvc/vocabularies/";
93

    
94
    private static piwikBaseUrl =" https://analytics.openaire.eu/piwik.php?idsite=6";
95
    private static enablePiwikTrack:boolean = false;
96

    
97
    private static loginUrl ="http://mpagasas.di.uoa.gr:8080/uoa-user-management-1.0.0-SNAPSHOT/openid_connect_login";
98
    private static loginUrl_pm ="https://beta.services.openaire.eu/uoa-user-management/openid_connect_login";
99

    
100
    private static logoutUrl ="https://aai.openminted.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=";
101
    private static logoutUrl_pm ="https://aai.openminted.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=";
102

    
103
    private static cookieDomain =".di.uoa.gr";
104
    private static cookieDomain_pm =".openaire.eu";
105

    
106
    private static feedbackmail ="openaire.test@gmail.com";
107

    
108
    private static helperPageUrl ="http://scoobydoo.di.uoa.gr:16000/api/page/route";
109
    private static enableHelper:boolean = false;
110

    
111
    public static getBaseLink():string{
112
      return this.baseLink;
113
    }
114

    
115
    //landing Pages' getters
116
    public static getsearchLinkToPublication():string{
117
      return this.baseSearchLink + this.searchLinkToPublication;
118
    }
119
    public static getsearchLinkToDataset():string{
120
      return this.baseSearchLink + this.searchLinkToDataset;
121
    }
122
    public static getsearchLinkToProject():string{
123
      return this.baseSearchLink + this.searchLinkToProject;
124
    }
125

    
126
    public static getsearchLinkToOrganization():string{
127
      return  this.searchLinkToOrganization;
128
    }
129
    public static getsearchLinkToDataProvider():string{
130
      return  this.searchLinkToDataProvider;
131
    }
132
    //searchPages
133
    public static getLinkToSearchPublications():string{
134
      return this.baseSearchLink + this.searchLinkToPublications;
135
    }
136
    public static getLinkToSearchProjects():string{
137
      return this.baseSearchLink + this.searchLinkToProjects;
138
    }
139
    public static getLinkToSearchDataProviders():string{
140
      return this.baseSearchLink + this.searchLinkToDataProviders;
141
    }
142
    public static getLinkToSearchCompatibleDataProviders():string{
143
      return this.baseSearchLink + this.searchLinkToCompatibleDataProviders;
144
    }
145
    public static getLinkToSearchCompatibleDataProvidersTable():string{
146
      return this.baseSearchLink + this.searchLinkToCompatibleDataProvidersTable;
147
    }
148
    public static getLinkToSearchEntityRegistries():string{
149
      return this.baseSearchLink + this.searchLinkToEntityRegistriesDataProviders;
150
    }
151
    public static getLinkToSearchEntityRegistriesTable():string{
152
      return this.baseSearchLink + this.searchLinkToEntityRegistriesDataProvidersTable;
153
    }
154
    public static getLinkToSearchJournals():string{
155
      return this.baseSearchLink + this.searchLinkToJournals;
156
    }
157
    public static getLinkToSearchJournalsTable():string{
158
      return this.baseSearchLink + this.searchLinkToJournalsTable;
159
    }
160
    public static getLinkToSearchDatasets():string{
161
      return this.baseSearchLink + this.searchLinkToDatasets;
162
    }
163
    public static getLinkToSearchOrganizations():string{
164
      return this.baseSearchLink + this.searchLinkToOrganizations;
165
    }
166
    public static getLinkToSearchPeople():string{
167
        return this.baseSearchLink + this.searchLinkToPeople;
168
    }
169

    
170
    //Advanced searchPages
171
    public static getLinkToAdvancedSearchPublications():string{
172
      return this.baseSearchLink + this.searchLinkToAdvancedPublications;
173
    }
174
    public static getLinkToAdvancedSearchProjects():string{
175
      return this.baseSearchLink + this.searchLinkToAdvancedProjects;
176
    }
177
    public static getLinkToAdvancedSearchDataProviders():string{
178
      return this.baseSearchLink + this.searchLinkToAdvancedDataProviders;
179
    }
180
    public static getLinkToAdvancedSearchDatasets():string{
181
      return this.baseSearchLink + this.searchLinkToAdvancedDatasets;
182
    }
183
    public static getLinkToAdvancedSearchOrganizations():string{
184
      return this.baseSearchLink + this.searchLinkToAdvancedOrganizations;
185
    }
186
    public static getLinkToAdvancedSearchPeople():string{
187
        return this.baseSearchLink + this.searchLinkToAdvancedPeople;
188
    }
189

    
190
    // Services - APIs' getters
191
    // public static getSearchAPIURL():string{
192
    //   return this.searchAPIURL;
193
    // }
194
    // Services - APIs' getters
195
    public static getCsvAPIURL(): string {
196
      if(this.productionMode){
197
        return this.csvAPIURL_pm;
198
      }else{
199
        return this.csvAPIURL;
200
      }
201
        // return this.csvAPIURL;
202
    }
203

    
204
    public static getFramesAPIURL(): string {
205
        return this.framesAPIURL;
206
    }
207

    
208
    public static getMetricsAPIURL(): string {
209
        return this.metricsAPIURL;
210
    }
211

    
212
    public static getLoginAPIURL(): string {
213
      if(this.productionMode){
214
        return this.loginAPIURL_pm;
215
      }else{
216
        return this.loginAPIURL;
217
      }
218
        // return this.loginAPIURL;
219
    }
220

    
221
    public static getSearchAPIURLLast():string{
222
      if(this.productionMode){
223
        return this.searchAPIURLLAst_pm;
224
      }else{
225
        return this.searchAPIURLLAst;
226
      }
227
      // return this.searchAPIURLLAst;
228
    }
229
    //query using full query:
230
    //
231
    public static getSearchResourcesAPIURL():string{
232
      if(this.productionMode){
233
        return this.searchResourcesAPIURL_pm;
234
      }else{
235
        return this.searchResourcesAPIURL;
236
      }
237
      // return this.searchResourcesAPIURL;
238
    }
239
    public static getSearchAPIURLForEntity(entityType:string):string{
240
      var suffix = "";
241
      if(entityType == "project"){
242
        suffix="projects/";
243
      }else if(entityType == "publication"){
244
        suffix="publications/";
245
      }else if(entityType == "dataset"){
246
        suffix="datasets/";
247
      }else if(entityType == "organization"){
248
        suffix="organizations/";
249
      }else if(entityType == "dataprovider"){
250
        suffix="datasources/";
251
      }else if(entityType == "person"){
252
        suffix="people/";
253
      }
254
      return (this.productionMode?this.searchAPIURLLAst_pm:this.searchAPIURLLAst) + suffix;
255
    }
256

    
257
    public static getClaimsAPIURL():string{
258
      if(this.productionMode){
259
        return this.claimsAPIURL_pm;
260
      }else{
261
        return this.claimsAPIURL;
262
      }
263
    }
264
    public static getSearchCrossrefAPIURL():string{
265
        return this.searchCrossrefAPIURL;
266
    }
267
    public static getSearchDataciteAPIURL():string{
268
        return this.searchDataciteAPIURL;
269
    }
270
    public static getSearchOrcidURL():string{
271
        return this.searchOrcidURL;
272
    }
273

    
274
    // Identifiers' getters
275
    public static getPmidURL():string{
276
        return this.pmidURL;
277
    }
278
    public static getDoiURL():string{
279
        return this.doiURL;
280
    }
281
    public static getCordisURL():string{
282
        return this.cordisURL;
283
    }
284
    public static getPmcURL():string{
285
        return this.pmcURL;
286
    }
287
    public static getHandleURL():string{
288
        return this.handleURL;
289
    }
290

    
291
    // Zenodo's getter
292
    public static getZenodoURL():string{
293
        return this.zenodo;
294
    }
295
    // Open access getter
296
    public static getOpenAccess():string{
297
        return this.openAccess;
298
    }
299
    // Open access repository getter
300
    public static getOpenAccessRepo():string{
301
        return this.openAccessRepo;
302
    }
303
    // FP7 link getter
304
    public static getFP7Guidlines():string{
305
        return this.fp7Guidlines;
306
    }
307
    // H2020 link getter
308
    public static getH2020Guidlines():string{
309
        return this.h2020Guidlines;
310
    }
311
    // ERC Guidlines getter
312
    public static getERCGuidlines():string{
313
        return this.ercGuidlines;
314
    }
315
    // helpdesk link getter
316
    public static getHelpdesk():string{
317
        return this.helpdesk;
318
    }
319

    
320

    
321
    //upload service for bulk claim - upload csv file
322
    public static getUploadServiceUrl():string{
323
      if(this.productionMode){
324
        return this.uploadService_pm;
325
      }else{
326
        return this.uploadService;
327
      }
328
    }
329
    //vocabularies API
330
    public static getVocabulariesAPI():string{
331
        return this.vocabulariesAPI;
332
    }
333
    public static getPiwikBaseURL():string{
334
        return this.piwikBaseUrl;
335
    }
336
    public static isPiwikTrackEnabled():boolean{
337
        return this.enablePiwikTrack;
338
    }
339
    public static getLoginURL():string{
340
      if(this.productionMode){
341
        return this.loginUrl_pm;
342
      }else{
343
        return this.loginUrl;
344
      }
345
    }
346
    public static getLogoutURL():string{
347
      if(this.productionMode){
348
        return this.logoutUrl_pm;
349
      }else{
350
        return this.logoutUrl;
351
      }
352
    }
353
    public static getCookieDomain():string{
354
      if(this.productionMode){
355
        return this.cookieDomain_pm;
356
      }else{
357
        return this.cookieDomain;
358
      }
359
    }
360
    public static getFeedbackMail():string{
361
      return this.feedbackmail;
362
  }
363
  public static getHelperPageUrl():string{
364
    return this.helperPageUrl;
365
  }
366
  public static isHelperEnabled():boolean{
367
    return this.enableHelper;
368
  }
369

    
370
}
371
export class ErrorCodes {
372
  public LOADING = 0;
373
  public DONE = 1;
374
  public NONE = 2;
375
  public ERROR = 3;
376
  public NOT_AVAILABLE = 4;
377
  public OUT_OF_BOUND = 5;
378
  public NOT_FOUND = 6;
379
}
(1-1/4)