Project

General

Profile

« Previous | Next » 

Revision 53029

merging changes from trunk r53028

View differences:

modules/uoa-connect-portal/branches/elixir/src/app/utils/subscribe/subscribe.service.ts
1
import { Injectable } from '@angular/core';
2
import { Http, Response, Headers, RequestOptions } from '@angular/http';
3
import { Observable } from 'rxjs/Rx';
4
import {COOKIE} from "../../openaireLibrary/login/utils/helper.class"
5

  
6

  
7
@Injectable()
8
export class SubscribeService {
9

  
10
  constructor(private http:Http) {
11
    }
12
     getCommunitySubscribers(pid:string, url:string){
13
       return this.http.get(url+"/community/"+pid+"/subscribers")
14
                       .map(res => <any> res.json()).do(res => {console.log(res)}).do(res => {console.log(res)});
15
     }
16

  
17
     isSubscribedToCommunity(pid:string, email:string, url:string){
18
       return this.http.get(url+"/community/"+pid+"/subscribers")
19
                       .map(res =>  ((<any>res =="")?{}:<any> res.json()))
20

  
21
                       .map(res => {
22
                         if(res.subscribers && res.subscribers != null){
23

  
24
                           for(var i =0; i< res.subscribers.length; i++ ){
25
                             if(res.subscribers[i]!=null && res.subscribers[i].email == email){
26
                               return true;
27
                             }
28
                           }
29
                         }
30
                         return false;
31

  
32
                       }).do(res => {console.log("Response is "+res)});
33
     }
34
     subscribeToCommunity(pid:string, email:string, url:string){
35
       var subscriber = {"email":email};
36
       return this.http.post(url+"/community/"+pid+"/subscribers", JSON.stringify(subscriber), this.getAuthOptionsWithBody())
37
           .map(res => <any> res.json())
38
           .do(res => {console.log("Response is "+res)});
39
     }
40
     unSubscribeToCommunity(pid:string, email:string, url:string){
41

  
42
       return this.http.post(url+"/community/"+pid+"/subscribers/delete", JSON.stringify([email]), this.getAuthOptionsWithBody())
43
           .map(res => <any> res.json())
44
           .do(res => {console.log("Response is "+res)});
45
     }
46

  
47
     public getAuthOptionsWithBody():RequestOptions{
48
     let headers = new Headers();
49
     headers.append('Content-Type', 'application/json');
50
     headers.append('X-XSRF-TOKEN',  COOKIE.getCookie(COOKIE.cookieName_id));
51
     let options = new RequestOptions({ headers: headers, withCredentials:true  });
52
       return options;
53
     }
54

  
55
}
modules/uoa-connect-portal/branches/elixir/src/app/claims/claimsAdmin/claimsAdmin.component.ts
1
import {Component, ViewChild, Input} from '@angular/core';
2
import {Location} from '@angular/common';
3
import {Observable}       from 'rxjs/Observable';
4

  
5
@Component({
6
    selector: 'openaire-claims-admin',
7
    template: `
8
    <claims-admin>
9
    </claims-admin>
10

  
11
    `,
12

  
13
})
14
export class OpenaireClaimsAdminComponent {
15

  
16
}
modules/uoa-connect-portal/branches/elixir/src/app/claims/claimsAdmin/claimsAdmin.module.ts
1
import { NgModule } from '@angular/core';
2

  
3
import { SharedModule } from '../../shared/shared.module';
4
import { OpenaireClaimsAdminComponent } from './claimsAdmin.component';
5
import { ClaimsAdminRoutingModule } from './claimsAdmin-routing.module';
6
import{ClaimsAdminModule } from '../../openaireLibrary/claims/claimsAdmin/claimsAdmin.module';
7
import {AdminLoginGuard} from '../../openaireLibrary/login/adminLoginGuard.guard';
8
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
9
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
10

  
11

  
12
@NgModule({
13
  imports: [
14
    SharedModule,
15
    ClaimsAdminRoutingModule,
16
    ClaimsAdminModule
17
  ],
18
    providers:[AdminLoginGuard, PreviousRouteRecorder,IsRouteEnabled],
19
  declarations: [
20
    OpenaireClaimsAdminComponent
21
  ]
22
})
23
export class LibClaimsAdminModule { }
modules/uoa-connect-portal/branches/elixir/src/app/claims/claimsAdmin/claimsAdmin-routing.module.ts
1
import { NgModule } from '@angular/core';
2
import { RouterModule } from '@angular/router';
3
import { OpenaireClaimsAdminComponent } from './claimsAdmin.component';
4
import{  AdminLoginGuard} from '../../openaireLibrary/login/adminLoginGuard.guard';
5
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
6
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
7

  
8

  
9
@NgModule({
10
  imports: [
11
    RouterModule.forChild([
12
      { path: '', component: OpenaireClaimsAdminComponent, canActivate: [IsRouteEnabled, AdminLoginGuard],
13
      data: {redirect: '/error' }, canDeactivate: [PreviousRouteRecorder]}])
14
  ]
15
})
16
export class ClaimsAdminRoutingModule { }
modules/uoa-connect-portal/branches/elixir/src/app/claims/claimsByToken/claimsByToken.component.ts
1
import {Component} from '@angular/core';
2

  
3
@Component({
4
    selector: 'openaire-claims-project-manager',
5
    template: `
6
    <p>TODO: fix library issue<p>
7
    <!--claims-project-manager>
8
</claims-project-manager-->
9
    `,
10

  
11
})
12
export class OpenaireClaimsByTokenComponent {
13
}
modules/uoa-connect-portal/branches/elixir/src/app/claims/claimsByToken/claimsByToken.module.ts
1
import { NgModule } from '@angular/core';
2
import { RouterModule } from '@angular/router';
3
import { SharedModule } from '../../shared/shared.module';
4
import { OpenaireClaimsByTokenComponent } from './claimsByToken.component';
5
//ClaimsByTokenModule,
6
import {LoginGuard} from '../../openaireLibrary/login/loginGuard.guard';
7
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
8
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
9

  
10

  
11

  
12
@NgModule({
13
  imports: [
14
    RouterModule,
15
    SharedModule
16

  
17
  ],
18
  providers:[
19
        LoginGuard, PreviousRouteRecorder, IsRouteEnabled
20
  ],
21
  declarations: [
22
    OpenaireClaimsByTokenComponent
23
  ],
24
  exports: [
25
      OpenaireClaimsByTokenComponent
26
    ]
27
})
28
export class LibClaimsByTokenModule { }
modules/uoa-connect-portal/branches/elixir/src/app/claims/claimsByToken/claimsByToken-routing.module.ts
1
import { NgModule } from '@angular/core';
2
import { RouterModule } from '@angular/router';
3
import { OpenaireClaimsByTokenComponent } from './claimsByToken.component';
4

  
5
import {LoginGuard} from '../../openaireLibrary/login/loginGuard.guard';
6
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
7
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
8

  
9

  
10
@NgModule({
11
  imports: [
12
    RouterModule.forChild([
13
      { path: '', component: OpenaireClaimsByTokenComponent, canActivate: [IsRouteEnabled, LoginGuard],
14
      data: {redirect: '/error' }, canDeactivate: [PreviousRouteRecorder]}])
15
  ]
16
})
17
export class ClaimsByTokenRoutingModule { }
modules/uoa-connect-portal/branches/elixir/connect-production-properties.json
66 66
  "searchLinkToDataProvider" : "/search/dataprovider?datasourceId=",
67 67
  "searchLinkToDataset" : "/search/dataset?datasetId=",
68 68
  "searchLinkToOrganization" : "/search/organization?organizationId=",
69
  "searchLinkToOrp" : "/search/other?orpId=",
69 70

  
70 71
  "searchLinkToPublications" : "/search/find/publications",
71 72
  "searchLinkToDataProviders" : "/search/find/dataproviders",
72 73
  "searchLinkToProjects" : "/search/find/projects",
73 74
  "searchLinkToDatasets" : "/search/find/datasets",
74 75
  "searchLinkToSoftware" : "/search/find/software",
76
  "searchLinkToOrps" : "/search/find/other",
75 77
  "searchLinkToOrganizations" : "/search/find/organizations",
76 78
  "searchLinkToCompatibleDataProviders" : "/search/content-providers",
77 79
  "searchLinkToCompatibleDataProvidersTable" : "/search/content-providers-table",
......
85 87
  "searchLinkToAdvancedDatasets" : "/search/advanced/datasets",
86 88
  "searchLinkToAdvancedSoftware" : "/search/advanced/software",
87 89
  "searchLinkToAdvancedDataProviders" : "/search/advanced/dataproviders",
90
  "searchLinkToAdvancedOrps" : "/search/advanced/other",
88 91
  "searchLinkToAdvancedOrganizations" : "/search/advanced/organizations",
89 92
  "searchLinkToAdvancedPeople" : "/search/advanced/people"
90 93
}
modules/uoa-connect-portal/branches/elixir/src/app/community/community.component.html
29 29
          </span>
30 30
          <span *ngIf="showAll">
31 31
              <span *ngFor="let subject of community.subjects.slice(10) let i=index">
32
                  <span *ngIf="subject != ''" class="uk-label">{{subject}}</span>
32
                  <span *ngIf="subject != ''" class="uk-label uk-margin-small-bottom">{{subject}}</span>
33 33
                  <!-- <span *ngIf="i<(community.subjects.length-1)">&nbsp;</span> -->
34 34
              </span>
35 35
          </span>
......
53 53
          <subscribe *ngIf="communityId != null" [communityId]="communityId" showNumbers=true class="uk-margin-left"></subscribe>
54 54
        </p>
55 55
    </div>
56
    <!--invite  *ngIf="communityId != null && communityId != '' && community" [communityId]=communityId [communityName]=community.shortTitle> </invite-->
56 57
    <div *ngIf="communityId != null && communityId != ''" class="uk-child-width-1-6@l uk-child-width-1-6@m uk-child-width-1-3@s uk-text-center uk-grid" uk-grid="">
57 58
      <div *ngIf="publicationTotal != null && IsEntityEnabled('publication')" class="uk-first-column">
58 59
        <div class="uk-card uk-card-default uk-card-small uk-card-body">
......
78 79
          </div>
79 80
        </div>
80 81
      </div>
82
      <div *ngIf="orpTotal != null && IsEntityEnabled('orp')">
83
        <div class="uk-card uk-card-default uk-card-small uk-card-body">
84
          <div>
85
            <a [queryParams]=params routerLinkActive="router-link-active" routerLink="/search/find/other"><h3 class="uk-card-title">{{orpTotal|number}}</h3>
86
            <p>other research products</p></a>
87
          </div>
88
        </div>
89
      </div>
81 90
      <div *ngIf="projectTotal != null && IsEntityEnabled('project')">
82 91
        <div class="uk-card uk-card-default uk-card-small uk-card-body">
83 92
          <div>
......
105 114
    </div>
106 115

  
107 116

  
108
     <div *ngIf="communityId != null && communityId != ''" class="uk-grid-small uk-margin-medium uk-grid" uk-grid="">
117
     <!-- <div *ngIf="communityId != null && communityId != ''" class="uk-grid-small uk-margin-medium uk-grid" uk-grid="">
109 118
      <div  *ngIf="IsEntityEnabled('publication')"  class="uk-width-expand@m">
110 119
        <h2 class="uk-h3 uk-heading-line uk-text-primary">
111 120
          <span>Recent publications</span>
......
124 133
        </h2>
125 134
          <results-comp [(results)]=softwareResults [(total)]=softwareTotal resultType="software" [community]=community [params]=params></results-comp>
126 135
      </div>
127
    </div>
136
      <div *ngIf="IsEntityEnabled('orp')" class="uk-width-expand@m">
137
        <h2 class="uk-h3 uk-heading-line uk-text-primary">
138
          <span>Recent other research products</span>
139
        </h2>
140
          <results-comp [(results)]=orpResults [(total)]=orpTotal resultType="other" [community]=community [params]=params></results-comp>
141
      </div>
142
    </div> -->
128 143

  
129 144

  
130
    <!--div>
145
    <div>
131 146
      <div class="uk-margin-large-top">
132 147
          <h2 class="uk-h3 uk-text-primary">
133 148
              Recent research results
......
138 153
          <li *ngIf="IsEntityEnabled('publication')" class="uk-active"><a href="#">publications</a></li>
139 154
          <li *ngIf="IsEntityEnabled('dataset')"><a href="#">research data</a></li>
140 155
          <li *ngIf="IsEntityEnabled('software')"><a href="#">software</a></li>
156
          <li *ngIf="IsEntityEnabled('orp')"><a href="#">other research products</a></li>
141 157
      </ul>
142 158

  
143 159
      <ul id="resultTabs" class="uk-switcher" style="min-height:450px;">
144 160
          <li *ngIf="IsEntityEnabled('publication')"><results-comp [(results)]=publicationResults [(total)]=publicationTotal resultType="publication" [community]=community [params]=params></results-comp></li>
145 161
          <li *ngIf="IsEntityEnabled('dataset')"><results-comp [(results)]=researchDataResults [(total)]=researchDataTotal resultType="dataset" [community]=community [params]=params></results-comp></li>
146 162
          <li *ngIf="IsEntityEnabled('software')"><results-comp [(results)]=softwareResults [(total)]=softwareTotal resultType="software" [community]=community [params]=params></results-comp></li>
163
          <li *ngIf="IsEntityEnabled('orp')"><results-comp [(results)]=orpResults [(total)]=orpTotal resultType="other" [community]=community [params]=params></results-comp></li>
147 164
      </ul>
148
    </div-->
165
    </div>
149 166

  
150 167
    <statistics-for-dashboard [currentMode]="'showInDashboard'"></statistics-for-dashboard>
151 168

  
modules/uoa-connect-portal/branches/elixir/src/app/community/community.component.ts
34 34
  public publicationTotal = null;
35 35
  public researchDataTotal = null;
36 36
  public softwareTotal = null;
37
  public orpTotal = null;
37 38
  public projectTotal = null;
38 39
  public contentProviderTotal = null;
39 40
  public organizationTotal = null;
......
44 45
  public publicationResults = null;
45 46
  public researchDataResults = null;
46 47
  public softwareResults = null;
48
  public orpResults = null;
47 49

  
48 50
  @Input() communityId = null;
49 51
  public community = null;
......
89 91
           if (this.communityId != null && this.communityId != '') {
90 92
               this._communityService.getCommunity(this.properties, this.properties.communityAPI+this.communityId).subscribe (
91 93
                 community => {
92
                       this.community = community;
93
                       this.params = {communityId: community.communityId};
94
                      this.community = community;
95
                      this.params = {communityId: community.communityId};
94 96
                      this._meta.updateTag({content:community.description},"name='description'");
95 97
                      this._meta.updateTag({content:community.description},"property='og:description'");
96 98
                      this._meta.updateTag({content:community.title},"property='og:title'");
......
143 145
                           }
144 146
                 });
145 147

  
148
               this._searchEntriesService.getTotal(this.properties.searchAPIURLLAst+'other/count?format=json&fq=communityid='+this.communityId).subscribe(
149
                 orpTotal => {
150
                           this.orpTotal = orpTotal;
151
                           if (this.orpTotal > 0) {
152
                             this._searchEntriesService.getResults(this.properties.searchAPIURLLAst+'other?fq=communityid%20exact%20%22'+this.communityId+'%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe(
153
                               orpResults => {
154
                                           this.orpResults = orpResults;
155
                               });
156
                           }
157
               });
158

  
146 159
               this._searchEntriesService.countTotal(this.properties.communityAPI+this.communityId+'/projects').subscribe(
147 160
                 projectTotal => {
148 161
                           this.projectTotal = projectTotal;
modules/uoa-connect-portal/branches/elixir/src/app/searchPages/advanced/advancedSearchOrps.component.ts
1
import {Component, Input} from '@angular/core';
2
import {ActivatedRoute} from '@angular/router';
3
import {PiwikHelper} from '../../utils/piwikHelper';
4
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
5

  
6

  
7
@Component({
8
    selector: 'openaire-advanced-search-orps',
9
    template: `
10
    <advanced-search-orps [(connectCommunityId)]=connectCommunityId>
11
    </advanced-search-orps>
12
    `
13
 })
14

  
15
export class OpenaireAdvancedSearchOrpsComponent {
16
  connectCommunityId:string;
17
  piwikSiteId = null;
18
  constructor ( private  route: ActivatedRoute) {
19
  }
20
  ngOnInit() {
21
    var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname);
22
    this.piwikSiteId = PiwikHelper.siteIDs[communityId];
23
    if(communityId){
24
      this.connectCommunityId = communityId
25
    }else{
26
      this.route.queryParams.subscribe(data => {
27

  
28
        if(data['communityId'] && data['communityId']!=""){
29
          this.connectCommunityId = data['communityId'];
30
        }
31
      });
32
    }
33
  }
34
}
modules/uoa-connect-portal/branches/elixir/src/app/searchPages/advanced/advancedSearchOrps.module.ts
1
import {NgModule}                            from '@angular/core';
2
import {CommonModule}                        from '@angular/common';
3
import {FormsModule}                         from '@angular/forms';
4

  
5
import {AdvancedSearchOrpsRoutingModule}     from './advancedSearchOrps-routing.module';
6
import {OpenaireAdvancedSearchOrpsComponent} from './advancedSearchOrps.component';
7

  
8
import {AdvancedSearchOrpsModule}            from '../../openaireLibrary/searchPages/advanced/advancedSearchOrps.module';
9
import {FreeGuard}                           from '../../openaireLibrary/login/freeGuard.guard';
10
import {PreviousRouteRecorder}               from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
11
import {IsRouteEnabled}                      from '../../openaireLibrary/error/isRouteEnabled.guard'
12

  
13
@NgModule({
14
  imports: [
15
    CommonModule, FormsModule,
16
    AdvancedSearchOrpsModule,
17
    AdvancedSearchOrpsRoutingModule
18
  ],
19
  declarations: [
20
    OpenaireAdvancedSearchOrpsComponent
21
  ],
22
  providers: [
23
    FreeGuard, IsRouteEnabled
24
  ],
25
  exports: [
26
    OpenaireAdvancedSearchOrpsComponent
27
  ]
28
})
29
export class LibAdvancedSearchOrpsModule { }
modules/uoa-connect-portal/branches/elixir/src/app/searchPages/advanced/advancedSearchOrps-routing.module.ts
1
import {NgModule} from '@angular/core';
2
import {RouterModule} from '@angular/router';
3

  
4
import {OpenaireAdvancedSearchOrpsComponent} from './advancedSearchOrps.component';
5
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard';
6
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
7
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'
8

  
9

  
10
@NgModule({
11
  imports: [
12
    RouterModule.forChild([
13
     	{ path: '', component: OpenaireAdvancedSearchOrpsComponent, canActivate: [FreeGuard, IsRouteEnabled], data: {
14
          redirect: '/error'
15
        }, canDeactivate: [PreviousRouteRecorder] }
16

  
17
    ])
18
  ]
19
})
20
export class AdvancedSearchOrpsRoutingModule { }
modules/uoa-connect-portal/branches/elixir/src/app/searchPages/simple/searchPublications-routing.module.ts
11 11
  imports: [
12 12
    RouterModule.forChild([
13 13
     	{ path: '', component: OpenaireSearchPublicationsComponent, canActivate: [FreeGuard, IsRouteEnabled], data: {
14
          redirect: '/error' 
14
          redirect: '/error'
15 15
        }, canDeactivate: [PreviousRouteRecorder]  }
16 16

  
17 17
    ])
modules/uoa-connect-portal/branches/elixir/src/app/searchPages/simple/searchOrps.module.ts
1
import {NgModule}                     from '@angular/core';
2
import {CommonModule}                 from '@angular/common';
3
import {FormsModule}                  from '@angular/forms';
4

  
5
import {SearchOrpsRoutingModule}     from './searchOrps-routing.module';
6
import {OpenaireSearchOrpsComponent} from './searchOrps.component';
7

  
8
import {SearchOrpsModule}            from '../../openaireLibrary/searchPages/simple/searchOrps.module';
9
import {FreeGuard}                    from '../../openaireLibrary/login/freeGuard.guard';
10
import {PreviousRouteRecorder}        from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
11
import {IsRouteEnabled}               from '../../openaireLibrary/error/isRouteEnabled.guard'
12

  
13
@NgModule({
14
  imports: [
15
    CommonModule, FormsModule, SearchOrpsModule,
16
    SearchOrpsRoutingModule
17
  ],
18
  declarations: [
19
    OpenaireSearchOrpsComponent
20
  ],
21
  providers: [
22
    FreeGuard, PreviousRouteRecorder, IsRouteEnabled
23
  ],
24
  exports: [
25
    OpenaireSearchOrpsComponent
26
  ]
27
})
28
export class LibSearchOrpsModule { }
modules/uoa-connect-portal/branches/elixir/src/app/searchPages/simple/searchOrps.component.ts
1
import {Component, Input}   from '@angular/core';
2
import {ActivatedRoute}     from '@angular/router';
3
import {PiwikHelper}        from '../../utils/piwikHelper';
4
import {ConnectHelper}      from '../../openaireLibrary/connect/connectHelper';
5

  
6
@Component({
7
    selector: 'openaire-search-other',
8
    template: `
9

  
10
    <search-orps  openaireLink="https://beta.explore.openaire.eu/search/find/other"
11

  
12
                 [(connectCommunityId)]=connectCommunityId>
13
    </search-orps>
14

  
15
    `
16

  
17
})
18
export class OpenaireSearchOrpsComponent {
19

  
20
  advancedSearchParameters:any;
21
  connectCommunityId:string;
22
  piwikSiteId = null;
23
  constructor ( private  route: ActivatedRoute) {
24
  }
25
  ngOnInit() {
26
    var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname);
27
    this.piwikSiteId = PiwikHelper.siteIDs[communityId];
28
    if(communityId){
29
      this.connectCommunityId = communityId
30
    }else{
31
      this.route.queryParams.subscribe(data => {
32
        if(data['communityId'] && data['communityId']!=""){
33
          this.connectCommunityId = data['communityId'];
34
        }
35
      });
36
    }
37
  }
38
}
modules/uoa-connect-portal/branches/elixir/src/app/searchPages/simple/searchOrps-routing.module.ts
1
import { NgModule } from '@angular/core';
2
import { RouterModule } from '@angular/router';
3

  
4
import {OpenaireSearchOrpsComponent} from './searchOrps.component';
5
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard';
6
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
7
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'
8

  
9

  
10
@NgModule({
11
  imports: [
12
    RouterModule.forChild([
13
     	{ path: '', component: OpenaireSearchOrpsComponent, canActivate: [FreeGuard, IsRouteEnabled], data: {
14
          redirect: '/error'
15
        }, canDeactivate: [PreviousRouteRecorder]  }
16

  
17
    ])
18
  ]
19
})
20
export class SearchOrpsRoutingModule { }
modules/uoa-connect-portal/branches/elixir/src/app/landingPages/orp/libOrp.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
import {RouterModule}                from '@angular/router';
6

  
7
import {SharedModule}                from '../../shared/shared.module';
8
import {OrpModule}                   from '../../openaireLibrary/landingPages/orp/orp.module';
9
import {FreeGuard}                   from '../../openaireLibrary/login/freeGuard.guard';
10
import {PreviousRouteRecorder}       from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
11
import {IsRouteEnabled}              from '../../openaireLibrary/error/isRouteEnabled.guard';
12
import {OpenaireOrpComponent}        from './orp.component';
13
import {OrpRoutingModule}            from './orp-routing.module';
14

  
15
@NgModule({
16
  imports: [
17
    OrpModule, OrpRoutingModule
18
  ],
19
  declarations: [
20
    OpenaireOrpComponent
21
  ],
22
  providers: [
23
    FreeGuard, PreviousRouteRecorder, IsRouteEnabled
24
  ],
25
  exports: [
26
    OpenaireOrpComponent
27
  ]
28
})
29
export class LibOrpModule { }
modules/uoa-connect-portal/branches/elixir/src/app/landingPages/orp/orp.component.ts
1
import {Component, ViewChild, ElementRef} from '@angular/core';
2
import {PiwikHelper}                      from '../../utils/piwikHelper';
3
import {ConnectHelper}                    from '../../openaireLibrary/connect/connectHelper';
4

  
5
@Component({
6
    selector: 'openaire-orp',
7
    template: `<orp [piwikSiteId]=piwikSiteId></orp>`,
8
})
9

  
10
export class OpenaireOrpComponent {
11
    piwikSiteId = null;
12
    constructor (  ) {
13
        var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname);
14
        this.piwikSiteId = PiwikHelper.siteIDs[communityId];
15
    }
16

  
17
    ngOnInit() {
18
    }
19

  
20
}
modules/uoa-connect-portal/branches/elixir/src/app/landingPages/orp/orp-routing.module.ts
1
import {NgModule}               from '@angular/core';
2
import {RouterModule}           from '@angular/router';
3

  
4
import {OpenaireOrpComponent }  from './orp.component';
5
import {FreeGuard}              from '../../openaireLibrary/login/freeGuard.guard';
6
import {PreviousRouteRecorder}  from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
7
import {IsRouteEnabled}         from '../../openaireLibrary/error/isRouteEnabled.guard';
8

  
9
@NgModule({
10
  imports: [
11
    RouterModule.forChild([{
12
      path: '', component: OpenaireOrpComponent, canActivate: [FreeGuard, IsRouteEnabled], data: {
13
        redirect: '/error'
14
      },
15
      canDeactivate: [PreviousRouteRecorder]
16
    }])
17
  ]
18
})
19

  
20
export class OrpRoutingModule { }
modules/uoa-connect-portal/branches/elixir/src/app/communities/communities.component.html
23 23
            <div *ngIf="showCommunity(item)" class="uk-card uk-card-default uk-margin-bottom uk-padding-remove">
24 24
              <span >
25 25
                <div class="uk-card-media-top">
26
                  <a *ngIf="!isProduction()" [queryParams]="{communityId: item.communityId}" routerLinkActive="router-link-active" routerLink="/" target="_blank">
26 27
                    <img *ngIf= "item.logoUrl != null && item.logoUrl != '' " src="{{item.logoUrl}}" alt="{{(item.title)?item.title:item.shortTitle}} logo"  class="uk-height-small uk-responsive-height ">
27 28
                     <span  *ngIf= "item.logoUrl == null || item.logoUrl == '' "  class="uk-icon   uk-margin-top">
28 29
                       <svg width="50" height="50" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="2.5"> <circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle> <path fill="none" stroke="#000" stroke-width="1.1" d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path> <path fill="none" stroke="#000" stroke-width="1.1" d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg>
29 30
                    </span>
31
                  </a>
32
                  <a *ngIf="isProduction()" href="{{'https://'+getProductionPrefix()+item.communityId+'.openaire.eu'}}" target="_blank">
33
                    <img *ngIf= "item.logoUrl != null && item.logoUrl != '' " src="{{item.logoUrl}}" alt="{{(item.title)?item.title:item.shortTitle}} logo"  class="uk-height-small uk-responsive-height ">
34
                     <span  *ngIf= "item.logoUrl == null || item.logoUrl == '' "  class="uk-icon   uk-margin-top">
35
                       <svg width="50" height="50" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="2.5"> <circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle> <path fill="none" stroke="#000" stroke-width="1.1" d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path> <path fill="none" stroke="#000" stroke-width="1.1" d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg>
36
                    </span>
37
                  </a>
30 38
                </div>
31 39
              </span>
32 40
              <div class="uk-card-body">
modules/uoa-connect-portal/branches/elixir/src/app/searchEntries/results/results.component.ts
23 23
                    <a [queryParams]="{softwareId: item.id}" routerLinkActive="router-link-active" routerLink="/search/software" >
24 24
                    {{item.title}} </a>
25 25
                </div>
26
                <div *ngIf="item.type == 'other' && community != null && community.communityId != null">
27
                    <a [queryParams]="{orpId: item.id}" routerLinkActive="router-link-active" routerLink="/search/other" >
28
                    {{item.title}} </a>
29
                </div>
26 30
              </h6>
27 31
                <div *ngIf="item.accessRights" class="el-content"><span class=" uk-label  label-{{item.accessRights}}">{{item.accessRights}}</span><br></div>
28
                <div  >
32
                <div>
29 33
                  <span *ngIf="item.authors != null">
30 34
                    <span class="el-meta uk-margin uk-text-meta" *ngFor='let author of item.authors; let i = index'>
31 35
                      <span *ngIf="i < 10">
......
43 47
      </div>
44 48
    </div>
45 49

  
46
    <div *ngIf="results != null && results.length == 0 || total == 0" class=" uk-alert uk-alert-primary"> No results found </div>
50
    <div *ngIf="results != null && results.length == 0 || total == 0" class=" uk-alert uk-alert-primary"> No results available </div>
47 51
    <hr>
48 52

  
49 53
    <div *ngIf="results != null && results.length > 0">
......
63 67
                View all
64 68
                </a>
65 69
            </div>
70
            <div *ngIf="resultType == 'other'">
71
                <a class="el-content uk-button uk-button-text" [queryParams]=params routerLinkActive="router-link-active" routerLink="/search/find/other">
72
                View all
73
                </a>
74
            </div>
66 75
        </div>
67 76
    </div>`
68 77

  
modules/uoa-connect-portal/branches/elixir/src/app/utils/subscribe/subscribe.component.ts
4 4
import { EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
5 5
import {AlertModal} from '../../openaireLibrary/utils/modal/alert';
6 6

  
7
import {SubscribeService} from './subscribe.service';
7
import {SubscribeService} from '../../openaireLibrary/utils/subscribe/subscribe.service';
8 8
import {Session} from '../../openaireLibrary/login/utils/helper.class';
9 9
@Component({
10 10
    selector: 'subscribe',
modules/uoa-connect-portal/branches/elixir/src/app/utils/subscribe/subscribe.module.ts
2 2
import { CommonModule }        from '@angular/common';
3 3
import { RouterModule } from '@angular/router';
4 4

  
5
import { SubscribeService } from './subscribe.service';
5
import { SubscribeService } from '../../openaireLibrary/utils/subscribe/subscribe.service';
6 6
import {SubscribeComponent} from './subscribe.component';
7 7
import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.module';
8 8

  
modules/uoa-connect-portal/branches/elixir/src/app/utils/piwikHelper.ts
12 12
    "oa-pg":89,
13 13
    "rda":90,
14 14
    "aginfra":93,
15
    "clarin":100
15
    "clarin":100,
16
    "dariah":103
16 17
  }
17 18

  
18 19
}
modules/uoa-connect-portal/branches/elixir/src/app/app.component.ts
72 72
       this._communitiesService.getCommunities(this.properties, this.properties.communitiesAPI).subscribe (
73 73
         communities => {
74 74
               this.userMenuItems =[ new MenuItem("","My profile","","",false,[],[],{}),
75
                  new MenuItem("","My claims","","/myclaims",false,[],["/myclaims"],{}),
75
                  new MenuItem("","My links","","/myclaims",false,[],["/myclaims"],(data['communityId'] && typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:data['communityId']}),
76 76
                ];
77 77
                for(var com of communities){
78 78
                   if((data['communityId'] && data['communityId']!="" &&  com.communityId  == data['communityId'])
......
87 87
                        items: [new MenuItem("","Publications","","/search/find/publications",false,["publication"],["/search/find/publications"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}),
88 88
                        new MenuItem("","Research Data","","/search/find/datasets",false,["dataset"],["/search/find/datasets"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}),
89 89
                        new MenuItem("","Software","","/search/find/software",false,["software"],["/search/find/software"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}),
90
                        new MenuItem("","Other Research Products","","/search/find/other",false,["orp"],["/search/find/other"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}),
90 91
                       new MenuItem("","Projects","","/search/find/projects/",false,["project"],["/search/find/projects"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}),
91 92
                       new MenuItem("","Content Providers","","/search/find/dataproviders",false,["datasource"],["/search/find/dataproviders"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}),
92 93
                      ]},
......
123 124
              }else{
124 125
                this.bottomMenuItems = [
125 126
                  new MenuItem("","About","","/about",false,[],["/about"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}),
126
                  new MenuItem("","Organizations","","/organizations",false,[],["/organizations"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId})               
127
                  new MenuItem("","Organizations","","/organizations",false,[],["/organizations"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId})
127 128
                ];
128 129
                if(this.properties.showContent){
129 130
                  this.bottomMenuItems.push(new MenuItem("","Content Policy","","/content",false,[],[],{}));
modules/uoa-connect-portal/branches/elixir/src/app/claims/directLinking/directLinking.component.ts
1 1
import {Component, Input} from '@angular/core';
2
import {Observable}       from 'rxjs/Observable';
3
import {ActivatedRoute, Router} from '@angular/router';
4
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
2 5

  
3 6
@Component({
4 7
    selector: 'openaire-directLinking',
5
    template: `<directLinking></directLinking>`
8
    template: `<directLinking [communityId]=communityId></directLinking>`
6 9
})
7 10
export class OpenaireDirectLinkingComponent {
11
  communityId:string;
12
  constructor (
13
      private route: ActivatedRoute,
14
      private _router: Router
15

  
16
      ) {
17
        this.route.queryParams.subscribe(
18
          communityId => {
19
                this.communityId = communityId['communityId'];
20
                 if(!this.communityId){
21
                  this.communityId  = ConnectHelper.getCommunityFromDomain(document.location.hostname);
22
                 }
23

  
24
              });
25

  
26
      }
8 27
}
modules/uoa-connect-portal/branches/elixir/src/app/claims/linking/linkingGeneric.component.ts
1 1
import {Component, Input} from '@angular/core';
2 2
import {Observable}       from 'rxjs/Observable';
3 3
import {ActivatedRoute, Router} from '@angular/router';
4
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
4 5

  
5 6
@Component({
6 7
    selector: 'openaire-linking-generic',
7
    template: `<linking-generic></linking-generic>`
8
    template: `<linking-generic [communityId]=communityId></linking-generic>`
8 9

  
9 10
})
10 11
export class OpenaireLinkingComponent {
12
  communityId:string;
13
  constructor (
14
      private route: ActivatedRoute,
15
      private _router: Router
11 16

  
17
      ) {
18
        this.route.queryParams.subscribe(
19
          communityId => {
20
                this.communityId = communityId['communityId'];
21
                 if(!this.communityId){
22
                  this.communityId  = ConnectHelper.getCommunityFromDomain(document.location.hostname);
23
                 }
24

  
25
              });
26

  
27
      }
12 28
}
modules/uoa-connect-portal/branches/elixir/src/app/app-routing.module.ts
7 7
import { OpenaireErrorPageComponent } from './error/errorPage.component';
8 8

  
9 9
const routes: Routes = [
10
  // { path: '', loadChildren: './communities/communities.module#CommunitiesModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
11 10
  { path: '', loadChildren: './communitywrapper/communityWrapper.module#CommunityWrapperModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
12
  // { path: 'communities', loadChildren: './communities/communities.module#CommunitiesModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
13 11
  { path: 'my-communities', loadChildren: './my-communities/communities.module#MyCommunitiesModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
14 12
  { path: 'about', loadChildren: './htmlPages/about/aboutPage.module#AboutPageModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
15 13
  { path: 'content', loadChildren: './content/contentPage.module#ContentPageModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
......
18 16
  { path: 'search/publication', loadChildren: './landingPages/publication/libPublication.module#LibPublicationModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
19 17
  { path: 'search/dataset', loadChildren: './landingPages/dataset/libDataset.module#LibDatasetModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
20 18
  { path: 'search/software', loadChildren: './landingPages/software/libSoftware.module#LibSoftwareModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
19
  { path: 'search/other', loadChildren: './landingPages/orp/libOrp.module#LibOrpModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
21 20
  { path: 'search/project', loadChildren: './landingPages/project/libProject.module#LibProjectModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
22 21
  { path: 'search/dataprovider', loadChildren: '././landingPages/dataProvider/libDataProvider.module#LibDataProviderModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
23 22
  { path: 'search/organization', loadChildren: './landingPages/organization/libOrganization.module#LibOrganizationModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
......
33 32
  { path: 'search/find/projects', loadChildren: './searchPages/simple/searchProjects.module#LibSearchProjectsModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
34 33
  { path: 'search/find/dataproviders', loadChildren: './searchPages/simple/searchDataProviders.module#LibSearchDataProvidersModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
35 34
  { path: 'search/find/organizations', loadChildren: './searchPages/simple/searchOrganizations.module#LibSearchOrganizationsModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
35
  { path: 'search/find/other', loadChildren: './searchPages/simple/searchOrps.module#LibSearchOrpsModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
36 36
  { path: 'search/advanced/publications', loadChildren: './searchPages/advanced/advancedSearchPublications.module#LibAdvancedSearchPublicationsModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
37 37
  { path: 'search/advanced/datasets', loadChildren: './searchPages/advanced/advancedSearchDatasets.module#LibAdvancedSearchDatasetsModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
38 38
  { path: 'search/advanced/software', loadChildren: './searchPages/advanced/advancedSearchSoftware.module#LibAdvancedSearchSoftwareModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
39
  { path: 'search/advanced/other', loadChildren: './searchPages/advanced/advancedSearchOrps.module#LibAdvancedSearchOrpsModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
39 40
  { path: 'project-report', loadChildren: './landingPages/htmlProjectReport/libHtmlProjectReport.module#LibHtmlProjectReportModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
40 41
  { path: 'myclaims', loadChildren: './claims/myClaims/myClaims.module#LibMyClaimsModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
41 42
  { path: 'participate/claim', loadChildren: './claims/linking/linkingGeneric.module#LibLinkingGenericModule', resolve: { envSpecific: EnvironmentSpecificResolver  }},
modules/uoa-connect-portal/branches/elixir/src/assets/sitemap.xml
26 26
      <priority>0.5</priority>
27 27
   </url>
28 28
   <url>
29
      <loc><![CDATA[https://demo.openaire.eu/search/find/other]]></loc>
30
      <changefreq>weekly</changefreq>
31
      <priority>0.5</priority>
32
   </url>
33
   <url>
29 34
      <loc><![CDATA[https://demo.openaire.eu/search/find/datasets]]></loc>
30 35
      <changefreq>weekly</changefreq>
31 36
      <priority>0.5</priority>
......
56 61
      <priority>0.5</priority>
57 62
   </url>
58 63
   <url>
64
      <loc><![CDATA[https://demo.openaire.eu/search/advanced/other]]></loc>
65
      <changefreq>weekly</changefreq>
66
      <priority>0.5</priority>
67
   </url>
68
   <url>
59 69
      <loc><![CDATA[https://demo.openaire.eu/search/advanced/datasets]]></loc>
60 70
      <changefreq>weekly</changefreq>
61 71
      <priority>0.5</priority>
modules/uoa-connect-portal/branches/elixir/src/assets/env-properties.json
76 76
  "searchLinkToDataProvider" : "/search/dataprovider?datasourceId=",
77 77
  "searchLinkToDataset" : "/search/dataset?datasetId=",
78 78
  "searchLinkToOrganization" : "/search/organization?organizationId=",
79
  "searchLinkToOrp" : "/search/other?orpId=",
79 80

  
80 81
  "searchLinkToPublications" : "/search/find/publications",
81 82
  "searchLinkToDataProviders" : "/search/find/dataproviders",
82 83
  "searchLinkToProjects" : "/search/find/projects",
83 84
  "searchLinkToDatasets" : "/search/find/datasets",
84 85
  "searchLinkToSoftware" : "/search/find/software",
86
  "searchLinkToOrps" : "/search/find/other",
85 87
  "searchLinkToOrganizations" : "/search/find/organizations",
86 88
  "searchLinkToCompatibleDataProviders" : "/search/content-providers",
87 89
  "searchLinkToCompatibleDataProvidersTable" : "/search/content-providers-table",
......
94 96
  "searchLinkToAdvancedProjects" : "/search/advanced/projects",
95 97
  "searchLinkToAdvancedDatasets" : "/search/advanced/datasets",
96 98
  "searchLinkToAdvancedSoftware" : "/search/advanced/software",
99
  "searchLinkToAdvancedOrps" : "/search/advanced/other",
97 100
  "searchLinkToAdvancedDataProviders" : "/search/advanced/dataproviders",
98 101
  "searchLinkToAdvancedOrganizations" : "/search/advanced/organizations",
99 102
  "searchLinkToAdvancedPeople" : "/search/advanced/people"
modules/uoa-connect-portal/branches/elixir/static.paths.ts
2 2
  '/',
3 3
  '/lazy',
4 4
  '/home',
5
  '/search/publication','/search/project','/search/dataset','/search/dataprovider','/search/organization',
5
  '/search/publication','/search/other','/search/project','/search/dataset','/search/dataprovider','/search/organization',
6 6
  '/search/find',
7 7
  '/search/person','/search/publication','/search/project','/search/dataset','/search/dataprovider','/search/organization',
8
  '/search/find/people','/search/find/publications','/search/find/projects','/search/find/datasets','/search/find/dataproviders','/search/find/organizations',
9
  '/search/advanced/people','/search/advanced/publications','/search/advanced/projects','/search/advanced/datasets','/search/advanced/dataproviders','/search/advanced/organizations',
8
  '/search/find/people','/search/find/publications','/search/find/other','/search/find/projects','/search/find/datasets','/search/find/dataproviders','/search/find/organizations',
9
  '/search/advanced/people','/search/advanced/publications','/search/advanced/other','/search/advanced/projects','/search/advanced/datasets','/search/advanced/dataproviders','/search/advanced/organizations',
10 10
  '/participate/deposit-publications','/participate/deposit-datasets','/participate/deposit-publications-result','/participate/deposit-datasets-result','/participate/deposit-subject-result',
11 11
  '/search/content-providers','/search/content-providers-table','/search/entity-registries','/search/entity-registries-table','/search/journals','/search/journals-table',
12 12
  '/project-report','/claims','/myclaims','/participate/claim','/participate/direct-claim','/claims-project-manager',

Also available in: Unified diff