Project

General

Profile

« Previous | Next » 

Revision 45683

Landing seems to work properly| working on deposit Pages

View differences:

modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/utils/entitiesAutoComplete.component.ts
1
import {Component, ElementRef, Input, Output, EventEmitter} from '@angular/core';
2
import {Observable} from 'rxjs/Observable';
3
import {Subject} from 'rxjs/Subject';
4
import {Value} from '../searchPages/searchUtils/searchHelperClasses.class';
5
import {EntitiesSearchService} from '../services/entitySearch.service';
6

  
7
//Usage example
8
//<static-autocomplete [(filtered)] =filtered [(selected)] =selected placeHolderMessage = "Search for countries" title = "Countries:" (keywordChange)="keywordChanged($event)"></static-autocomplete>
9

  
10
@Component({
11
    selector: 'entities-autocomplete',
12
    styleUrls:  ['autoComplete.component.css'],
13
    host: {
14
       '(document:click)': 'handleClick($event)',
15
   },
16
    template: `
17
        <span class="custom-autocomplete">
18
          <span   *ngIf = "showSelected && selectedValue != ''">
19
            <span  class="uk-alert-default" data-uk-alert=""  *ngFor="let item of selected" [title]="showItem(item)" > <span >{{truncate(showItem(item),14)}} </span>
20
            <span (click)="remove(item)" aria-hidden="true" title="Remove selection" > <i class="uk-icon-remove clickable"></i> </span>
21
          </span>
22
          </span>
23
          <input *ngIf = "showInput" type="text" class="auto-complete-input validate filter-input input-sm form-control  " [placeholder]=placeHolderMessage [(ngModel)]=keyword (keyup)=search()   >
24
          <!--span *ngIf="showLoading" class="uk-alert uk-alert-primary" data-uk-alert=""> <i class="uk-icon-spinner"></i> Loading... </span>
25
          <span *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" data-uk-alert=""> {{warningMessage}} <a href="" class="uk-alert-close uk-close"></a></span-->
26
          <div *ngIf="focus && showInput" class="uk-dropdown" aria-expanded="true" style="display:block" >
27
                <ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results" >
28
                      <li>
29
                          <span *ngIf="showLoading" class="uk-alert uk-alert-primary" data-uk-alert=""> <i class="uk-icon-spinner"></i> Loading... </span>
30
                          <span *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" data-uk-alert="">{{warningMessage}}</span>
31
                          <span *ngIf="results > 0"  >  {{results}} results found:</span>
32
                          <span *ngIf="results == 0 && !showLoading" class="uk-alert uk-alert-info" data-uk-alert=""> No results found</span>
33
                      </li>
34
                       <li      *ngFor=" let item of filtered | async">
35
                        <a (click)="select(item)" [title]="showItem(item)">{{truncate(showItem(item),19)}}</a>
36
                    </li>
37
                </ul>
38

  
39
          </div>
40

  
41
      </span>
42

  
43

  
44
        `
45
})
46
export class EntitiesAutocompleteComponent {
47
    @Input() placeHolderMessage = "Search for entries";
48
    @Input() title = "Autocomplete";
49
    @Output() addItem = new EventEmitter(); // when selected list  changes update parent component
50
    @Output() selectedValueChanged = new EventEmitter(); // when changed  a method for filtering will be called
51
    @Input() public list = []; // the entries resulted after filtering function
52
    @Input() public selected = []; // the entries selected from user
53
    @Input() public keywordlimit = 3; // the minimum length of keyword
54
    @Input() public showSelected = true; // the minimum length of keyword
55
    @Input() public multipleSelections:boolean = true;
56
    @Input() public allowDuplicates:boolean = false;
57
    @Input() public selectedValue:string = '';
58
    @Input() public keyword = '';
59

  
60
    public warningMessage = "";
61
    public infoMessage = "";
62

  
63
    public tries = 0;
64
    public showInput = true;
65
    public sub;
66
    public done = false;
67
    public showLoading:boolean = false;
68
    public searchTermStream = new Subject<string>();
69
    filtered: Observable<{}> ;
70
    // public numFilteredResults:number = 0;
71

  
72
    @Input() public funderId:string;
73
    @Input() public entityType:string ;
74
    @Input() public depositType:string ;
75
    public results = 0;
76
    public focus:boolean  = false;
77
    constructor (private _search:EntitiesSearchService, private myElement: ElementRef) {
78

  
79

  
80

  
81
    }
82

  
83
    ngOnInit () {
84

  
85
       if(this.entityType == "project" && this.funderId ){
86
        this.filtered  = this.searchTermStream
87
        .debounceTime(300).distinctUntilChanged()
88
        .switchMap((term: string) =>    {
89
            var results = this._search.searchProjectsByFunder(term, (this.funderId == "0"?"":this.funderId));
90
            this.showLoading = false;
91
             this.results = results.length;
92
            return   results;
93
        });
94
      }else if(this.entityType == "organization" && this.depositType ){
95
         this.filtered  = this.searchTermStream
96
        .debounceTime(300).distinctUntilChanged()
97
        .switchMap((term: string) => {
98
          var results = this._search.searchByDepositType(term, this.depositType);
99
          this.showLoading = false;
100
          this.results = results.length;
101
          return   results;
102
      });
103

  
104
      }else{
105

  
106
        this.filtered  = this.searchTermStream
107
        .debounceTime(300)
108
        .distinctUntilChanged()
109
        .switchMap((term: string) => {
110
          var results = this._search.searchByType(term, this.entityType);
111
          this.showLoading = false;
112
          this.results = results.length;
113
          return   results;
114
      });
115

  
116
        this.getSelectedNameFromGivenId();
117
      }
118

  
119
    }
120
    ngOnDestroy(){
121
      if(this.sub && this.sub != undefined){
122
        this.sub.unsubscribe();
123
      }
124
    }
125

  
126
    search() {
127
      this.infoMessage = "";
128
      if(this.keyword == ""){
129
        this.tries = 0;
130
        this.warningMessage = "";
131
      } else if(this.keyword && this.keyword.length < this.keywordlimit){
132
        this.tries++;
133
        if(this.tries == this.keywordlimit -1 ){
134
          this.warningMessage = "Type at least " + this.keywordlimit + " characters";
135
          this.tries = 0;
136
        }
137
      }else{
138

  
139
        this.tries = 0;
140
        this.warningMessage = "";
141
        this.searchTermStream.next(this.keyword);
142
        // if(this.numFilteredResults ==0){
143
          this.showLoading = true;
144
          this.focus = true;
145
        // }
146
      }
147

  
148
    }
149

  
150
    remove(item:any){
151
      var index:number =this.checkIfExists(item,this.selected);
152
       if (index > -1) {
153
          this.selected.splice(index, 1);
154
      }
155
      if(!this.multipleSelections && this.selected.length == 0 ){
156
        this.showInput = true;
157
        this.selectedValue = "";
158
        this.selectedValueChanged.emit({
159
            value: this.selectedValue
160
        });
161

  
162

  
163
      }
164
    }
165
    select(item:any){
166
        if(this.multipleSelections){
167
          var index:number =this.checkIfExists(item,this.selected);
168
           if (index > -1 && !this.allowDuplicates) {
169
              // this.keyword = "";
170
              // this.filtered.splice(0, this.filtered.length);
171
              return;
172
          }
173
          else{
174
              this.selected.push(item);
175
              // this.keyword = "";
176
              // this.filtered.splice(0, this.filtered.length);
177
              this.addItem.emit({
178
                  value: item
179
              });
180
          }
181
      }else{
182
        this.selected.splice(0, this.selected.length);
183
        this.selected.push(item);
184
        // this.filtered.splice(0, this.filtered.length);
185
        this.keyword = "";
186
        this.showInput = false;
187
        this.selectedValue = item.id;
188
        this.selectedValueChanged.emit({
189
            value: this.selectedValue
190
        });
191

  
192
      }
193

  
194
    }
195
    private checkIfExists(item:any,list):number{
196

  
197
       if(item.concept && item.concept.id ){
198

  
199
        for (var _i = 0; _i < list.length; _i++) {
200
            let itemInList = list[_i];
201
            if(item.concept.id == itemInList.concept.id){
202
                 return _i;
203
            }
204
         }
205
      }else if(item.id){
206
        for (var _i = 0; _i < list.length; _i++) {
207
            let itemInList = list[_i];
208
             if(item.id == itemInList.id){
209
                 return _i;
210
            }
211
         }
212
      }
213
      return -1;
214

  
215
    }
216
    showItem(item:any):string{
217

  
218
     if (item.name){ //search
219
         return item.name;
220
      }else if( item.concept && item.concept.label){ //context
221
         return item.concept.label;
222
      }else if (item.label){ //simple
223
         return item.label;
224
      }
225

  
226
    }
227
    truncate(str:string, size:number):string{
228
      if(str == null){return "";}
229
      return (str.length > size)?str.substr(0,size)+'...':str;
230
    }
231
    private getSelectedNameFromGivenId(){
232
      if(this.selectedValue && this.selectedValue.length > 0 ){
233

  
234

  
235
      this.sub = this._search.fetchByType(this.selectedValue,this.entityType).subscribe(
236
        data => {
237
          this.selected.push( data[0]);
238
          this.showInput = false;
239
         },
240
        err => console.log("An error occured"));
241
    }
242
  }
243

  
244
    handleClick(event){
245
     var clickedComponent = event.target;
246
     var inside = false;
247
     do {
248
         if (clickedComponent === this.myElement.nativeElement) {
249
             inside = true;
250
         }
251
        clickedComponent = clickedComponent.parentNode;
252
     } while (clickedComponent);
253
      if(!inside){
254
        this.keyword = "";
255
        // this.numFilteredResults = 0;
256
        this.searchTermStream.next(this.keyword);
257
        this.focus=false;
258
      }
259
  }
260

  
261
}
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/services/entitySearch.service.ts
1
import {Injectable} from '@angular/core';
2
import {Http, Response} from '@angular/http';
3
import {Observable}     from 'rxjs/Observable';
4
import {AutoCompleteValue} from '../searchPages/searchUtils/searchHelperClasses.class';
5
import {OpenaireProperties} from '../utils/properties/openaireProperties';
6
import 'rxjs/add/observable/of';
7
import 'rxjs/add/operator/do';
8
import 'rxjs/add/operator/share';
9
import { CacheService  } from '../shared/cache.service';
10

  
11
@Injectable()
12
export class EntitiesSearchService {
13
    private api ="https://beta.services.openaire.eu/provision/mvc/vocabularies/";
14
    constructor(private http: Http, public _cache: CacheService) {}
15

  
16
    searchProjectsByFunder(keyword:string, funderId:string):any {
17
      let url =  OpenaireProperties. getSearchAPIURLLast()+"projects?"+((keyword && keyword.length > 0)?("q=" +keyword):"")+((funderId && funderId.length > 0 )?"&fq=funderid exact " + '"'+funderId+ '"':"")+"&size=10&page=0&format=json";
18
      return this.http.get(url).toPromise()
19
      .then(request =>
20
        {
21
          request = request.json().results;
22
          return this.parse(request,"oaf:project","project");
23
        });
24
      }
25
      searchByDepositType(keyword:string, DepositType:string):any {
26
        console.info("In searchOrganizationsforDeposit");
27

  
28
        let link = OpenaireProperties.getSearchResourcesAPIURL();
29

  
30
        let url = link+"?query=";
31
        if(keyword!= null && keyword != ''  ) {
32
          url += "((oaftype exact organization and deletedbyinference=false and "+
33
            "(reldatasourcecompatibilityid=driver or reldatasourcecompatibilityid=driver-openaire2.0 or reldatasourcecompatibilityid=openaire2.0 or reldatasourcecompatibilityid=openaire3.0 or reldatasourcecompatibilityid=openaire2.0_data or reldatasourcecompatibilityid=hostedBy or relprojectid=*))"+
34
            " and ((organizationlegalname all "+'"'+keyword+'"'+") or (organizationlegalshortname all "+'"'+keyword+'"'+")) " +
35
            // "and " + this.quote(params) + " " +
36
            "and (collectedfromdatasourcename exact "+DepositType+")) "
37

  
38
        }
39

  
40
        url += "&page=0&size=10";
41
        url += "&format=json";
42

  
43
        // let url =  OpenaireProperties. getSearchAPIURLLast()+"projects?"+((keyword && keyword.length > 0)?("q=" +keyword):"")+((funderId && funderId.length > 0 )?"&fq=funderid exact " + '"'+funderId+ '"':"")+"&size=10&page=0&format=json";
44
        return this.http.get(url).toPromise()
45
        .then(request =>
46
          {
47
            request = request.json().results;
48
            console.log(request);
49
            return this.parse(request,"oaf:organization","organization");
50
          });
51
        }
52
    searchByType(keyword:string,type:string){
53
       if (type == "project"){
54
         return  this.searchEntity(keyword,"projects","oaf:project","project");
55
      }else if (type == "person"){
56
        return  this.searchEntity(keyword,"people","oaf:person","person");
57
      }else if (type == "dataset"){
58
        return  this.searchEntity(keyword,"datasets","oaf:result","dataset");
59
      }else if (type == "datasource" || type == "hostedBy" || type== "collectedFrom"){
60
        return  this.searchEntity(keyword,"datasources","oaf:datasource","datasource");
61
      }else if (type == "publication"){
62
        return  this.searchEntity(keyword,"publications","oaf:result","publication");
63
      }else if (type == "organization"){
64
        return  this.searchEntity(keyword,"organizations","oaf:organization","organization");
65

  
66
      }
67

  
68
    }
69
    fetchByType(id:string,type:string){
70
       if (type == "project"){
71
         return  this.fetchEntity(id,"projects","oaf:project","project");
72
      }else if (type == "person"){
73
        return  this.fetchEntity(id,"people","oaf:person","person");
74
      }else if (type == "dataset"){
75
        return  this.fetchEntity(id,"datasets","oaf:result","dataset");
76
      }else if (type == "datasource"  || type == "hostedBy" || type== "collectedFrom"){
77
        return  this.fetchEntity(id,"datasources","oaf:datasource","datasource");
78
      }else if (type == "publication"){
79
        return  this.fetchEntity(id,"publications","oaf:result","publication");
80
      }else if (type == "organization"){
81
        return  this.fetchEntity(id,"organizations","oaf:organization","organization");
82

  
83
      }
84

  
85
    }
86
private searchEntity (keyword: string,APIname:string,oafEntityType:string, type:string):any {
87
      let link = OpenaireProperties. getSearchAPIURLLast()+APIname;
88
      return this.search(link,keyword,oafEntityType,type)
89

  
90
}
91
private fetchEntity (id: string,APIname:string,oafEntityType:string, type:string):any {
92
    let link = OpenaireProperties. getSearchAPIURLLast()+APIname;
93
    return this.fetch(link,id,oafEntityType,type)
94
}
95
private fetch (link,id,oafEntityType,type){
96
  let url = link+"/"+id+"?format=json";
97
  return this.http.get(url)
98
    .map(request => <any> request.json())
99
    // .do(res => console.info(res))
100
    .map(request => <any>  this.parse(request,oafEntityType,type));
101

  
102

  
103

  
104
}
105
    private search (link,keyword,oafEntityType,type){
106
      let url = link+"?";
107
      if(keyword!= null && keyword != ''  ) {
108
          url += "q="+ keyword;
109
      }
110

  
111
      url += "&page=0&size="+10+"&format=json";
112
      return this.http.get(url).toPromise()
113
                 .then(request =>
114
                   {
115
                     request = request.json().results;
116
                     return this.parse(request,oafEntityType,type);
117
                   });
118

  
119

  
120
    }
121

  
122
    private parse(data: any,oafEntityType:string, type:string){
123
      var array:any =[]
124
      let length = Array.isArray(data) ? data.length : 1;
125

  
126
      for(let i=0; i<length; i++) {
127
            let resData = Array.isArray(data) ? data[i]['result']['metadata']['oaf:entity'][oafEntityType] : data['result']['metadata']['oaf:entity'][oafEntityType];
128

  
129
            var value:any={} ;
130
            if(resData['title']){
131
              if(Array.isArray(resData['title'])) {
132
                    value.label = resData['title'][0];
133
              } else {
134
                    value.label = resData['title'];
135
              }
136
            }else if(resData["fullname"]){
137
              if(Array.isArray(resData["fullname"])) {
138
                    value.label = resData["fullname"][0];
139
              } else {
140
                    value.label = resData["fullname"];
141
              }
142
            }else if(resData["legalname"]){
143

  
144
              if(Array.isArray(resData["legalname"])) {
145
                    value.label = resData["legalname"][0];
146
              } else {
147
                    value.label = resData["legalname"];
148
              }
149

  
150
            }else if(resData["officialname"]){
151

  
152
              if(Array.isArray(resData["officialname"])) {
153
                    value.label = resData["officialname"][0];
154
              } else {
155
                    value.label = resData["officialname"];
156
              }
157
            }
158

  
159
           value.id = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
160

  
161
             if(type=="project"){
162
                  value.projectAcronym = resData['acronym'];
163
                  value.projectName = value.label;
164
                  value.endDate = null;
165
                  value.startDate = null;
166
                  if(resData.hasOwnProperty("startdate")) {
167
                    value.startDate = resData.startdate.split('-')[0];
168
                  }
169
                  if(resData.hasOwnProperty("enddate")) {
170
                    value.endDate = resData.enddate.split('-')[0];
171
                  }
172

  
173
             }
174
              array.push(value);
175
        }
176
        console.info("Parsing results.... Size:"+array.length);
177

  
178
        return array;
179
    }
180

  
181
// http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/projects?refine=true&fields=funderid&page=1&size=0
182

  
183
    private handleError (error: Response) {
184
      // in a real world app, we may send the error to some remote logging infrastructure
185
      // instead of just logging it to the console
186
      console.log(error);
187
      return Observable.throw(error  || 'Server error');
188
    }
189
}
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/deposit/deposit-routing.module.ts
1
import { NgModule } from '@angular/core';
2
import { RouterModule } from '@angular/router';
3

  
4
import { DepositPublicationsComponent } from './depositPublications.component';
5
import { DepositDatasetsComponent } from './depositDatasets.component';
6
import { DepositPublicationsResultComponent } from './depositPublicationsResult.component';
7
import { DepositDatasetsResultComponent } from './depositDatasetsResult.component';
8

  
9
@NgModule({
10
  imports: [
11
    RouterModule.forChild([
12
      { path: 'deposit-publications', component: DepositPublicationsComponent },
13
    	{ path: 'deposit-datasets', component: DepositDatasetsComponent },
14
    	{ path: 'deposit-publications-result', component: DepositPublicationsResultComponent} ,
15
    	{ path: 'deposit-datasets-result', component: DepositDatasetsResultComponent },
16

  
17
    ])
18
  ]
19
})
20
export class DepositRoutingModule { }
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/landingPages/dataProvider/dataProviderLanding.module.ts
1
//import {MaterialModule} from '@angular/material';
2
import { NgModule}            from '@angular/core';
3
import { CommonModule }        from '@angular/common';
4
import { FormsModule }         from '@angular/forms';
5

  
6
import {PublicationsTabComponent} from './publicationsTab.component';
7
import {DatasetsTabComponent} from './datasetsTab.component';
8
import {StatisticsTabComponent} from './statisticsTab.component';
9
import {ProjectsTabComponent} from './projectsTab.component';
10
import {DatasourcesTabComponent} from './datasourcesTab.component';
11
import {OrganizationsTabComponent} from './organizationsTab.component';
12
import {RelatedDatasourcesTabComponent} from './relatedDatasourcesTab.component';
13
import {TabsComponent} from './tabs.component';
14

  
15
import {DataProviderComponent} from './dataProvider.component';
16

  
17

  
18
@NgModule({
19
  imports: [
20
    //MaterialModule.forRoot(),
21
    CommonModule, FormsModule,
22

  
23
  ],
24
  declarations: [
25

  
26
    PublicationsTabComponent, DatasetsTabComponent, StatisticsTabComponent, ProjectsTabComponent, DatasourcesTabComponent, OrganizationsTabComponent, RelatedDatasourcesTabComponent, TabsComponent,
27
    DataProviderComponent
28
  ],
29
  providers:[
30
   ],
31
  exports: [
32
    DataProviderComponent
33
    ]
34
})
35
export class DataProviderLandingModule { }
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/landingPages/publication/publication.module.ts
6 6
import { PublicationService} from './publication.service';
7 7
import { PublicationComponent } from './publication.component';
8 8
import { PublicationRoutingModule } from './publication-routing.module';
9
import {MetricsModule} from '../metrics.module';
10
import {IFrameModule} from '../../utils/iframe.module';
11
import {AltMetricsModule} from '../../utils/altmetrics.module';
9 12

  
13

  
10 14
import { ResultLandingModule } from '../resultLanding.module';
11 15
import { LandingModule } from '../landing.module';
12 16

  
13 17
@NgModule({
14 18
  imports: [
15 19
    CommonModule, FormsModule, LandingModule,
16
    ResultLandingModule, PublicationRoutingModule
20
    ResultLandingModule, PublicationRoutingModule, MetricsModule, IFrameModule, AltMetricsModule
17 21
  ],
18 22
  declarations: [
19 23
  PublicationComponent
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/utils/altmetrics.module.ts
1
import { NgModule }            from '@angular/core';
2
import { CommonModule }        from '@angular/common';
3
import { FormsModule }         from '@angular/forms';
4

  
5
import {AltMetricsComponent} from './altmetrics.component';
6
import {SafeHtmlPipe} from './pipes/safeHTML.pipe';
7

  
8

  
9
@NgModule({
10
  imports: [
11
    CommonModule, FormsModule
12
  ],
13
  declarations: [
14
     AltMetricsComponent, SafeHtmlPipe
15
  ],
16
  exports: [
17
      AltMetricsComponent, SafeHtmlPipe
18
    ]
19
})
20
export class AltMetricsModule { }
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/landingPages/resultLanding.module.ts
3 3
import { CommonModule }        from '@angular/common';
4 4
import { FormsModule }         from '@angular/forms';
5 5

  
6
import {UtilsModule} from '../utils/utils.module';
7 6
import {ShowAuthorsComponent} from './showAuthors.component';
8 7
import {ShowIdentifiersComponent} from './showIdentifiers.component';
9 8
import {ShowSubjectsComponent} from './showSubjects.component';
......
11 10

  
12 11
@NgModule({
13 12
  imports: [
14
    //MaterialModule.forRoot(),
15 13
    CommonModule, FormsModule,
16
    UtilsModule,
17

  
18

  
19 14
  ],
20 15
  declarations: [
21 16
   ShowAuthorsComponent,ShowIdentifiersComponent,ShowSubjectsComponent
22

  
23 17
  ],
24 18
  providers:[
25 19
   ],
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/utils/entitiesAutoComplete/entitiesAutoComplete.module.ts
1
import { NgModule }            from '@angular/core';
2
import { CommonModule }        from '@angular/common';
3
import { FormsModule }         from '@angular/forms';
4

  
5
import {EntitiesAutocompleteComponent} from './entitiesAutoComplete.component';
6
import {EntitiesSearchService} from './entitySearch.service';
7

  
8

  
9
@NgModule({
10
  imports: [
11
    CommonModule, FormsModule
12
  ],
13
  declarations: [
14
     EntitiesAutocompleteComponent
15
  ],
16
  exports: [
17
      EntitiesAutocompleteComponent
18
    ],
19
    providers:[ EntitiesSearchService]
20
})
21
export class EntitiesAutocompleteModule { }
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/landingPages/dataProvider/dataProvider.component.ts
8 8

  
9 9
@Component({
10 10
    selector: 'dataprovider',
11
    templateUrl: 'dataProvider.component.html',
12
    providers:[ DataProviderService],
11
     templateUrl: 'dataProvider.component.html',
12
    //template: `Heeereee`,
13
    // providers:[ DataProviderService],
13 14
 })
14 15

  
15 16
export class DataProviderComponent {
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/landingPages/dataProvider/dataProvider.module.ts
1
//import {MaterialModule} from '@angular/material';
2 1
import { NgModule}            from '@angular/core';
3 2
import { CommonModule }        from '@angular/common';
4 3
import { FormsModule }         from '@angular/forms';
5 4

  
5
import {IFrameModule} from '../../utils/iframe.module';
6
// import { ResultLandingModule } from '../resultLanding.module';
7
import {SearchResultsModule } from '../../searchPages/searchUtils/searchResults.module';
8
import {MetricsModule} from '../metrics.module';
9
import { LandingModule } from '../landing.module';
10

  
6 11
import {PublicationsTabComponent} from './publicationsTab.component';
7 12
import {DatasetsTabComponent} from './datasetsTab.component';
8 13
import {StatisticsTabComponent} from './statisticsTab.component';
......
13 18
import {TabsComponent} from './tabs.component';
14 19

  
15 20
import {DataProviderComponent} from './dataProvider.component';
21
import { DataProviderService} from './dataProvider.service';
22
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
23
import {DatasetsServiceModule} from '../../services/datasetsService.module';
24
import {ProjectsServiceModule} from '../../services/projectsService.module';
25
import {PublicationsServiceModule} from '../../services/publicationsService.module';
16 26

  
27
import { DataProviderRoutingModule } from './dataProvider-routing.module';
17 28

  
29

  
30

  
18 31
@NgModule({
19 32
  imports: [
20
    //MaterialModule.forRoot(),
21 33
    CommonModule, FormsModule,
34
    DataProviderRoutingModule,
35
     SearchResultsModule, IFrameModule, MetricsModule, LandingModule, DataProvidersServiceModule, DatasetsServiceModule, ProjectsServiceModule, PublicationsServiceModule
22 36

  
23 37
  ],
24 38
  declarations: [
......
27 41
    DataProviderComponent
28 42
  ],
29 43
  providers:[
44
    DataProviderService
30 45
   ],
31 46
  exports: [
32 47
    DataProviderComponent
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/utils/entitiesAutoComplete/entitySearch.service.ts
1
import {Injectable} from '@angular/core';
2
import {Http, Response} from '@angular/http';
3
import {Observable}     from 'rxjs/Observable';
4
import {AutoCompleteValue} from '../../searchPages/searchUtils/searchHelperClasses.class';
5
import {OpenaireProperties} from '../properties/openaireProperties';
6
import 'rxjs/add/observable/of';
7
import 'rxjs/add/operator/do';
8
import 'rxjs/add/operator/share';
9
import { CacheService  } from '../../shared/cache.service';
10

  
11
@Injectable()
12
export class EntitiesSearchService {
13
    private api ="https://beta.services.openaire.eu/provision/mvc/vocabularies/";
14
    constructor(private http: Http, public _cache: CacheService) {}
15

  
16
    searchProjectsByFunder(keyword:string, funderId:string):any {
17
      let url =  OpenaireProperties. getSearchAPIURLLast()+"projects?"+((keyword && keyword.length > 0)?("q=" +keyword):"")+((funderId && funderId.length > 0 )?"&fq=funderid exact " + '"'+funderId+ '"':"")+"&size=10&page=0&format=json";
18
      return this.http.get(url).toPromise()
19
      .then(request =>
20
        {
21
          request = request.json().results;
22
          return this.parse(request,"oaf:project","project");
23
        });
24
      }
25
      searchByDepositType(keyword:string, DepositType:string):any {
26
        console.info("In searchOrganizationsforDeposit");
27

  
28
        let link = OpenaireProperties.getSearchResourcesAPIURL();
29

  
30
        let url = link+"?query=";
31
        if(keyword!= null && keyword != ''  ) {
32
          url += "((oaftype exact organization and deletedbyinference=false and "+
33
            "(reldatasourcecompatibilityid=driver or reldatasourcecompatibilityid=driver-openaire2.0 or reldatasourcecompatibilityid=openaire2.0 or reldatasourcecompatibilityid=openaire3.0 or reldatasourcecompatibilityid=openaire2.0_data or reldatasourcecompatibilityid=hostedBy or relprojectid=*))"+
34
            " and ((organizationlegalname all "+'"'+keyword+'"'+") or (organizationlegalshortname all "+'"'+keyword+'"'+")) " +
35
            // "and " + this.quote(params) + " " +
36
            "and (collectedfromdatasourcename exact "+DepositType+")) "
37

  
38
        }
39

  
40
        url += "&page=0&size=10";
41
        url += "&format=json";
42

  
43
        // let url =  OpenaireProperties. getSearchAPIURLLast()+"projects?"+((keyword && keyword.length > 0)?("q=" +keyword):"")+((funderId && funderId.length > 0 )?"&fq=funderid exact " + '"'+funderId+ '"':"")+"&size=10&page=0&format=json";
44
        return this.http.get(url).toPromise()
45
        .then(request =>
46
          {
47
            request = request.json().results;
48
            console.log(request);
49
            return this.parse(request,"oaf:organization","organization");
50
          });
51
        }
52
    searchByType(keyword:string,type:string){
53
       if (type == "project"){
54
         return  this.searchEntity(keyword,"projects","oaf:project","project");
55
      }else if (type == "person"){
56
        return  this.searchEntity(keyword,"people","oaf:person","person");
57
      }else if (type == "dataset"){
58
        return  this.searchEntity(keyword,"datasets","oaf:result","dataset");
59
      }else if (type == "datasource" || type == "hostedBy" || type== "collectedFrom"){
60
        return  this.searchEntity(keyword,"datasources","oaf:datasource","datasource");
61
      }else if (type == "publication"){
62
        return  this.searchEntity(keyword,"publications","oaf:result","publication");
63
      }else if (type == "organization"){
64
        return  this.searchEntity(keyword,"organizations","oaf:organization","organization");
65

  
66
      }
67

  
68
    }
69
    fetchByType(id:string,type:string){
70
       if (type == "project"){
71
         return  this.fetchEntity(id,"projects","oaf:project","project");
72
      }else if (type == "person"){
73
        return  this.fetchEntity(id,"people","oaf:person","person");
74
      }else if (type == "dataset"){
75
        return  this.fetchEntity(id,"datasets","oaf:result","dataset");
76
      }else if (type == "datasource"  || type == "hostedBy" || type== "collectedFrom"){
77
        return  this.fetchEntity(id,"datasources","oaf:datasource","datasource");
78
      }else if (type == "publication"){
79
        return  this.fetchEntity(id,"publications","oaf:result","publication");
80
      }else if (type == "organization"){
81
        return  this.fetchEntity(id,"organizations","oaf:organization","organization");
82

  
83
      }
84

  
85
    }
86
private searchEntity (keyword: string,APIname:string,oafEntityType:string, type:string):any {
87
      let link = OpenaireProperties. getSearchAPIURLLast()+APIname;
88
      return this.search(link,keyword,oafEntityType,type)
89

  
90
}
91
private fetchEntity (id: string,APIname:string,oafEntityType:string, type:string):any {
92
    let link = OpenaireProperties. getSearchAPIURLLast()+APIname;
93
    return this.fetch(link,id,oafEntityType,type)
94
}
95
private fetch (link,id,oafEntityType,type){
96
  let url = link+"/"+id+"?format=json";
97
  return this.http.get(url)
98
    .map(request => <any> request.json())
99
    // .do(res => console.info(res))
100
    .map(request => <any>  this.parse(request,oafEntityType,type));
101

  
102

  
103

  
104
}
105
    private search (link,keyword,oafEntityType,type){
106
      let url = link+"?";
107
      if(keyword!= null && keyword != ''  ) {
108
          url += "q="+ keyword;
109
      }
110

  
111
      url += "&page=0&size="+10+"&format=json";
112
      return this.http.get(url).toPromise()
113
                 .then(request =>
114
                   {
115
                     request = request.json().results;
116
                     return this.parse(request,oafEntityType,type);
117
                   });
118

  
119

  
120
    }
121

  
122
    private parse(data: any,oafEntityType:string, type:string){
123
      var array:any =[]
124
      let length = Array.isArray(data) ? data.length : 1;
125

  
126
      for(let i=0; i<length; i++) {
127
            let resData = Array.isArray(data) ? data[i]['result']['metadata']['oaf:entity'][oafEntityType] : data['result']['metadata']['oaf:entity'][oafEntityType];
128

  
129
            var value:any={} ;
130
            if(resData['title']){
131
              if(Array.isArray(resData['title'])) {
132
                    value.label = resData['title'][0];
133
              } else {
134
                    value.label = resData['title'];
135
              }
136
            }else if(resData["fullname"]){
137
              if(Array.isArray(resData["fullname"])) {
138
                    value.label = resData["fullname"][0];
139
              } else {
140
                    value.label = resData["fullname"];
141
              }
142
            }else if(resData["legalname"]){
143

  
144
              if(Array.isArray(resData["legalname"])) {
145
                    value.label = resData["legalname"][0];
146
              } else {
147
                    value.label = resData["legalname"];
148
              }
149

  
150
            }else if(resData["officialname"]){
151

  
152
              if(Array.isArray(resData["officialname"])) {
153
                    value.label = resData["officialname"][0];
154
              } else {
155
                    value.label = resData["officialname"];
156
              }
157
            }
158

  
159
           value.id = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
160

  
161
             if(type=="project"){
162
                  value.projectAcronym = resData['acronym'];
163
                  value.projectName = value.label;
164
                  value.endDate = null;
165
                  value.startDate = null;
166
                  if(resData.hasOwnProperty("startdate")) {
167
                    value.startDate = resData.startdate.split('-')[0];
168
                  }
169
                  if(resData.hasOwnProperty("enddate")) {
170
                    value.endDate = resData.enddate.split('-')[0];
171
                  }
172

  
173
             }
174
              array.push(value);
175
        }
176
        console.info("Parsing results.... Size:"+array.length);
177

  
178
        return array;
179
    }
180

  
181
// http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/projects?refine=true&fields=funderid&page=1&size=0
182

  
183
    private handleError (error: Response) {
184
      // in a real world app, we may send the error to some remote logging infrastructure
185
      // instead of just logging it to the console
186
      console.log(error);
187
      return Observable.throw(error  || 'Server error');
188
    }
189
}
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/landingPages/dataset/dataset.module.ts
4 4
import { FormsModule }         from '@angular/forms';
5 5

  
6 6
import { DatasetService} from './dataset.service';
7

  
8 7
import { DatasetComponent } from './dataset.component';
9 8
import { DatasetRoutingModule } from './dataset-routing.module';
9
import {MetricsModule} from '../metrics.module';
10
import {IFrameModule} from '../../utils/iframe.module';
11

  
10 12
import { ResultLandingModule } from '../resultLanding.module';
11 13
import { LandingModule } from '../landing.module';
12 14

  
......
14 16
  imports: [
15 17
    //MaterialModule.forRoot(),
16 18
    CommonModule, FormsModule, LandingModule,
17
    ResultLandingModule, DatasetRoutingModule
19
    ResultLandingModule, DatasetRoutingModule, MetricsModule, IFrameModule
18 20
  ],
19 21
  declarations: [
20 22
  DatasetComponent
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/landingPages/project/project.module.ts
6 6
import { ProjectService} from './project.service';
7 7
import { ProjectComponent } from './project.component';
8 8
import { ProjectRoutingModule } from './project-routing.module';
9

  
9
import {IFrameModule} from '../../utils/iframe.module';
10
import {MetricsModule} from '../metrics.module';
11
import {ReportsServiceModule} from '../../services/reportsService.module';
12
import {PublicationsServiceModule} from '../../services/publicationsService.module';
13
import {DatasetsServiceModule} from '../../services/datasetsService.module';
10 14
import {SearchResultsModule } from '../../searchPages/searchUtils/searchResults.module';
11 15
import { LandingModule } from '../landing.module';
12 16

  
......
14 18
  imports: [
15 19
    CommonModule, FormsModule, LandingModule,
16 20
     ProjectRoutingModule,
17
     SearchResultsModule
21
     SearchResultsModule, IFrameModule, MetricsModule, ReportsServiceModule, PublicationsServiceModule, DatasetsServiceModule
18 22
  ],
19 23
  declarations: [
20 24
  ProjectComponent
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/utils/entitiesAutoComplete/entitiesAutoComplete.component.ts
1
import {Component, ElementRef, Input, Output, EventEmitter} from '@angular/core';
2
import {Observable} from 'rxjs/Observable';
3
import {Subject} from 'rxjs/Subject';
4
import {Value} from '../../searchPages/searchUtils/searchHelperClasses.class';
5
import {EntitiesSearchService} from './entitySearch.service';
6

  
7
//Usage example
8
//<static-autocomplete [(filtered)] =filtered [(selected)] =selected placeHolderMessage = "Search for countries" title = "Countries:" (keywordChange)="keywordChanged($event)"></static-autocomplete>
9

  
10
@Component({
11
    selector: 'entities-autocomplete',
12
    styleUrls:  ['../autoComplete.component.css'],
13
    host: {
14
       '(document:click)': 'handleClick($event)',
15
   },
16
    template: `
17
        <span class="custom-autocomplete">
18
          <span   *ngIf = "showSelected && selectedValue != ''">
19
            <span  class="uk-alert-default" data-uk-alert=""  *ngFor="let item of selected" [title]="showItem(item)" > <span >{{truncate(showItem(item),14)}} </span>
20
            <span (click)="remove(item)" aria-hidden="true" title="Remove selection" > <i class="uk-icon-remove clickable"></i> </span>
21
          </span>
22
          </span>
23
          <input *ngIf = "showInput" type="text" class="auto-complete-input validate filter-input input-sm form-control  " [placeholder]=placeHolderMessage [(ngModel)]=keyword (keyup)=search()   >
24
          <!--span *ngIf="showLoading" class="uk-alert uk-alert-primary" data-uk-alert=""> <i class="uk-icon-spinner"></i> Loading... </span>
25
          <span *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" data-uk-alert=""> {{warningMessage}} <a href="" class="uk-alert-close uk-close"></a></span-->
26
          <div *ngIf="focus && showInput" class="uk-dropdown" aria-expanded="true" style="display:block" >
27
                <ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results" >
28
                      <li>
29
                          <span *ngIf="showLoading" class="uk-alert uk-alert-primary" data-uk-alert=""> <i class="uk-icon-spinner"></i> Loading... </span>
30
                          <span *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" data-uk-alert="">{{warningMessage}}</span>
31
                          <span *ngIf="results > 0"  >  {{results}} results found:</span>
32
                          <span *ngIf="results == 0 && !showLoading" class="uk-alert uk-alert-info" data-uk-alert=""> No results found</span>
33
                      </li>
34
                       <li      *ngFor=" let item of filtered | async">
35
                        <a (click)="select(item)" [title]="showItem(item)">{{truncate(showItem(item),19)}}</a>
36
                    </li>
37
                </ul>
38

  
39
          </div>
40

  
41
      </span>
42

  
43

  
44
        `
45
})
46
export class EntitiesAutocompleteComponent {
47
    @Input() placeHolderMessage = "Search for entries";
48
    @Input() title = "Autocomplete";
49
    @Output() addItem = new EventEmitter(); // when selected list  changes update parent component
50
    @Output() selectedValueChanged = new EventEmitter(); // when changed  a method for filtering will be called
51
    @Input() public list = []; // the entries resulted after filtering function
52
    @Input() public selected = []; // the entries selected from user
53
    @Input() public keywordlimit = 3; // the minimum length of keyword
54
    @Input() public showSelected = true; // the minimum length of keyword
55
    @Input() public multipleSelections:boolean = true;
56
    @Input() public allowDuplicates:boolean = false;
57
    @Input() public selectedValue:string = '';
58
    @Input() public keyword = '';
59

  
60
    public warningMessage = "";
61
    public infoMessage = "";
62

  
63
    public tries = 0;
64
    public showInput = true;
65
    public sub;
66
    public done = false;
67
    public showLoading:boolean = false;
68
    public searchTermStream = new Subject<string>();
69
    filtered: Observable<{}> ;
70
    // public numFilteredResults:number = 0;
71

  
72
    @Input() public funderId:string;
73
    @Input() public entityType:string ;
74
    @Input() public depositType:string ;
75
    public results = 0;
76
    public focus:boolean  = false;
77
    constructor (private _search:EntitiesSearchService, private myElement: ElementRef) {
78

  
79

  
80

  
81
    }
82

  
83
    ngOnInit () {
84

  
85
       if(this.entityType == "project" && this.funderId ){
86
        this.filtered  = this.searchTermStream
87
        .debounceTime(300).distinctUntilChanged()
88
        .switchMap((term: string) =>    {
89
            var results = this._search.searchProjectsByFunder(term, (this.funderId == "0"?"":this.funderId));
90
            this.showLoading = false;
91
             this.results = results.length;
92
            return   results;
93
        });
94
      }else if(this.entityType == "organization" && this.depositType ){
95
         this.filtered  = this.searchTermStream
96
        .debounceTime(300).distinctUntilChanged()
97
        .switchMap((term: string) => {
98
          var results = this._search.searchByDepositType(term, this.depositType);
99
          this.showLoading = false;
100
          this.results = results.length;
101
          return   results;
102
      });
103

  
104
      }else{
105

  
106
        this.filtered  = this.searchTermStream
107
        .debounceTime(300)
108
        .distinctUntilChanged()
109
        .switchMap((term: string) => {
110
          var results = this._search.searchByType(term, this.entityType);
111
          this.showLoading = false;
112
          this.results = results.length;
113
          return   results;
114
      });
115

  
116
        this.getSelectedNameFromGivenId();
117
      }
118

  
119
    }
120
    ngOnDestroy(){
121
      if(this.sub && this.sub != undefined){
122
        this.sub.unsubscribe();
123
      }
124
    }
125

  
126
    search() {
127
      this.infoMessage = "";
128
      if(this.keyword == ""){
129
        this.tries = 0;
130
        this.warningMessage = "";
131
      } else if(this.keyword && this.keyword.length < this.keywordlimit){
132
        this.tries++;
133
        if(this.tries == this.keywordlimit -1 ){
134
          this.warningMessage = "Type at least " + this.keywordlimit + " characters";
135
          this.tries = 0;
136
        }
137
      }else{
138

  
139
        this.tries = 0;
140
        this.warningMessage = "";
141
        this.searchTermStream.next(this.keyword);
142
        // if(this.numFilteredResults ==0){
143
          this.showLoading = true;
144
          this.focus = true;
145
        // }
146
      }
147

  
148
    }
149

  
150
    remove(item:any){
151
      var index:number =this.checkIfExists(item,this.selected);
152
       if (index > -1) {
153
          this.selected.splice(index, 1);
154
      }
155
      if(!this.multipleSelections && this.selected.length == 0 ){
156
        this.showInput = true;
157
        this.selectedValue = "";
158
        this.selectedValueChanged.emit({
159
            value: this.selectedValue
160
        });
161

  
162

  
163
      }
164
    }
165
    select(item:any){
166
        if(this.multipleSelections){
167
          var index:number =this.checkIfExists(item,this.selected);
168
           if (index > -1 && !this.allowDuplicates) {
169
              // this.keyword = "";
170
              // this.filtered.splice(0, this.filtered.length);
171
              return;
172
          }
173
          else{
174
              this.selected.push(item);
175
              // this.keyword = "";
176
              // this.filtered.splice(0, this.filtered.length);
177
              this.addItem.emit({
178
                  value: item
179
              });
180
          }
181
      }else{
182
        this.selected.splice(0, this.selected.length);
183
        this.selected.push(item);
184
        // this.filtered.splice(0, this.filtered.length);
185
        this.keyword = "";
186
        this.showInput = false;
187
        this.selectedValue = item.id;
188
        this.selectedValueChanged.emit({
189
            value: this.selectedValue
190
        });
191

  
192
      }
193

  
194
    }
195
    private checkIfExists(item:any,list):number{
196

  
197
       if(item.concept && item.concept.id ){
198

  
199
        for (var _i = 0; _i < list.length; _i++) {
200
            let itemInList = list[_i];
201
            if(item.concept.id == itemInList.concept.id){
202
                 return _i;
203
            }
204
         }
205
      }else if(item.id){
206
        for (var _i = 0; _i < list.length; _i++) {
207
            let itemInList = list[_i];
208
             if(item.id == itemInList.id){
209
                 return _i;
210
            }
211
         }
212
      }
213
      return -1;
214

  
215
    }
216
    showItem(item:any):string{
217

  
218
     if (item.name){ //search
219
         return item.name;
220
      }else if( item.concept && item.concept.label){ //context
221
         return item.concept.label;
222
      }else if (item.label){ //simple
223
         return item.label;
224
      }
225

  
226
    }
227
    truncate(str:string, size:number):string{
228
      if(str == null){return "";}
229
      return (str.length > size)?str.substr(0,size)+'...':str;
230
    }
231
    private getSelectedNameFromGivenId(){
232
      if(this.selectedValue && this.selectedValue.length > 0 ){
233

  
234

  
235
      this.sub = this._search.fetchByType(this.selectedValue,this.entityType).subscribe(
236
        data => {
237
          this.selected.push( data[0]);
238
          this.showInput = false;
239
         },
240
        err => console.log("An error occured"));
241
    }
242
  }
243

  
244
    handleClick(event){
245
     var clickedComponent = event.target;
246
     var inside = false;
247
     do {
248
         if (clickedComponent === this.myElement.nativeElement) {
249
             inside = true;
250
         }
251
        clickedComponent = clickedComponent.parentNode;
252
     } while (clickedComponent);
253
      if(!inside){
254
        this.keyword = "";
255
        // this.numFilteredResults = 0;
256
        this.searchTermStream.next(this.keyword);
257
        this.focus=false;
258
      }
259
  }
260

  
261
}
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/utils/utils.module.ts
9 9
import {PublicationTitleFormatter} from './publicationTitleFormatter.component';
10 10
// import {PagingFormatter} from './pagingFormatter.component';
11 11
import {StaticAutoCompleteComponent} from './staticAutoComplete.component';
12
import {EntitiesAutocompleteComponent} from './entitiesAutoComplete.component';
12
// import {EntitiesAutocompleteComponent} from './entitiesAutoComplete.component';
13 13
import {ShowDataProvidersComponent} from './showDataProviders.component';
14 14
import {ExportCSVComponent} from './exportCSV.component';
15 15
// import {IFrameComponent} from './iframe.component';
16 16
import {AltMetricsComponent} from './altmetrics.component';
17 17

  
18
import {SafeHtmlPipe} from './pipes/safeHTML.pipe';
18
// import {SafeHtmlPipe} from './pipes/safeHTML.pipe';
19 19

  
20 20
import {AlertModal} from './modal/alert';
21 21
import {ModalLoading} from './modal/loading.component';
......
30 30
    PublicationTitleFormatter,
31 31
    // PagingFormatter,
32 32
    StaticAutoCompleteComponent,
33
     EntitiesAutocompleteComponent,
33
    //  EntitiesAutocompleteComponent,
34 34
    ShowDataProvidersComponent,
35 35
    ExportCSVComponent,
36 36
    // IFrameComponent,
37
    SafeHtmlPipe,
37
    // SafeHtmlPipe,
38 38
    AltMetricsComponent
39 39

  
40 40
  ],
......
45 45
      // PagingFormatter,
46 46
      AlertModal, ModalLoading,
47 47
      StaticAutoCompleteComponent,
48
      EntitiesAutocompleteComponent,
48
      // EntitiesAutocompleteComponent,
49 49
      ShowDataProvidersComponent,
50 50
      ExportCSVComponent,
51 51
      // IFrameComponent,
52
      SafeHtmlPipe,
52
      // SafeHtmlPipe,
53 53
      AltMetricsComponent
54 54

  
55 55
    ]
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/utils/iframe.module.ts
1
import { NgModule }            from '@angular/core';
2
import { CommonModule }        from '@angular/common';
3
import { FormsModule }         from '@angular/forms';
4

  
5
import {IFrameComponent} from './iframe.component';
6

  
7

  
8
@NgModule({
9
  imports: [
10
    CommonModule, FormsModule
11
  ],
12
  declarations: [
13
     IFrameComponent
14
  ],
15
  exports: [
16
      IFrameComponent
17
    ]
18
})
19
export class IFrameModule { }
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/services/organizationsService.module.ts
1
import { NgModule}            from '@angular/core';
2
import { CommonModule }        from '@angular/common';
3
import { FormsModule }         from '@angular/forms';
4

  
5
import {SearchOrganizationsService} from './searchOrganizations.service';
6

  
7

  
8
@NgModule({
9
  imports: [
10
    CommonModule, FormsModule
11
  ],
12
  declarations: [
13
  ],
14
  providers:[
15
  SearchOrganizationsService
16
],
17
  exports: [
18
    ]
19
})
20
export class OrganizationsServiceModule { }
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/services/projectsService.module.ts
1
import { NgModule}            from '@angular/core';
2
import { CommonModule }        from '@angular/common';
3
import { FormsModule }         from '@angular/forms';
4

  
5
import {SearchProjectsService} from './searchProjects.service';
6

  
7

  
8
@NgModule({
9
  imports: [
10
    CommonModule, FormsModule
11
  ],
12
  declarations: [
13
  ],
14
  providers:[
15
  SearchProjectsService
16
],
17
  exports: [
18
    ]
19
})
20
export class ProjectsServiceModule { }
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/services/publicationsService.module.ts
1
import { NgModule}            from '@angular/core';
2
import { CommonModule }        from '@angular/common';
3
import { FormsModule }         from '@angular/forms';
4

  
5
import {SearchPublicationsService} from './searchPublications.service';
6

  
7

  
8
@NgModule({
9
  imports: [
10
    CommonModule, FormsModule
11
  ],
12
  declarations: [
13
  ],
14
  providers:[
15
  SearchPublicationsService
16
],
17
  exports: [
18
    ]
19
})
20
export class PublicationsServiceModule { }
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/services/reportsService.module.ts
1
import { NgModule}            from '@angular/core';
2
import { CommonModule }        from '@angular/common';
3
import { FormsModule }         from '@angular/forms';
4

  
5
import {ReportsService} from './reports.service';
6

  
7

  
8
@NgModule({
9
  imports: [
10
    CommonModule, FormsModule
11
  ],
12
  declarations: [
13
  ],
14
  providers:[
15
  ReportsService
16
],
17
  exports: [
18
    ]
19
})
20
export class ReportsServiceModule { }
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/services/services.module.ts
11 11
// import { PersonService} from './person.service';
12 12
// import { ProjectService} from './project.service';
13 13
// import { PublicationService} from './publication.service';
14
import { MetricsService } from './metrics.service';
14
// import { MetricsService } from './metrics.service';
15 15
import { SearchCrossrefService } from './searchCrossref.service';
16 16
import { SearchDataciteService } from './searchDatacite.service';
17 17
import { SearchOrcidService } from './searchOrcid.service';
......
22 22
import {SearchOrganizationsService} from './searchOrganizations.service';
23 23
import {SearchPeopleService} from './searchPeople.service';
24 24
import {SearchProjectsService} from './searchProjects.service';
25
import {EntitiesSearchService} from './entitySearch.service';
25
// import {EntitiesSearchService} from './entitySearch.service';
26 26

  
27 27
import {ISVocabulariesService} from './ISVocabularies.service';
28 28
import {RefineFieldResultsService} from './refineFieldResults.service'
29
import {ReportsService} from './reports.service'
29
// import {ReportsService} from './reports.service'
30 30

  
31 31
import {LoginService} from './login.service';
32 32

  
......
43 43
    //  OrganizationService,
44 44
    // PersonService,
45 45
    //  ProjectService,  PublicationService,
46
    MetricsService,
46
    // MetricsService,
47 47
    SearchCrossrefService, SearchCrossrefService, SearchDataciteService,
48 48
    SearchOrcidService, SearchPublicationsService, SearchDataprovidersService,
49
    // DataProviderService, 
49
    // DataProviderService,
50 50
    SearchProjectsService, SearchDatasetsService,
51 51
    SearchOrganizationsService, SearchPeopleService, ISVocabulariesService,
52 52
    RefineFieldResultsService,
53
    EntitiesSearchService,
53
    // EntitiesSearchService,
54 54
    LoginService,
55
    ReportsService
55
    // ReportsService
56 56
],
57 57
  exports: [
58 58
    ]
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/services/dataProvidersService.module.ts
1
import { NgModule}            from '@angular/core';
2
import { CommonModule }        from '@angular/common';
3
import { FormsModule }         from '@angular/forms';
4

  
5
import {SearchDataprovidersService} from './searchDataproviders.service';
6

  
7

  
8
@NgModule({
9
  imports: [
10
    CommonModule, FormsModule
11
  ],
12
  declarations: [
13
  ],
14
  providers:[
15
  SearchDataprovidersService
16
],
17
  exports: [
18
    ]
19
})
20
export class DataProvidersServiceModule { }
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/services/datasetsService.module.ts
1
import { NgModule}            from '@angular/core';
2
import { CommonModule }        from '@angular/common';
3
import { FormsModule }         from '@angular/forms';
4

  
5
import {SearchDatasetsService} from './searchDatasets.service';
6

  
7

  
8
@NgModule({
9
  imports: [
10
    CommonModule, FormsModule
11
  ],
12
  declarations: [
13
  ],
14
  providers:[
15
  SearchDatasetsService
16
],
17
  exports: [
18
    ]
19
})
20
export class DatasetsServiceModule { }
modules/uoa-services-portal/branches/lazy-routes/portal-2/src/app/deposit/deposit.module.ts
1
/* Common Component of deposit for both datasets & ppublications*/
2

  
1 3
import { NgModule }            from '@angular/core';
2 4
import { CommonModule }        from '@angular/common';
3 5
import { FormsModule }         from '@angular/forms';
4 6

  
5
import { UtilsModule} from '../utils/utils.module'
6

  
7 7
import { DepositComponent } from './deposit.component';
8 8
import { DepositResultComponent } from './depositResult.component';
9
import { DepositPublicationsComponent } from './depositPublications.component';
10
import { DepositPublicationsResultComponent } from './depositPublicationsResult.component';
11
import { DepositDatasetsComponent } from './depositDatasets.component';
12
import { DepositDatasetsResultComponent } from './depositDatasetsResult.component';
9
import {EntitiesAutocompleteModule} from '../utils/entitiesAutoComplete/entitiesAutoComplete.module';
10
import {DataProvidersServiceModule} from '../services/dataProvidersService.module';
13 11

  
14
import {ServicesModule} from '../services/services.module';
15
import {SearchModule} from '../searchPages/search.module';
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff