Project

General

Profile

« Previous | Next » 

Revision 50883

finished subscriptions and notifications

View differences:

repository.service.ts
19 19

  
20 20
@Injectable ()
21 21
export class RepositoryService {
22
  private apiUrl = apiUrl;
22
  private apiUrl = apiUrl + '/repository/';
23 23

  
24 24
  constructor(private http: Http) { }
25 25

  
26 26
  getRepositoriesOfCountry(country: string, mode: string): Observable<Repository[]> {
27
    let url = `${this.apiUrl}/repository/getRepositoriesByCountry/${country}/${mode}`;
27
    let url = `${this.apiUrl}getRepositoriesByCountry/${country}/${mode}`;
28 28
    console.log(`knocking on: ${url}`);
29 29
    return this.http.get(url)
30 30
      .map( res => <Repository[]>res.json())
......
32 32
  }
33 33

  
34 34
  getRepositoriesOfUser(userEmail: string): Observable<Repository[]> {
35
    let url = `${this.apiUrl}/repository/getRepositoriesOfUser/${userEmail}/0/100`;
35
    let url = `${this.apiUrl}getRepositoriesOfUser/${userEmail}/0/100`;
36 36
    console.log(`knocking on: ${url}`);
37 37
    return this.http.get(url)
38 38
      .map( res => <Repository[]>res.json())
......
42 42

  
43 43

  
44 44
  getRepositoryById(id: string): Observable<Repository> {
45
    let url = `${this.apiUrl}/repository/getRepositoryById/${id}`;
45
    let url = `${this.apiUrl}getRepositoryById/${id}`;
46 46
    console.log(`knocking on: ${url}`);
47 47
    return this.http.get(url)
48 48
      .map( res => <Repository>res.json())
......
51 51
  }
52 52

  
53 53
  getRepositoryInterface(id: string): Observable<RepositoryInterface[]>{
54
    let url = `${this.apiUrl}/repository/getRepositoryInterface/${id}`;
54
    let url = `${this.apiUrl}getRepositoryInterface/${id}`;
55 55
    console.log(`knocking on: ${url}`);
56 56
    return this.http.get(url)
57 57
      .map( res => <RepositoryInterface[]>res.json())
......
59 59
  }
60 60

  
61 61
  getUrlsOfUserRepos(userEmail: string): Observable<string[]>{
62
    let url = `${this.apiUrl}/repository/getUrlsOfUserRepos/${userEmail}/0/100/`;
62
    let url = `${this.apiUrl}getUrlsOfUserRepos/${userEmail}/0/100/`;
63 63
    console.log(`knocking on: ${url}`);
64 64
    return this.http.get(url)
65 65
      .map( res => <string[]>res.json())
......
67 67
  }
68 68

  
69 69
  getTimezones(): Observable<Timezone[]>{
70
    let url = `${this.apiUrl}/repository/getTimezones`;
70
    let url = `${this.apiUrl}getTimezones`;
71 71
    console.log(`knocking on: ${url}`);
72 72
    return this.http.get(url)
73 73
      .map( res => <Timezone[]>res.json())
74 74
      .catch(this.handleError);
75 75
  }
76 76

  
77
  getTypologies(): Observable<string[]>{
78
    let url = `${this.apiUrl}getTypologies`;
79
    console.log(`knocking on: ${url}`);
80
    return this.http.get(url)
81
      .map( res => <string[]>res.json())
82
      .catch(this.handleError);
83
  }
84

  
77 85
  getCountries(): Observable<Country[]> {
78
    let url = `${this.apiUrl}/repository/getCountries`;
86
    let url = `${this.apiUrl}getCountries`;
79 87
    console.log(`knocking on: ${url}`);
80 88
    return this.http.get(url)
81 89
      .map( res => <Country[]>res.json())
......
84 92

  
85 93

  
86 94
  getCompatibilityClasses (mode: string): Observable<Map<string,string>> {
87
    let url = `${this.apiUrl}/repository/getCompatibilityClasses/${mode}`;
95
    let url = `${this.apiUrl}getCompatibilityClasses/${mode}`;
88 96
    console.log(`knocking on: ${url}`);
89 97
    return this.http.get(url)
90 98
      .map( res => <Map<string,string>>res.json())
......
92 100
  }
93 101

  
94 102
  getDatasourceClasses(mode: string): Observable<Map<string,string>>{
95
    let url = `${this.apiUrl}/repository/getDatasourceClasses/${mode}`;
103
    let url = `${this.apiUrl}getDatasourceClasses/${mode}`;
96 104
    console.log(`knocking on: ${url}`);
97 105
    return this.http.get(url)
98 106
      .map( res => <Map<string,string>>res.json())
......
101 109

  
102 110

  
103 111
  getMetricsInfoForRepository (repoId: string): Observable<MetricsInfo> {
104
    let url = `${this.apiUrl}/repository/getMetricsInfoForRepository/${repoId}`;
112
    let url = `${this.apiUrl}getMetricsInfoForRepository/${repoId}`;
105 113
    console.log(`knocking on: ${url}`);
106 114
    return this.http.get(url)
107 115
      .map( res => <MetricsInfo>res.json())
......
109 117
  }
110 118

  
111 119
  updateEnglishName(id: string, englishname: string): Observable<string>{
112
    let url = `${this.apiUrl}/repository/updateEnglishName?id=${id}&officialName=DSpace&englishname=${englishname}`;
120
    let url = `${this.apiUrl}updateEnglishName?id=${id}&officialName=DSpace&englishname=${englishname}`;
113 121
    console.log(`knocking on: ${url}`);
114 122
    httpOptions.withCredentials = true;
115 123
    return this.http.post(url,httpOptions)
......
121 129
  }
122 130

  
123 131
  updateLongtitude(id: string, longtitude: string): Observable<string>{
124
    let url = `${this.apiUrl}/repository/updateLongtitude`;
132
    let url = `${this.apiUrl}updateLongtitude`;
125 133
    console.log(`knocking on: ${url}`);
126 134
    let body = JSON.stringify({
127 135
      id : id,
......
136 144
  }
137 145

  
138 146
  updateLatitude(id: string, latitude: string): Observable<string>{
139
    let url = `${this.apiUrl}/repository/updateLatitude`;
147
    let url = `${this.apiUrl}updateLatitude`;
140 148
    console.log(`knocking on: ${url}`);
141 149
    let body = JSON.stringify({
142 150
      id : id,
......
151 159
  }
152 160

  
153 161
  updateLogoUrl(id: string, logoUrl: string): Observable<string>{
154
    let url = `${this.apiUrl}/repository/updateLogoUrl`;
162
    let url = `${this.apiUrl}updateLogoUrl`;
155 163
    console.log(`knocking on: ${url}`);
156 164
    let body = JSON.stringify({
157 165
      id : id,
......
166 174
  }
167 175

  
168 176
  updateTimezone(id: string, timezone: string): Observable<string>{
169
    let url = `${this.apiUrl}/repository/updateTimezone`;
177
    let url = `${this.apiUrl}updateTimezone`;
170 178
    console.log(`knocking on: ${url}`);
171 179
    let body = JSON.stringify({
172 180
      id : id,

Also available in: Unified diff