Project

General

Profile

« Previous | Next » 

Revision 50883

finished subscriptions and notifications

View differences:

modules/uoa-repository-dashboard-gui/trunk/app/pages/adminPg/adminPg-metrics.component.ts
32 32
  }
33 33

  
34 34

  
35
  getPiwiks(){
35
  getPiwiks() {
36 36
    this.loadingMessage = loadingReposMessage;
37 37
    this.piwikService.getPiwikSitesForRepos()
38 38
      .subscribe(
......
58 58

  
59 59
  /*NOT SURE IF THESE PARAMETERS ARE THE CORRECT ONES*/
60 60
  confirmApproval(repoId: string) {
61
    this.confirmApprovalModal.ids.push(repoId);
61
    this.confirmApprovalModal.ids = [repoId];
62 62
    this.confirmApprovalModal.showModal();
63 63
  }
64 64

  
......
81 81
      () => {
82 82
        this.loadingMessage = '';
83 83
        this.errorMessage = '';
84
        this.getPiwiks();
84 85
      }
85 86
    );
86 87
  }
modules/uoa-repository-dashboard-gui/trunk/app/pages/metrics/metrics-enable.component.ts
3 3
import { ConfirmationDialogComponent } from '../../shared/reusablecomponents/confirmation-dialog.component';
4 4
import { PiwikService } from '../../services/piwik.service';
5 5
import { RepositoryService } from '../../services/repository.service';
6
import { Repository } from '../../domain/typeScriptClasses';
6
import { PiwikInfo, Repository } from '../../domain/typeScriptClasses';
7 7
import {
8 8
  enabledMetricsError, enabledMetricsSuccess, enablingMetrics, loadingRepoError,
9 9
  loadingRepoMessage
......
65 65

  
66 66
  getOAid () {
67 67
    this.piwikService.getOpenaireId(this.repo.id).subscribe(
68
      id => {this.oaId = id._body.toString(); console.log(this.oaId);},
68
      id => {
69
        this.oaId = id;
70
        console.log(this.oaId);},
69 71
      error => console.log(`ERROR is ${error}`)
70 72
    );
71 73
  }
......
79 81
  confirmedEnabling() {
80 82
    if (this.repo) {
81 83
      this.loadingMessage = enablingMetrics;
82
      this.piwikService.savePiwikInfo(this.repo.id,
83
        this.oaId,
84
        this.repo.officialName,
85
        this.repo.countryName,
86
        this.authService.userFullName,
87
        this.authService.userEmail).subscribe(
84
      let piwik: PiwikInfo = {
85
        repositoryId: this.repo.id,
86
        openaireId: this.oaId,
87
        repositoryName: this.repo.officialName,
88
        country: this.repo.countryName,
89
        siteId: '',
90
        authenticationToken: '',
91
        creationDate: null,
92
        requestorName: this.authService.userFullName,
93
        requestorEmail: this.authService.userEmail,
94
        validated: false,
95
        validationDate: null,
96
        comment: ''
97
      };
98
      this.piwikService.savePiwikInfo(piwik).subscribe(
88 99
        response => {
89 100
          console.log(`answered ${response}`);
90 101
          this.successMessage = enabledMetricsSuccess;
......
94 105
          console.log(error);
95 106
          this.errorMessage = enabledMetricsError;
96 107
          this.loadingMessage = '';
108
          this.getRepo();
97 109
        }
98 110
      );
99 111
    }
modules/uoa-repository-dashboard-gui/trunk/app/pages/metrics/metrics-enable.component.html
22 22
              </div>
23 23
              <div class="whiteFilm"></div>
24 24
            </div>
25
            <div>
25
            <div *ngIf="repo">
26 26
              <div class="gwt-HTML">
27 27
                <h4>You don't have metrics enabled for this repository yet. Would you like to enable them?</h4>
28 28
                <p><img src="assets/imgs/metricsWorkflow-new.svg"
modules/uoa-repository-dashboard-gui/trunk/app/pages/content/content-events-of-repo-eventslist.component.html
12 12
        <div class="whiteFilm"></div>
13 13
      </div>
14 14
      <div *ngIf="noEvents" class="uk-alert">{{ noEvents }}</div>
15
      <div *ngIf="eventsPage.totalPages" class="events-results">
15
      <div *ngIf="eventsPage && eventsPage.totalPages" class="events-results">
16 16
        <div class="numberOfEventsLabel">
17
          <span>Showing {{(eventsPage.currPage*10)+1 }}-{{(eventsPage.currPage+1)*10 }} of {{ eventsPage.total }} results</span>
17
          <span>Showing {{(eventsPage.currPage*10)+1 }}-{{ ( (eventsPage.total < 10) || (eventsPage.total < (eventsPage.currPage+1)*10) ) ? (eventsPage.total) : (eventsPage.currPage+1)*10 }} of {{ eventsPage.total }} results</span>
18 18
          <span class="uk-float-right">
19 19
            <button id="subscribe" type="button" class="uk-button uk-button-primary uk-button-small" (click)="showSubscriptionModal()">Subscribe to these events</button>
20 20
          </span>
modules/uoa-repository-dashboard-gui/trunk/app/pages/content/content.module.ts
9 9
import { ContentEventsOfRepositoryComponent } from './content-events-of-repository.component';
10 10
import { ContentEventsOfRepoEventslistComponent } from './content-events-of-repo-eventslist.component';
11 11
import { ReactiveFormsModule } from '@angular/forms';
12
import { ContentNotificationsOfSubscriptionComponent } from './content-notifications-of-subscription.component';
12 13

  
13 14
@NgModule ({
14 15
  imports: [
15 16
    CommonModule,
16 17
    TabsModule.forRoot(),
17 18
    ContentRouting,
18
//    FormsModule,
19 19
    ReactiveFormsModule,
20 20
    ReusableComponentsModule
21 21
  ],
......
25 25
    ContentEventsOfRepositoryComponent,
26 26
    ContentEventsOfRepoEventslistComponent,
27 27
    ContentNotificationsComponent,
28
    ContentNotificationsOfSubscriptionComponent
28 29
  ]
29 30
})
30 31

  
modules/uoa-repository-dashboard-gui/trunk/app/pages/content/content-events-of-repo-eventslist.component.ts
174 174
    this.errorMessage = '';
175 175
    this.successMessage = '';
176 176
    this. loadingMessage = loadingEvents;
177
    this.brokerService.advancedShowEvents(page,this.advanceSearch).subscribe(
178
      page => this.eventsPage = page,
177
    this.brokerService.advancedShowEvents(page,10,this.advanceSearch).subscribe(
178
      events => this.eventsPage = events,
179 179
      error => {
180 180
        this.loadingMessage = '';
181 181
        this.errorMessage = noServiceMessage;
182
        console.log(error);
182 183
      },
183 184
      () => {
184 185
        this.loadingMessage = '';
185 186
        console.log(this.eventsPage);
186
        if(!this.eventsPage.total) {
187
        if (!this.eventsPage.total) {
187 188
          if (!this.eventsPageInitialized)
188 189
            this.noEvents = noEventsForTopic;
189 190
          else
......
269 270
  }
270 271
  return null;
271 272
}
273

  
274
export function checkDates(c: AbstractControl) {
275
  if( c.get('dateFrom').value > c.get('dateTo').value ) {
276
    return 'invalid';
277
  }
278
  return null;
279
}
modules/uoa-repository-dashboard-gui/trunk/app/pages/content/content-notifications.component.html
21 21
          <thead>
22 22
            <tr>
23 23
              <th>Topic</th>
24
              <th>Creation Date</th>
25
              <th>Last Notification Date</th>
24 26
              <th class="uk-text-nowrap"># of notifications</th>
25 27
              <th class="uk-text-nowrap">Actions</th>
26 28
            </tr>
......
28 30
          <tbody>
29 31
            <tr *ngFor="let sub of subscrOfUser[key]" class="el-item">
30 32
              <td class="uk-table-shrink">
31
                <div class="el-title">{{ sub.topic }}</div>
33
                <a [routerLink]="sub.id">
34
                  <div class="el-title">{{ sub.topic }}</div>
35
                </a>
32 36
              </td>
37
              <td class="uk-table-shrink">
38
                <div class="el-title">{{ sub.creationDate | date:'yyyy-MM-dd HH:mm:ss' }}</div>
39
              </td>
40
              <td class="uk-table-shrink">
41
                <div class="el-title">{{ sub.lastNotificationDate }}</div>
42
              </td>
33 43
              <td class="uk-text-nowrap uk-table-shrink">
34 44
                <div class="el-title">{{ sub.count }}</div>
35 45
              </td>
modules/uoa-repository-dashboard-gui/trunk/app/pages/content/content.routing.ts
6 6
import { AuthGuardService } from '../../services/auth-guard.service';
7 7
import { ContentEventsOfRepositoryComponent } from './content-events-of-repository.component';
8 8
import { ContentEventsOfRepoEventslistComponent } from './content-events-of-repo-eventslist.component';
9
import { ContentNotificationsOfSubscriptionComponent } from './content-notifications-of-subscription.component';
9 10

  
10 11
const contentRoutes: Routes = [
11 12
  {
......
33 34
      {
34 35
        path: 'notifications',
35 36
        component: ContentNotificationsComponent,
37
      },
38
      {
39
        path: 'notifications/:id',
40
        component: ContentNotificationsOfSubscriptionComponent,
36 41
      }
37 42
    ]
38 43
  }
modules/uoa-repository-dashboard-gui/trunk/app/pages/content/content-notifications.component.ts
1 1
import {Component, OnInit} from "@angular/core";
2
import { SimpleSubscriptionDesc } from '../../domain/typeScriptClasses';
2
import { SimpleSubscriptionDesc, Subscription } from '../../domain/typeScriptClasses';
3 3
import { AuthenticationService } from '../../services/authentication.service';
4 4
import { BrokerService } from '../../services/broker.service';
5 5
import {
......
39 39
      },
40 40
      () => {
41 41
        this.loadingMessage = '';
42
        console.log(JSON.stringify(this.subscrOfUser));
43 42
        for (let key in this.subscrOfUser){
44 43
          this.subKeys.push(key);
45 44
          console.log(key);
modules/uoa-repository-dashboard-gui/trunk/app/pages/content/content-notifications-of-subscription.component.html
1
<div *ngIf="eventsPage" class="uk-grid uk-grid-stack">
2
  <div class="uk-width-expand@m uk-first-column">
3
    <div class="uk-margin-medium-bottom">
4
      <h1 class="uk-article-title">{{ eventsPage.datasource }}</h1>
5
      <div class="uk-text uk-text-small uk-text-secondary">{{ topic }}</div>
6
    </div>
7
    <div>
8
      <div *ngIf="errorMessage" class="uk-alert uk-alert-danger">{{errorMessage}}</div>
9
      <div *ngIf="loadingMessage" class="loading-big">
10
        <div class="loader-big" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;">{{ loadingMessage }}</div>
11
        <div class="whiteFilm"></div>
12
      </div>
13
      <div *ngIf="noEvents" class="uk-alert">{{ noEvents }}</div>
14
      <div *ngIf="eventsPage.totalPages" class="events-results">
15
        <div class="numberOfEventsLabel">
16
          <span>Showing {{(eventsPage.currPage*10)+1 }}-{{ ( (eventsPage.total < 10) || (eventsPage.total < (eventsPage.currPage+1)*10) ) ? (eventsPage.total) : (eventsPage.currPage+1)*10 }} of {{ eventsPage.total }} results</span>
17
        </div>
18
        <div>
19
          <ul class="uk-pagination">
20
            <li>
21
              <a class="uk-link uk-link-muted" (click)="goToPreviousPage()">
22
                <span class="uk-margin-small-right uk-pagination-previous uk-icon" uk-pagination-previous="">
23
                  <svg width="7" height="12" viewBox="0 0 7 12" xmlns="http://www.w3.org/2000/svg" icon="pagination-previous" ratio="1"></svg>
24
                </span>
25
                Previous
26
              </a>
27
            </li>
28
            <li class="uk-margin-auto-left">
29
              <a class="uk-link uk-link-muted" (click)="goToNextPage()">
30
                Next
31
                <span class="uk-margin-small-left uk-pagination-next uk-icon" uk-pagination-next="">
32
                  <svg width="7" height="12" viewBox="0 0 7 12" xmlns="http://www.w3.org/2000/svg" icon="pagination-next" ratio="1"></svg>
33
                </span>
34
              </a>
35
            </li>
36
          </ul>
37
          <div class="resultsPageLabel">page {{ eventsPage.currPage+1 }} of {{ eventsPage.totalPages }}</div>
38
        </div>
39
        <div *ngFor="let event of eventsPage.values" class="events-list">
40
          <div class="uk-card uk-card-default well uk-scrollspy-inview uk-animation-slide-top-medium">
41
            <div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
42
              <div class="uk-width-1-1@m uk-first-column">
43
                <p class="text-right"><span class="uk-label">Trust: {{ event.trust }}</span></p>
44
                <div class="uk-overflow-auto uk-scrollspy-inview uk-animation-slide-top-medium">
45
                  <table class="uk-table uk-table-striped uk-table-middle">
46
                    <tbody>
47
                    <tr class="el-item">
48
                      <td class="uk-table-shrink uk-width-1-4"><strong class="el-title uk-display-block">ID</strong></td>
49
                      <td class="uk-table-shrink">
50
                        <div class="el-title">{{ event.publication.originalId }}</div>
51
                      </td>
52
                    </tr>
53
                    <tr class="el-item">
54
                      <td class="uk-table-shrink uk-width-1-4"><strong class="el-title uk-display-block">Title(s)</strong></td>
55
                      <td class="uk-table-shrink">
56
                        <div class="el-title">
57
                          <span *ngFor="let t of event.publication.titles">{{ t }};&nbsp;&nbsp;</span></div>
58
                      </td>
59
                    </tr>
60
                    <tr class="el-item">
61
                      <td class="uk-table-shrink uk-width-1-4"><strong class="el-title uk-display-block">Author(s)</strong></td>
62
                      <td class="uk-table-shrink">
63
                        <div class="el-title"><span *ngFor="let auth of event.publication.creators">{{ auth }};&nbsp;&nbsp;</span></div>
64
                      </td>
65
                    </tr><tr class="el-item">
66
                      <td class="uk-table-shrink uk-width-1-4"><strong class="el-title uk-display-block">PID(s)</strong></td>
67
                      <td class="uk-table-shrink"><div class="el-title"><span *ngFor="let pid of event.publication.pids">({{ pid.type }}) {{ pid.value }}</span></div></td>
68
                    </tr>
69
                    <tr class="el-item"><td class="uk-table-shrink uk-width-1-4"><strong class="el-title uk-display-block">Abstract(s)</strong></td>
70
                      <td class="uk-table-shrink"><div class="el-title"><span *ngFor="let abs of event.publication.abstracts">{{ abs }}</span></div></td>
71
                    </tr>
72
                    <tr class="el-item">
73
                      <td class="uk-table-shrink uk-width-1-4"><strong class="el-title uk-display-block">Project(s)/Relation(s)</strong></td>
74
                      <td class="uk-table-shrink"><div class="el-title"><span *ngFor="let rel of event.publication.externalReferences">{{ rel.name }}; </span></div></td>
75
                    </tr>
76
                    <tr class="el-item">
77
                      <td class="uk-table-shrink uk-width-1-4"><strong class="el-title uk-display-block">Subject(s)</strong></td>
78
                      <td class="uk-table-shrink">
79
                        <div class="el-title"><span *ngFor="let subj of event.publication.subjects">{{ subj }};&nbsp;</span></div>
80
                      </td>
81
                    </tr>
82
                    <tr class="el-item">
83
                      <td class="uk-table-shrink uk-width-1-4"><strong class="el-title uk-display-block">Publication date</strong></td>
84
                      <td class="uk-table-shrink"><div class="el-title">{{ event.publication.publicationdate }}</div></td>
85
                    </tr>
86
                    <tr class="el-item success">
87
                      <td class="uk-table-shrink uk-width-1-4"><strong class="el-title uk-display-block">Rights</strong></td>
88
                      <td class="uk-table-shrink">
89
                        <div class="el-title">
90
                            <span *ngFor="let l of event.publication.instances">{{ l.license }}&nbsp;&nbsp;<b>{{ l.hostedby }}</b><br>
91
                              <a href="{{ l.url }}" target="_blank">{{ l.url }}</a>
92
                            </span>
93
                          <br>
94
                          <span class="pull-right">
95
                              <span class="uk-label uk-label-success">added</span>&nbsp;&nbsp;
96
                              <span><b>from: </b>
97
                                <a href="{{ event.provenance.url }}" target="_blank">{{ event.provenance.repositoryName }}</a>
98
                                <span> ({{ event.provenance.id }})</span>
99
                              </span>
100
                            </span>
101
                        </div>
102
                      </td>
103
                    </tr>
104
                    </tbody>
105
                  </table>
106
                </div>
107
              </div>
108
            </div>
109
          </div>
110
        </div>
111
        <div>
112
          <ul class="uk-pagination">
113
            <li>
114
              <a class="uk-link uk-link-muted" (click)="goToPreviousPage()">
115
                <span class="uk-margin-small-right uk-pagination-previous uk-icon" uk-pagination-previous="">
116
                  <svg width="7" height="12" viewBox="0 0 7 12" xmlns="http://www.w3.org/2000/svg" icon="pagination-previous" ratio="1"></svg>
117
                </span>
118
                Previous
119
              </a>
120
            </li>
121
            <li class="uk-margin-auto-left">
122
              <a class="uk-link uk-link-muted" (click)="goToNextPage()">
123
                Next
124
                <span class="uk-margin-small-left uk-pagination-next uk-icon" uk-pagination-next="">
125
                  <svg width="7" height="12" viewBox="0 0 7 12" xmlns="http://www.w3.org/2000/svg" icon="pagination-next" ratio="1"></svg>
126
                </span>
127
              </a>
128
            </li>
129
          </ul>
130
          <div class="resultsPageLabel">page {{ eventsPage.currPage+1 }} of {{ eventsPage.totalPages }}</div>
131
        </div>
132
      </div>
133
    </div>
134
  </div>
135
</div>
modules/uoa-repository-dashboard-gui/trunk/app/pages/content/content-notifications-of-subscription.component.ts
1
import { Component, OnInit } from '@angular/core';
2
import { ActivatedRoute } from '@angular/router';
3
import { BrokerService } from '../../services/broker.service';
4
import { loadingEvents, noEventsForTopic, noServiceMessage } from '../../domain/shared-messages';
5
import { EventsPage } from '../../domain/typeScriptClasses';
6

  
7
@Component ({
8
  selector: 'app-content-notifications-of-subscription',
9
  templateUrl: 'content-notifications-of-subscription.component.html'
10
})
11

  
12
export class ContentNotificationsOfSubscriptionComponent implements OnInit {
13
  noEvents: string;
14
  errorMessage: string;
15
  loadingMessage: string;
16

  
17
  subId: string;
18
  topic: string;
19
  eventsPage: EventsPage;
20

  
21
  constructor(private route: ActivatedRoute,
22
              private brokerService: BrokerService) {}
23

  
24
  ngOnInit () {
25
    this.subId = this.route.snapshot.paramMap.get('id');
26
    this.getEventsPage(0);
27
  }
28

  
29
  getEventsPage(page: number) {
30
    this.noEvents = '';
31
    this.errorMessage = '';
32
    this. loadingMessage = loadingEvents;
33
    this.brokerService.getNotificationsBySubscriptionId(this.subId, page,10).subscribe(
34
      events => this.eventsPage = events,
35
      error => {
36
        this.loadingMessage = '';
37
        this.errorMessage = noServiceMessage;
38
        console.log(error);
39
      },
40
      () => {
41
        this.loadingMessage = '';
42
        console.log(this.eventsPage);
43
        if (!this.eventsPage.total)
44
          this.noEvents = noEventsForTopic;
45
        this.getCorrectTopic();
46
      }
47
    );
48
  }
49

  
50

  
51
  goToNextPage(){
52
    if(this.eventsPage.currPage < this.eventsPage.totalPages) {
53
      console.log(`Get me page ${this.eventsPage.currPage+1}!`);
54
      this.getEventsPage(this.eventsPage.currPage+1);
55
    }
56
  }
57

  
58
  goToPreviousPage(){
59
    if(this.eventsPage.currPage > 0) {
60
      console.log(`Get me page ${this.eventsPage.currPage-1}!`);
61
      this.getEventsPage(this.eventsPage.currPage-1);
62
    }
63
  }
64

  
65

  
66
  getCorrectTopic() {
67
    let temp = this.eventsPage.topic.split('/');
68
    this.topic = temp[0];
69
    for (let i=1; i<temp.length; i++){
70
      this.topic += ` | ${temp[i]}`;
71
    }
72
  }
73
}
modules/uoa-repository-dashboard-gui/trunk/app/services/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,
modules/uoa-repository-dashboard-gui/trunk/app/services/piwik.service.ts
33 33
      .catch(this.handleError);
34 34
  }
35 35

  
36
  getOpenaireId(id: string) {
36
  getOpenaireId(id: string): Observable<string> {
37 37
    let url = `${this.apiUrl}getOpenaireId/${id}`;
38 38
    console.log(`knocking on: ${url}`);
39 39
    return this.http.get(url)
40
      .map( oaId => oaId )
40
      .map( oaId => oaId['_body'].toString() )
41 41
      .catch(this.handleError);
42 42
  }
43 43

  
......
57 57
      .catch(this.handleError);
58 58
  }
59 59

  
60
  savePiwikInfo(repositoryId: string,
61
                openaireId: string,
62
                repositoryName: string,
63
                country: string,
64
                requestorName: string,
65
                requestorEmail: string): Observable<string>{
66
    let url = `${this.apiUrl}savePiwikInfo?repositoryId=${repositoryId} \ 
67
               &openaireId=${openaireId} \ 
68
               &repositoryName=${repositoryName} \
69
               &country=${country} \
70
               &requestorName=${requestorName} \
71
               &requestorEmail=${requestorEmail}`;
60
  savePiwikInfo(piwik: PiwikInfo): Observable<string>{
61
    let url = `${this.apiUrl}savePiwikInfo`;
72 62
    console.log(`knocking on: ${url}`);
73

  
74 63
    httpOptions.withCredentials = true;
75
    return this.http.post(url,httpOptions)
64
    return this.http.post(url,piwik,httpOptions)
76 65
      .map( res => {
77 66
        console.log(`responded ${res.statusText}`);
78 67
        return res.status.toString();
modules/uoa-repository-dashboard-gui/trunk/app/services/broker.service.ts
26 26

  
27 27
  constructor(private http: Http) { }
28 28

  
29
  advancedShowEvents(page: number,searchParams: AdvQueryObject): Observable<EventsPage>{
30
    let url = `${this.apiUrl}advancedShowEvents/${page}/10`;
29
  advancedShowEvents(page: number,size: number,searchParams: AdvQueryObject): Observable<EventsPage>{
30
    let url = `${this.apiUrl}advancedShowEvents/${page}/${size}`;
31 31
    console.log(`knocking on: ${url}`);
32 32
    let body = searchParams;
33 33
    console.log(`sending ${JSON.stringify(body)}`);
......
55 55
      .catch(this.handleError);
56 56
  }
57 57

  
58
  getNotificationsBySubscriptionId(subId: string, page: number): Observable<EventsPage> {
59
    let url = `${this.apiUrl}getNotificationsBySubscriptionId/${subId}/${page}/100`;
58
  getNotificationsBySubscriptionId(subId: string, page: number, size: number): Observable<EventsPage> {
59
    let url = `${this.apiUrl}getNotificationsBySubscriptionId/${subId}/${page}/${size}`;
60 60
    console.log(`knocking on: ${url}`);
61 61
    return this.http.get(url)
62 62
      .map( res => <EventsPage>res.json())
......
79 79
      .catch(this.handleError);
80 80
  }
81 81

  
82
/*
83
  NOT WORKING AND PROBABLY NOT NEEDED
84
  getSubscriptionsOfUser(userEmail): Observable<Subscription[]> {}
85
*/
82
  getSubscriptionsOfUser(userEmail: string): Observable<Map<string, Subscription>> {
83
    let url = `${this.apiUrl}getSubscriptionsOfUser/${userEmail}/`;
84
    console.log(`knocking on: ${url}`);
85
    return this.http.get(url)
86
      .map( res => <Map<string,Subscription>>res.json())
87
      .catch(this.handleError);
88
  }
86 89

  
87 90
  getTopicsForDataSource(name: string): Observable<BrowseEntry[]> {
88 91
    let url = `${this.apiUrl}getTopicsForDatasource/${name}`;
......
106 109
  subscribeToEvent(sub: OpenaireSubscription): Observable<string>{
107 110
    let url = `${this.apiUrl}subscribe`;
108 111
    console.log(`knocking on: ${url}`);
109
    let body = JSON.stringify(sub);
110 112
    httpOptions.withCredentials = true;
111
    return this.http.post(url,body,httpOptions)
112
      .map( res => res.json())
113
    return this.http.post(url,sub,httpOptions)
114
      .map( res => res.status.toString())
113 115
      .catch(this.handleError);
114 116
  }
115 117

  
modules/uoa-repository-dashboard-gui/trunk/app/services/validator.service.ts
9 9
import { Injectable } from '@angular/core';
10 10
import { Http, Headers, RequestOptions } from '@angular/http';
11 11
import { Observable } from 'rxjs/Observable';
12
import { InterfaceInformation, RuleSet, StoredJob } from '../domain/typeScriptClasses';
12
import { InterfaceInformation, JobForValidation, RuleSet, StoredJob } from '../domain/typeScriptClasses';
13 13
import { apiUrl } from '../domain/tempAPI';
14 14

  
15 15

  
......
19 19
@Injectable ()
20 20
export class ValidatorService {
21 21

  
22
  private apiUrl = apiUrl;
22
  private apiUrl = apiUrl + '/validator/';
23 23

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

  
26 26
  /* returns array of sets of rules according to mode (literature, data, cris) */
27 27
  getRuleSets(mode: string): Observable<RuleSet[]> {
28
    let url = `${this.apiUrl}/validator/getRuleSets/${mode}`;
28
    let url = `${this.apiUrl}getRuleSets/${mode}`;
29 29
    console.log(`knocking on: ${url}`);
30 30
    return this.http.get(url,httpOptions)
31 31
      .map(res => <RuleSet[]>res.json())
......
34 34

  
35 35

  
36 36
  getSetsOfRepository(baseUrl: string): Observable<string[]> {
37
    let url = `${this.apiUrl}/validator/getSetsOfRepository?url=${encodeURIComponent(baseUrl)}`;
37
    let url = `${this.apiUrl}getSetsOfRepository?url=${encodeURIComponent(baseUrl)}`;
38 38
    console.log(`knocking on: ${url}`);
39 39
    return this.http.get(url,httpOptions)
40 40
      .map(res => <string[]>res.json())
......
48 48
                   dateFrom: string,
49 49
                   dateTo: string,
50 50
                   validationStatus: string): Observable<StoredJob[]> {
51
    let url = `${this.apiUrl}/validator/getStoredJobsNew?user=${userEmail}&jobType=${encodeURI(jobType)}&offset=${offset}&limit=${limit}&dateFrom=${dateFrom}&dateTo=${dateTo}&validationStatus=${validationStatus}`;
51
    let url = `${this.apiUrl}getStoredJobsNew?user=${userEmail}&jobType=${encodeURI(jobType)}&offset=${offset}&limit=${limit}&dateFrom=${dateFrom}&dateTo=${dateTo}&validationStatus=${validationStatus}`;
52 52
    console.log(`knocking on: ${url}`);
53 53
    return this.http.get(url,httpOptions)
54 54
      .map(res => <StoredJob[]>res.json())
......
57 57

  
58 58
  /* returns true if there is a repository containing the baseUrl */
59 59
  identifyRepository(baseUrl: string): Observable<boolean> {
60
    let param = encodeURI(baseUrl);
61
    let url = `${this.apiUrl}/validator/identifyRepository/${param}`;
60
    let url = `${this.apiUrl}identifyRepository?baseUrl=${encodeURIComponent(baseUrl)}`;
62 61
    console.log(`knocking on: ${url}`);
63 62
    return this.http.get(url,httpOptions)
64 63
      .map(res => <boolean>res.json())
......
66 65
  }
67 66

  
68 67
  getInterfaceInformation(baseUrl: string): Observable<InterfaceInformation> {
69
    let param = encodeURI(baseUrl);
70
    let url = `${this.apiUrl}/validator/getInterfaceInformation/${param}`;
68
    let url = `${this.apiUrl}getInterfaceInformation?baseUrl=${encodeURIComponent(baseUrl)}`;
71 69
    console.log(`knocking on: ${url}`);
72 70
    return this.http.get(url,httpOptions)
73 71
      .map(res => <InterfaceInformation>res.json())
......
75 73
  }
76 74

  
77 75
  reSubmitJobForValidation(id: string): Observable<string> {
78
    let url = `${this.apiUrl}/validator/reSubmitJobForValidation/?jobId=${id}`;
76
    let url = `${this.apiUrl}reSubmitJobForValidation/${id}`;
79 77
    console.log(`knocking on: ${url}`);
80 78

  
81 79
    httpOptions.withCredentials = true;
......
87 85
      .catch(this.handleError);
88 86
  }
89 87

  
88
  submitJobForValidation(job: JobForValidation): Observable<string> {
89
    let url = `${this.apiUrl}submitJobForValidation`;
90
    console.log(`knocking on: ${url}`);
91
    let body = JSON.stringify(job);
92
    httpOptions.withCredentials = true;
93
    return this.http.post(url,body,httpOptions)
94
      .map(res => {
95
        console.log(`responded ${res.status}`);
96
        return res.status.toString();
97
      })
98
      .catch(this.handleError);
99
  }
90 100

  
101

  
91 102
/* from omtd project */
92 103
  private handleError(error: Response | any) {
93 104
    // In a real world app, we might use a remote logging infrastructure
modules/uoa-repository-dashboard-gui/trunk/app/services/monitor.service.ts
20 20

  
21 21
@Injectable ()
22 22
export class MonitorService {
23
  private apiUrl = apiUrl;
23
  private apiUrl = apiUrl + '/monitor/';
24 24

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

  
27 27
  getJobSummary(jobId: string, groupBy: string): Observable<StoredJob> {
28
    let url = `${this.apiUrl}/monitor/getJobSummary?jobId=${jobId}&groupBy=${groupBy}`;
28
    let url = `${this.apiUrl}getJobSummary?jobId=${jobId}&groupBy=${groupBy}`;
29 29
    console.log(`knocking on: ${url}`);
30 30
    return this.http.get(url)
31 31
      .map(res => <StoredJob>res.json() )
......
40 40
                dateTo: string,
41 41
                validationStatus: string,
42 42
                includeJobsTotal): Observable<JobsOfUser> {
43
    let url = `${this.apiUrl}/monitor/getJobsOfUser?user=${userEmail}`;
43
    let url = `${this.apiUrl}getJobsOfUser?user=${userEmail}`;
44 44
    if (jobType != '') {
45 45
      url = `${url}&jobType=${encodeURI(jobType)}&offset=${offset}&limit=${limit}&validationStatus=${validationStatus}&includeJobsTotal=${includeJobsTotal}`;
46 46
    } else {
modules/uoa-repository-dashboard-gui/trunk/app/domain/tempAPI.ts
1 1
/* export const apiUrl = 'http://195.134.66.230:8380/uoa-repository-manager-service'; */
2 2
/* export const apiUrl = 'http://194.177.192.121:8380/uoa-repository-manager-service';*/
3
export const apiUrl = 'http://194.177.192.121:8380/repomanager-service';
3
export const apiUrl = 'http://194.177.192.121:8380/repomanager-service-dev';
modules/uoa-repository-dashboard-gui/trunk/app/domain/typeScriptClasses.ts
470 470
    datasource: string;
471 471
    topic: string;
472 472
    count: number;
473
    creationDate: Date;
474
    lastNotificationDate: Date;
473 475
}
474 476

  
475 477
export class Subscription implements IsSerializable {
......
478 480
    topic: string;
479 481
    frequency: NotificationFrequency;
480 482
    mode: NotificationMode;
483
    creationDate: Date;
481 484
    lastNotificationDate: Date;
482 485
    conditions: string;
483 486
    conditionsAsList: MapConditions[];

Also available in: Unified diff