Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
sofia.baltzi 2018-04-17 13:00:23 +00:00
parent 8ac980308a
commit 881ea5443d
22 changed files with 586 additions and 434 deletions

View File

@ -1,7 +1,9 @@
import {Component, ViewChild, Input} from '@angular/core'; import {Component, ViewChild, Input} from '@angular/core';
import {Location} from '@angular/common'; import {Location} from '@angular/common';
import {Observable} from 'rxjs/Observable'; import {Title, Meta} from '@angular/platform-browser';
import { Meta} from '../../sharedComponents/metaService';
import {Observable} from 'rxjs/Observable';
@Component({ @Component({
selector: 'claims-admin', selector: 'claims-admin',
@ -35,12 +37,14 @@ export class ClaimsAdminComponent {
@Input() fetchId:string; @Input() fetchId:string;
@Input() isConnect:boolean = false; @Input() isConnect:boolean = false;
constructor ( private _meta: Meta ) { constructor ( private _meta: Meta, private _title: Title) {
if(this.isConnect){ var titleConnect = "OpenAIRE Connect | Claims Administrator";
this._meta.setTitle("OpenAIRE Connect | Claims Administrator"); var title = "OpenAIRE | Claims Administrator";
}else{ if(this.isConnect) {
this._meta.setTitle("OpenAIRE | Claims Administrator"); this._title.setTitle(titleConnect);
} else {
this._title.setTitle(title);
} }

View File

@ -1,19 +1,22 @@
import {Component, ViewChild, Input} from '@angular/core'; import {Component, ViewChild, Input} from '@angular/core';
import {Location} from '@angular/common'; import {Location} from '@angular/common';
import {Observable} from 'rxjs/Observable'; import {ActivatedRoute, Params} from '@angular/router';
import {ActivatedRoute, Params} from '@angular/router'; import {Title, Meta} from '@angular/platform-browser';
import {ClaimsByTokenService} from './claimsByToken.service';
import {ModalSelect} from '../../utils/modal/selectModal.component'; import {DataTableDirective} from 'angular-datatables';
import {ModalLoading} from '../../utils/modal/loading.component'; import {Observable} from 'rxjs/Observable';
import {Session} from '../../login/utils/helper.class'; import{EnvProperties} from '../../utils/properties/env-properties';
import {RouterHelper} from '../../utils/routerHelper.class'; import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe';
import { Meta} from '../../sharedComponents/metaService';
import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe'; import {Session} from '../../login/utils/helper.class';
import { DataTableDirective } from 'angular-datatables'; import {RouterHelper} from '../../utils/routerHelper.class';
import{EnvProperties} from '../../utils/properties/env-properties';
import {ModalSelect} from '../../utils/modal/selectModal.component';
import {ModalLoading} from '../../utils/modal/loading.component';
import {ClaimsByTokenService} from './claimsByToken.service';
@Component({ @Component({
selector: 'claims-project-manager', selector: 'claims-project-manager',
@ -53,10 +56,14 @@ export class ClaimsByTokenComponent {
@ViewChild (ModalSelect) selectModal : ModalSelect; @ViewChild (ModalSelect) selectModal : ModalSelect;
@ViewChild (ModalLoading) loading : ModalLoading ; @ViewChild (ModalLoading) loading : ModalLoading ;
properties:EnvProperties;
properties:EnvProperties;
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper:RouterHelper = new RouterHelper();
constructor ( private route: ActivatedRoute, private claimsByTokenService: ClaimsByTokenService, private _meta: Meta) { constructor (private route: ActivatedRoute,
private claimsByTokenService: ClaimsByTokenService,
private _meta: Meta, private _title: Title) {
} }
ngOnInit() { ngOnInit() {
@ -265,7 +272,9 @@ public sortByTitle2= (claim: any) => {
updateTitle(title:string){ updateTitle(title:string){
var _prefix ="OpenAIRE | "; var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title ); this._meta.updateTag({content:_title},"property='og:title'");
this._title.setTitle(_title);
} }
} }

View File

@ -1,14 +1,17 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {EntitiesSearchService} from '../../utils/entitiesAutoComplete/entitySearch.service'; import {Title, Meta} from '@angular/platform-browser';
import {ClaimProject, ClaimResult} from '../claim-utils/claimEntities.class';
import {SearchPublicationsService} from '../../services/searchPublications.service'; import {EnvProperties} from '../../utils/properties/env-properties';
import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {SearchSoftwareService} from '../../services/searchSoftware.service'; import {ClaimProject, ClaimResult} from '../claim-utils/claimEntities.class';
import{EnvProperties} from '../../utils/properties/env-properties';
import {EntitiesSearchService} from '../../utils/entitiesAutoComplete/entitySearch.service';
import {SearchPublicationsService} from '../../services/searchPublications.service';
import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {SearchSoftwareService} from '../../services/searchSoftware.service';
import { Meta} from '../../sharedComponents/metaService';
@Component({ @Component({
selector: 'directLinking', selector: 'directLinking',
@ -34,9 +37,14 @@ export class DirectLinkingComponent {
validInput:boolean = null;//'true; validInput:boolean = null;//'true;
properties:EnvProperties; properties:EnvProperties;
constructor ( private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService, constructor (private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService,
private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService, private softwareSearch:SearchSoftwareService, private _meta: Meta) { private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService,
this._meta.setTitle("OpenAIRE | Direct Linking"); private softwareSearch:SearchSoftwareService, private _meta: Meta, private _title: Title) {
var title = "OpenAIRE | Direct Linking";
this._meta.updateTag({content:title},"property='og:title'");
this._title.setTitle(title);
} }
ngOnInit() { ngOnInit() {
this.route.data this.route.data

View File

@ -1,12 +1,16 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {ActivatedRoute, Router} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router'; import {Title, Meta} from '@angular/platform-browser';
import {EntitiesSearchService} from '../../utils/entitiesAutoComplete/entitySearch.service';
import {ClaimProject, ClaimResult} from '../claim-utils/claimEntities.class'; import {Observable} from 'rxjs/Observable';
import {SearchPublicationsService} from '../../services/searchPublications.service';
import {SearchDatasetsService} from '../../services/searchDatasets.service'; import {EnvProperties} from '../../utils/properties/env-properties';
import { Meta} from '../../sharedComponents/metaService';
import{EnvProperties} from '../../utils/properties/env-properties'; import {ClaimProject, ClaimResult} from '../claim-utils/claimEntities.class';
import {EntitiesSearchService} from '../../utils/entitiesAutoComplete/entitySearch.service';
import {SearchPublicationsService} from '../../services/searchPublications.service';
import {SearchDatasetsService} from '../../services/searchDatasets.service';
declare var UIkit:any; declare var UIkit:any;
@ -38,9 +42,13 @@ export class LinkingGenericComponent {
sub:any =null; sub:any =null;
properties:EnvProperties; properties:EnvProperties;
constructor ( private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService, constructor (private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService,
private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService, private _meta: Meta) { private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService,
this._meta.setTitle("OpenAIRE | Linking"); private _meta: Meta, private _title: Title) {
var title = "OpenAIRE | Linking";
this._meta.updateTag({content:title},"property='og:title'");
this._title.setTitle(title);
} }
ngOnInit() { ngOnInit() {
this.route.data this.route.data

View File

@ -1,7 +1,6 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import { Meta} from '../../sharedComponents/metaService'; import {Title, Meta} from '@angular/platform-browser';
@Component({ @Component({
selector: 'my-claims', selector: 'my-claims',
@ -26,8 +25,11 @@ import { Meta} from '../../sharedComponents/metaService';
}) })
export class MyClaimsComponent { export class MyClaimsComponent {
constructor ( private _meta: Meta ) { constructor (private _meta: Meta, private _title: Title) {
this._meta.setTitle("OpenAIRE | My Claims"); var title = "OpenAIRE | My Claims";
this._meta.updateTag({content:title},"property='og:title'");
this._title.setTitle(title);
} }
ngOnInit() { ngOnInit() {

View File

@ -1,10 +1,12 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Router, ActivatedRoute} from '@angular/router';
import { Router, ActivatedRoute} from '@angular/router'; import {Title, Meta} from '@angular/platform-browser';
import {PiwikService} from '../../utils/piwik/piwik.service';
import{EnvProperties} from '../../utils/properties/env-properties';
import { Meta} from '../../sharedComponents/metaService';
import {Observable} from 'rxjs/Observable';
import {EnvProperties} from '../../utils/properties/env-properties';
import {PiwikService} from '../../utils/piwik/piwik.service';
@Component({ @Component({
@ -29,17 +31,25 @@ export class DepositBySubjectComponent {
@Input() subjectKeyword: string=''; @Input() subjectKeyword: string='';
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
properties:EnvProperties; properties:EnvProperties;
constructor (private _router: Router,private route: ActivatedRoute, private _meta: Meta, private _piwikService:PiwikService) { }
constructor (private _router: Router,private route: ActivatedRoute,
private _meta: Meta, private _title: Title,
private _piwikService: PiwikService) { }
ngOnInit() { ngOnInit() {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this._meta.setTitle("Deposit by Subjects" ); var title = "Deposit by Subjects";
this._meta.updateProperty("og:title","Deposit by subjects"); var description = "Openaire, repositories, open access, content provider, compatibility, organization, deposit by subject"
this._meta.updateProperty("og:url", data.envSpecific.baseLink+this._router.url); var url = data.envSpecific.baseLink+this._router.url;
this._meta.updateMeta("description", "Openaire, repositories, open access, content provider, compatibility, organization, deposit by subject");
this._meta.updateProperty("og:description", "Openaire, repositories, open access, content provider, compatibility, organization, deposit by subject"); this._title.setTitle(title);
this._meta.updateTag({content:title},"property='og:title'");
this._meta.updateTag({content:description},"name='description'");
this._meta.updateTag({content:description},"property='og:description'");
this._meta.updateTag({content:url},"property='og:url'");
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this._piwikService.trackView(this.properties, "Deposit by subjects" , this.piwikSiteId).subscribe(); this._piwikService.trackView(this.properties, "Deposit by subjects" , this.piwikSiteId).subscribe();
} }

View File

@ -1,17 +1,20 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Router} from '@angular/router';
import {ErrorCodes} from '../../utils/properties/errorCodes'; import {ActivatedRoute} from '@angular/router';
import { Router } from '@angular/router'; import {Title, Meta} from '@angular/platform-browser';
import { ActivatedRoute } from '@angular/router';
import { FetchDataproviders } from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
import { SearchDataprovidersService } from '../../services/searchDataproviders.service';
import {OrganizationService} from '../../services/organization.service'; import {Observable} from 'rxjs/Observable';
import { Meta} from '../../sharedComponents/metaService';
import {RouterHelper} from '../../utils/routerHelper.class'; import {EnvProperties} from '../../utils/properties/env-properties';
import {PiwikService} from '../../utils/piwik/piwik.service';
import{EnvProperties} from '../../utils/properties/env-properties'; import {ErrorCodes} from '../../utils/properties/errorCodes';
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
import {RouterHelper} from '../../utils/routerHelper.class';
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
import {OrganizationService} from '../../services/organization.service';
import {PiwikService} from '../../utils/piwik/piwik.service';
@Component({ @Component({
selector: 'deposit-by-subject-result', selector: 'deposit-by-subject-result',
@ -44,20 +47,24 @@ export class DepositBySubjectResultComponent {
piwiksub: any; piwiksub: any;
properties:EnvProperties; properties:EnvProperties;
constructor ( private _router: Router, constructor (private _router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
private _searchDataprovidersService: SearchDataprovidersService, private _searchDataprovidersService: SearchDataprovidersService,
private _meta: Meta, private _piwikService:PiwikService) { private _meta: Meta,
private _title: Title,
private _piwikService:PiwikService) {
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService); this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
this.status = this.errorCodes.LOADING; this.status = this.errorCodes.LOADING;
this.updateTitle("Deposit "+this.requestFor);
this.updateDescription("Openaire, repositories, open access, content provider, compatibility, organization, deposit "+ this.requestFor); var description = "Openaire, repositories, open access, content provider, compatibility, organization, deposit "+ this.requestFor;
var title = "Deposit "+this.requestFor;
this.updateTitle(title);
this.updateDescription(description);
} }
ngOnInit() { ngOnInit() {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
@ -118,17 +125,18 @@ export class DepositBySubjectResultComponent {
this.searchDataproviders(); this.searchDataproviders();
} }
private updateDescription(description:string){ private updateDescription(description:string) {
this._meta.updateMeta("description", description); this._meta.updateTag({content:description},"name='description'");
this._meta.updateProperty("og:description", description); this._meta.updateTag({content:description},"property='og:description'");
} }
private updateTitle(title:string){ private updateTitle(title:string) {
var _prefix ="OpenAIRE | "; var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title );
this._meta.updateProperty("og:title",_title); this._title.setTitle(_title);
this._meta.updateTag({content:_title},"property='og:title'");
} }
private updateUrl(url:string){ private updateUrl(url:string) {
this._meta.updateProperty("og:url", url); this._meta.updateTag({content:url},"property='og:url'");
} }
} }

View File

@ -1,9 +1,12 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Router, ActivatedRoute} from '@angular/router';
import { Router, ActivatedRoute} from '@angular/router'; import {Title, Meta} from '@angular/platform-browser';
import { Meta} from '../sharedComponents/metaService';
import {PiwikService} from '../utils/piwik/piwik.service'; import {Observable} from 'rxjs/Observable';
import{EnvProperties} from '../utils/properties/env-properties';
import {EnvProperties} from '../utils/properties/env-properties';
import {PiwikService} from '../utils/piwik/piwik.service';
@Component({ @Component({
@ -38,10 +41,15 @@ export class DepositComponent {
piwiksub:any; piwiksub:any;
properties:EnvProperties; properties:EnvProperties;
constructor ( private route: ActivatedRoute, private _router: Router, private _meta: Meta, private _piwikService:PiwikService) { constructor (private route: ActivatedRoute, private _router: Router,
private _meta: Meta, private _title: Title,
private _piwikService:PiwikService) {
this.updateTitle("Deposit "+this.requestFor); var title = "Deposit "+this.requestFor;
this.updateDescription("Openaire, repositories, open access, content provider, compatibility, organization, deposit "+ this.requestFor); var description = "Openaire, repositories, open access, content provider, compatibility, organization, deposit "+ this.requestFor;
this.updateTitle(title);
this.updateDescription(description);
} }
ngOnInit() { ngOnInit() {
this.route.data this.route.data
@ -79,21 +87,21 @@ export class DepositComponent {
} }
} }
public valueChanged($event){ public valueChanged($event) {
this.selectedId = $event.value; this.selectedId = $event.value;
} }
private updateDescription(description:string){ private updateDescription(description:string) {
this._meta.updateMeta("description", description); this._meta.updateTag({content:description},"name='description'");
this._meta.updateProperty("og:description", description); this._meta.updateTag({content:description},"property='og:description'");
} }
private updateTitle(title:string){ private updateTitle(title:string) {
var _prefix ="OpenAIRE | "; var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title ); this._title.setTitle(_title);
this._meta.updateProperty("og:title",_title); this._meta.updateTag({content:_title},"property='og:title'");
} }
private updateUrl(url:string){ private updateUrl(url:string) {
this._meta.updateProperty("og:url", url); this._meta.updateTag({content:url},"property='og:url'");
} }
} }

View File

@ -1,16 +1,17 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Router, ActivatedRoute} from '@angular/router';
import {ErrorCodes} from '../utils/properties/errorCodes'; import {Title, Meta} from '@angular/platform-browser';
import { Router, ActivatedRoute } from '@angular/router';
import { FetchDataproviders } from '../utils/fetchEntitiesClasses/fetchDataproviders.class';
import { SearchDataprovidersService } from '../services/searchDataproviders.service';
import {OrganizationService} from '../services/organization.service'; import {Observable} from 'rxjs/Observable';
import { Meta} from '../sharedComponents/metaService'; import {ErrorCodes} from '../utils/properties/errorCodes';
import{EnvProperties} from '../utils/properties/env-properties';
import {RouterHelper} from '../utils/routerHelper.class'; import {RouterHelper} from '../utils/routerHelper.class';
import {FetchDataproviders} from '../utils/fetchEntitiesClasses/fetchDataproviders.class';
import {SearchDataprovidersService} from '../services/searchDataproviders.service';
import {OrganizationService} from '../services/organization.service';
import {PiwikService} from '../utils/piwik/piwik.service'; import {PiwikService} from '../utils/piwik/piwik.service';
import{EnvProperties} from '../utils/properties/env-properties';
@Component({ @Component({
selector: 'deposit-result', selector: 'deposit-result',
@ -160,13 +161,19 @@ export class DepositResultComponent {
private route: ActivatedRoute, private route: ActivatedRoute,
private _searchDataprovidersService: SearchDataprovidersService, private _searchDataprovidersService: SearchDataprovidersService,
private _organizationService: OrganizationService, private _organizationService: OrganizationService,
private _meta: Meta, private _piwikService:PiwikService) { private _meta: Meta,
private _title: Title,
private _piwikService:PiwikService) {
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService); this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
this.status = this.errorCodes.LOADING; this.status = this.errorCodes.LOADING;
this.updateTitle("Deposit "+this.requestFor);
this.updateDescription("Openaire, repositories, open access, content provider, compatibility, organization, deposit "+ this.requestFor); var description = "Deposit "+this.requestFor;
var title = "Openaire, repositories, open access, content provider, compatibility, organization, deposit "+ this.requestFor;
this.updateTitle(title);
this.updateDescription(description);
} }
ngOnInit() { ngOnInit() {
@ -274,17 +281,17 @@ export class DepositResultComponent {
} }
} }
private updateDescription(description:string){ private updateDescription(description:string) {
this._meta.updateMeta("description", description); this._meta.updateTag({content:description},"name='description'");
this._meta.updateProperty("og:description", description); this._meta.updateTag({content:description},"property='og:description'");
} }
private updateTitle(title:string){ private updateTitle(title:string){
var _prefix ="OpenAIRE | "; var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title ); this._title.setTitle(_title);
this._meta.updateProperty("og:title",_title); this._meta.updateTag({content:_title},"property='og:title'");
} }
private updateUrl(url:string){ private updateUrl(url:string){
this._meta.updateProperty("og:url", url); this._meta.updateTag({content:url},"property='og:url'");
} }
} }

View File

@ -1,26 +1,31 @@
import {Component, ViewChild, ElementRef, Input} from '@angular/core'; import {Component, ViewChild} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {ElementRef, Input} from '@angular/core';
import {DataProviderService} from './dataProvider.service'; import {ActivatedRoute, Router} from '@angular/router';
import {DataProviderInfo} from '../../utils/entities/dataProviderInfo'; import {Title, Meta} from '@angular/platform-browser';
import {ActivatedRoute, Router} from '@angular/router';
import { Meta} from '../../sharedComponents/metaService'; import {Observable} from 'rxjs/Observable';
import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class';
import { SearchPublicationsService } from '../../services/searchPublications.service';
import { FetchDatasets } from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
import { SearchDatasetsService } from '../../services/searchDatasets.service';
import { FetchProjects } from '../../utils/fetchEntitiesClasses/fetchProjects.class';
import { SearchProjectsService } from '../../services/searchProjects.service';
import { FetchDataproviders } from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
import { SearchDataprovidersService } from '../../services/searchDataproviders.service';
import { RelatedDatasourcesTabComponent } from './relatedDatasourcesTab.component';
import {ErrorCodes} from '../../utils/properties/errorCodes';
import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import{EnvProperties} from '../../utils/properties/env-properties';
import 'rxjs/add/operator/switch'; import 'rxjs/add/operator/switch';
import 'rxjs/add/operator/switchMap'; import 'rxjs/add/operator/switchMap';
import {EnvProperties} from '../../utils/properties/env-properties';
import {DataProviderInfo} from '../../utils/entities/dataProviderInfo';
import {DataProviderService} from './dataProvider.service';
import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class';
import {SearchPublicationsService} from '../../services/searchPublications.service';
import {FetchDatasets} from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class';
import {SearchProjectsService} from '../../services/searchProjects.service';
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
import {RelatedDatasourcesTabComponent} from './relatedDatasourcesTab.component';
import {ErrorCodes} from '../../utils/properties/errorCodes';
import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
@Component({ @Component({
selector: 'dataprovider', selector: 'dataprovider',
templateUrl: 'dataProvider.component.html', templateUrl: 'dataProvider.component.html',
@ -92,6 +97,7 @@ export class DataProviderComponent {
private _piwikService:PiwikService, private _piwikService:PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private _meta: Meta, private _meta: Meta,
private _title: Title,
private _router: Router, private _router: Router,
private _searchPublicationsService: SearchPublicationsService, private _searchPublicationsService: SearchPublicationsService,
private _searchDatasetsService: SearchDatasetsService, private _searchDatasetsService: SearchDatasetsService,
@ -177,18 +183,18 @@ export class DataProviderComponent {
} }
} }
private updateDescription(description:string){ private updateDescription(description:string) {
this._meta.updateMeta("description", description); this._meta.updateTag({content:description},"name='description'");
this._meta.updateProperty("og:description", description); this._meta.updateTag({content:description},"property='og:description'");
} }
private updateTitle(title:string){ private updateTitle(title:string) {
var _prefix ="OpenAIRE | "; var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title ); this._title.setTitle(_title);
this._meta.updateProperty("og:title",_title); this._meta.updateTag({content:_title},"property='og:title'");
} }
private updateUrl(url:string){ private updateUrl(url:string) {
this._meta.updateProperty("og:url", url); this._meta.updateTag({content:url},"property='og:url'");
} }
private initTabs(){ private initTabs(){

View File

@ -1,11 +1,14 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import {ActivatedRoute, Params, Router} from '@angular/router'; import {ActivatedRoute, Params, Router} from '@angular/router';
import {HtmlProjectReportService} from './htmlProjectReport.service'; import {Title, Meta} from '@angular/platform-browser';
import {ProjectService} from '../project/project.service';
import { Meta} from '../../sharedComponents/metaService'; import {Observable} from 'rxjs/Observable';
import {PiwikService} from '../../utils/piwik/piwik.service';
import{EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import {HtmlProjectReportService} from './htmlProjectReport.service';
import {ProjectService} from '../project/project.service';
import {PiwikService} from '../../utils/piwik/piwik.service';
declare var UIkit: any; declare var UIkit: any;
@ -64,7 +67,9 @@ export class HtmlProjectReportComponent{
private htmlService: HtmlProjectReportService, private htmlService: HtmlProjectReportService,
private _piwikService:PiwikService, private _piwikService:PiwikService,
private _projectService: ProjectService, private _projectService: ProjectService,
private _meta: Meta, private _router: Router) { private _meta: Meta,
private _title: Title,
private _router: Router) {
} }
ngOnInit() { ngOnInit() {
@ -93,8 +98,11 @@ export class HtmlProjectReportComponent{
this.resultsType = 'software'; this.resultsType = 'software';
} }
this.updateTitle("Project's "+this.resultsType+" report"); var title = "Project's "+this.resultsType+" report";
this.updateDescription("project, project "+ this.resultsType +" report, funding, open access, publications, research data, software"); var description = "project, project "+ this.resultsType +" report, funding, open access, publications, research data, software";
this.updateTitle(title);
this.updateDescription(description);
} else { } else {
this.showLoading = false; this.showLoading = false;
this.warningMessage="Requested type should be publication or research data or software"; this.warningMessage="Requested type should be publication or research data or software";
@ -238,16 +246,16 @@ export class HtmlProjectReportComponent{
} }
private updateDescription(description:string){ private updateDescription(description:string){
this._meta.updateMeta("description", description); this._meta.updateTag({content:description},"name='description'");
this._meta.updateProperty("og:description", description); this._meta.updateTag({content:description},"property='og:description'");
} }
private updateTitle(title:string){ private updateTitle(title:string){
var _prefix ="OpenAIRE | "; var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title ); this._title.setTitle(_title);
this._meta.updateProperty("og:title",_title); this._meta.updateTag({content:_title},"property='og:title'");
} }
private updateUrl(url:string){ private updateUrl(url:string){
this._meta.updateProperty("og:url", url); this._meta.updateTag({content:url},"property='og:url'");
} }
} }

View File

@ -1,27 +1,29 @@
import {Component, ViewChild, ElementRef, Input} from '@angular/core'; import {Component, ViewChild} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {ElementRef, Input} from '@angular/core';
import {Subject} from 'rxjs/Subject'; import {ActivatedRoute, Router} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router'; import {Title, Meta} from '@angular/platform-browser';
import {OrganizationService} from '../../services/organization.service'; import {Observable} from 'rxjs/Observable';
import {OrganizationInfo} from '../../utils/entities/organizationInfo'; import {Subject} from 'rxjs/Subject';
import {ReportsService} from '../../services/reports.service';
import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class';
import {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class';
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
import {SearchPublicationsService} from '../../services/searchPublications.service';
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
import {SearchProjectsService} from '../../services/searchProjects.service';
import { Meta} from '../../sharedComponents/metaService';
import {ErrorCodes} from '../../utils/properties/errorCodes';
import {SearchingProjectsTabComponent} from '../landing-utils/searchingProjectsInTab.component';
import {RouterHelper} from '../../utils/routerHelper.class';
import {ModalLoading} from '../../utils/modal/loading.component'; import {OrganizationService} from '../../services/organization.service';
import {AlertModal} from '../../utils/modal/alert'; import {OrganizationInfo} from '../../utils/entities/organizationInfo';
import {PiwikService} from '../../utils/piwik/piwik.service'; import {ReportsService} from '../../services/reports.service';
import {StringUtils} from '../../utils/string-utils.class'; import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class';
import{EnvProperties} from '../../utils/properties/env-properties'; import {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class';
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
import {SearchPublicationsService} from '../../services/searchPublications.service';
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
import {SearchProjectsService} from '../../services/searchProjects.service';
import {ErrorCodes} from '../../utils/properties/errorCodes';
import {SearchingProjectsTabComponent} from '../landing-utils/searchingProjectsInTab.component';
import {RouterHelper} from '../../utils/routerHelper.class';
import {ModalLoading} from '../../utils/modal/loading.component';
import {AlertModal} from '../../utils/modal/alert';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {StringUtils} from '../../utils/string-utils.class';
import {EnvProperties} from '../../utils/properties/env-properties';
@Component({ @Component({
selector: 'organization', selector: 'organization',
@ -97,7 +99,9 @@ export class OrganizationComponent {
private _searchDataprovidersService: SearchDataprovidersService, private _searchDataprovidersService: SearchDataprovidersService,
private _reportsService: ReportsService, private _reportsService: ReportsService,
private _searchPublicationsService: SearchPublicationsService, private _searchPublicationsService: SearchPublicationsService,
private _searchProjectsService: SearchProjectsService, private _meta: Meta, private _searchProjectsService: SearchProjectsService,
private _meta: Meta,
private _title: Title,
private _router: Router) { private _router: Router) {
this.fetchPublications = new FetchPublications(this._searchPublicationsService); this.fetchPublications = new FetchPublications(this._searchPublicationsService);
@ -425,18 +429,18 @@ export class OrganizationComponent {
// }//); // }//);
} }
private updateDescription(description:string){ private updateDescription(description:string) {
this._meta.updateMeta("description", description); this._meta.updateTag({content:description},"name='description'");
this._meta.updateProperty("og:description", description); this._meta.updateTag({content:description},"property='og:description'");
} }
private updateTitle(title:string){ private updateTitle(title:string){
var _prefix ="OpenAIRE | "; var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title ); this._title.setTitle(_title);
this._meta.updateProperty("og:title",_title); this._meta.updateTag({content:_title},"property='og:title'");
} }
private updateUrl(url:string){ private updateUrl(url:string){
this._meta.updateProperty("og:url", url); this._meta.updateTag({content:url},"property='og:url'");
} }
private openLoading(){ private openLoading(){

View File

@ -1,30 +1,35 @@
import {Component, ViewChild, ElementRef, Input} from '@angular/core'; import {Component, ViewChild} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {ElementRef, Input} from '@angular/core';
import {ActivatedRoute, Params, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {ProjectService} from './project.service'; import {Params} from '@angular/router';
import {ProjectInfo} from '../../utils/entities/projectInfo'; import {Title, Meta} from '@angular/platform-browser';
import {RouterHelper} from '../../utils/routerHelper.class';
import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class'; import {Observable} from 'rxjs/Observable';
import { SearchPublicationsService } from '../../services/searchPublications.service';
import { FetchDatasets } from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
import { SearchDatasetsService } from '../../services/searchDatasets.service';
import { FetchSoftware } from '../../utils/fetchEntitiesClasses/fetchSoftware.class';
import { SearchSoftwareService } from '../../services/searchSoftware.service';
import {ModalLoading} from '../../utils/modal/loading.component'; import {ProjectService} from './project.service';
import {ProjectInfo} from '../../utils/entities/projectInfo';
import {RouterHelper} from '../../utils/routerHelper.class';
import {ReportsService} from '../../services/reports.service'; import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class';
import { ErrorCodes} from '../../utils/properties/errorCodes'; import {SearchPublicationsService} from '../../services/searchPublications.service';
import { Meta} from '../../sharedComponents/metaService'; import {FetchDatasets} from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {FetchSoftware} from '../../utils/fetchEntitiesClasses/fetchSoftware.class';
import {SearchSoftwareService} from '../../services/searchSoftware.service';
import {PiwikService} from '../../utils/piwik/piwik.service'; import {ModalLoading} from '../../utils/modal/loading.component';
import{EnvProperties} from '../../utils/properties/env-properties';
import {ReportsService} from '../../services/reports.service';
import {ErrorCodes} from '../../utils/properties/errorCodes'
import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties';
@Component({ @Component({
selector: 'project', selector: 'project',
templateUrl: 'project.component.html', templateUrl: 'project.component.html',
}) })
export class ProjectComponent{ export class ProjectComponent{
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
public projectInfo: ProjectInfo; public projectInfo: ProjectInfo;
@ -94,7 +99,9 @@ properties:EnvProperties;
private _searchPublicationsService: SearchPublicationsService, private _searchPublicationsService: SearchPublicationsService,
private _searchDatasetsService: SearchDatasetsService, private _searchDatasetsService: SearchDatasetsService,
private _searchSoftwareService: SearchSoftwareService, private _searchSoftwareService: SearchSoftwareService,
private _reportsService: ReportsService, private _meta: Meta, private _reportsService: ReportsService,
private _meta: Meta,
private _title: Title,
private _router: Router) { private _router: Router) {
} }
@ -112,8 +119,11 @@ properties:EnvProperties;
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService); this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
this.fetchSoftware = new FetchSoftware(this._searchSoftwareService); this.fetchSoftware = new FetchSoftware(this._searchSoftwareService);
this.updateTitle("Project"); var title = "Project";
this.updateDescription("project, funding, open access, publications, research data, software"); var description = "project, funding, open access, publications, research data, software";
this.updateTitle(title);
this.updateDescription(description);
this.projectId = params['projectId']; this.projectId = params['projectId'];
var grantId = params['grantId']; var grantId = params['grantId'];
@ -375,18 +385,18 @@ actionsAfterGettingProjectInfo(){
this.pageViews = $event.pageViews; this.pageViews = $event.pageViews;
} }
private updateDescription(description:string){ private updateDescription(description:string) {
this._meta.updateMeta("description", description); this._meta.updateTag({content:description},"name='description'");
this._meta.updateProperty("og:description", description); this._meta.updateTag({content:description},"property='og:description'");
} }
private updateTitle(title:string){ private updateTitle(title:string) {
var _prefix ="OpenAIRE | "; var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title ); this._title.setTitle(_title);
this._meta.updateProperty("og:title",_title); this._meta.updateTag({content:_title},"property='og:title'");
} }
private updateUrl(url:string){ private updateUrl(url:string) {
this._meta.updateProperty("og:url", url); this._meta.updateTag({content:url},"property='og:url'");
} }
private openLoading(){ private openLoading(){

View File

@ -1,14 +1,16 @@
import {Component, ViewChild, ElementRef, Input} from '@angular/core'; import {Component, ViewChild} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {ElementRef, Input} from '@angular/core';
import {PublicationService} from './publication.service'; import {ActivatedRoute, Router} from '@angular/router';
import {PublicationInfo} from '../../utils/entities/publicationInfo'; import {Title, Meta} from '@angular/platform-browser';
import {ActivatedRoute, Router} from '@angular/router';
import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import{EnvProperties} from '../../utils/properties/env-properties';
import { Meta} from '../../sharedComponents/metaService'; import {Observable} from 'rxjs/Observable';
import {EnvProperties} from '../../utils/properties/env-properties';
import {PublicationInfo} from '../../utils/entities/publicationInfo';
import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {PublicationService} from './publication.service';
@Component({ @Component({
@ -67,7 +69,9 @@ export class PublicationComponent {
constructor ( private element: ElementRef, constructor ( private element: ElementRef,
private _publicationService: PublicationService, private _publicationService: PublicationService,
private _piwikService:PiwikService, private _piwikService:PiwikService,
private route: ActivatedRoute, private _meta: Meta, private route: ActivatedRoute,
private _meta: Meta,
private _title: Title,
private _router: Router) { private _router: Router) {
} }
@ -205,18 +209,18 @@ export class PublicationComponent {
} }
private updateDescription(description:string){ private updateDescription(description:string){
this._meta.updateMeta("description", description); this._meta.updateTag({content:description},"name='description'");
this._meta.updateProperty("og:description", description); this._meta.updateTag({content:description},"property='og:description'");
} }
private updateTitle(title:string){ private updateTitle(title:string){
var _prefix ="OpenAIRE | "; var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title ); this._title.setTitle(title);
this._meta.updateProperty("og:title",_title); this._meta.updateTag({content:title},"property='og:title'");
} }
private updateUrl(url:string){ private updateUrl(url:string){
this._meta.updateProperty("og:url", url); this._meta.updateTag({content:url},"property='og:url'");
} }
public totalPages(totalResults: number): number { public totalPages(totalResults: number): number {

View File

@ -1,32 +1,40 @@
//import {MaterialModule} from '@angular/material'; //import {MaterialModule} from '@angular/material';
import { NgModule} from '@angular/core'; import {NgModule} from '@angular/core';
import { CommonModule } from '@angular/common'; import {CommonModule} from '@angular/common';
import { FormsModule } from '@angular/forms'; import {FormsModule} from '@angular/forms';
import { SharedModule } from '../../shared/shared.module'; import {RouterModule} from '@angular/router';
import { RouterModule } from '@angular/router';
import { PublicationService} from './publication.service';
import { PublicationComponent } from './publication.component';
// import { PublicationRoutingModule } from './publication-routing.module'; // import { PublicationRoutingModule } from './publication-routing.module';
import {MetricsModule} from '../landing-utils/metrics.module'; import {SharedModule} from '../../shared/shared.module';
import {IFrameModule} from '../../utils/iframe.module'; import {MetricsModule} from '../landing-utils/metrics.module';
import {AltMetricsModule} from '../../utils/altmetrics.module'; import {ResultLandingModule} from '../landing-utils/resultLanding.module';
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module'; import {LandingModule} from '../landing-utils/landing.module';
import {PagingModule} from '../../utils/paging.module'; import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
import {IFrameModule} from '../../utils/iframe.module';
import {AltMetricsModule} from '../../utils/altmetrics.module';
import {PagingModule} from '../../utils/paging.module';
import {ConfigurationServiceModule} from '../../utils/configuration/configurationService.module';
import {FreeGuard} from'../../login/freeGuard.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {PublicationService} from './publication.service';
import {PublicationComponent} from './publication.component';
import { ResultLandingModule } from '../landing-utils/resultLanding.module';
import { LandingModule } from '../landing-utils/landing.module';
import {FreeGuard} from'../../login/freeGuard.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {MetaModule} from '../../sharedComponents/metaService.module';
import { ConfigurationServiceModule } from '../../utils/configuration/configurationService.module';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, LandingModule,SharedModule, RouterModule, CiteThisModule, PagingModule, CommonModule, FormsModule, LandingModule, SharedModule, RouterModule,
ResultLandingModule, IFrameModule, MetricsModule, AltMetricsModule, CiteThisModule, PagingModule, ResultLandingModule, IFrameModule,
MetaModule, ConfigurationServiceModule], MetricsModule, AltMetricsModule, ConfigurationServiceModule
declarations: [PublicationComponent], ],
providers:[PublicationService, FreeGuard, IsRouteEnabled], declarations: [
exports: [PublicationComponent] PublicationComponent
],
providers: [
PublicationService, FreeGuard, IsRouteEnabled
],
exports: [
PublicationComponent
]
}) })
export class PublicationModule { } export class PublicationModule { }

View File

@ -1,12 +1,16 @@
import {Component, ViewChild, ElementRef, Input} from '@angular/core'; import {Component, ViewChild} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {ElementRef, Input} from '@angular/core';
import {SoftwareService} from './software.service'; import {ActivatedRoute, Router} from '@angular/router';
import {SoftwareInfo} from '../../utils/entities/softwareInfo'; import {Title, Meta} from '@angular/platform-browser';
import {ActivatedRoute, Router} from '@angular/router';
import {RouterHelper} from '../../utils/routerHelper.class'; import {Observable} from 'rxjs/Observable';
import { Meta} from '../../sharedComponents/metaService';
import {PiwikService} from '../../utils/piwik/piwik.service'; import {SoftwareService} from './software.service';
import{EnvProperties} from '../../utils/properties/env-properties'; import {SoftwareInfo} from '../../utils/entities/softwareInfo';
import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties';
@Component({ @Component({
selector: 'software', selector: 'software',
@ -53,6 +57,7 @@ export class SoftwareComponent {
private _piwikService:PiwikService, private _piwikService:PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private _meta: Meta, private _meta: Meta,
private _title: Title,
private _router: Router) { private _router: Router) {
} }
@ -151,18 +156,18 @@ export class SoftwareComponent {
this.pageViews = $event.pageViews; this.pageViews = $event.pageViews;
} }
private updateDescription(description:string){ private updateDescription(description:string) {
this._meta.updateMeta("description", description); this._meta.updateTag({content:description},"name='description'");
this._meta.updateProperty("og:description", description); this._meta.updateTag({content:description},"property='og:description'");
} }
private updateTitle(title:string){ private updateTitle(title:string) {
var _prefix ="OpenAIRE | "; var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title ); this._title.setTitle(_title);
this._meta.updateProperty("og:title",_title); this._meta.updateTag({content:_title},"property='og:title'");
} }
private updateUrl(url:string){ private updateUrl(url:string) {
this._meta.updateProperty("og:url", url); this._meta.updateTag({content:url},"property='og:url'");
} }
public buildCurationTooltip() { public buildCurationTooltip() {

View File

@ -1,12 +1,14 @@
import {Component, ElementRef} from '@angular/core'; import {Component, ElementRef} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {ActivatedRoute, Router} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router'; import {Title, Meta} from '@angular/platform-browser';
// import {LoginService} from './login.service'; import {Observable} from 'rxjs/Observable';
import {User,Session} from './utils/helper.class';
import {RouterHelper} from '../utils/routerHelper.class'; // import {LoginService} from './login.service';
import { Meta} from '../sharedComponents/metaService'; import {User,Session} from './utils/helper.class';
import{EnvProperties} from '../utils/properties/env-properties'; import {RouterHelper} from '../utils/routerHelper.class';
import {EnvProperties} from '../utils/properties/env-properties';
@Component({ @Component({
selector: 'user', selector: 'user',
@ -28,8 +30,12 @@ export class UserComponent {
properties:EnvProperties; properties:EnvProperties;
constructor( private router: Router, constructor( private router: Router,
private route: ActivatedRoute, private _meta: Meta) { private route: ActivatedRoute,
this._meta.setTitle("OpenAIRE | Login"); private _meta: Meta,
private _title: Title) {
var title = "OpenAIRE | Login";
this._title.setTitle(title);
} }
ngOnInit() { ngOnInit() {

View File

@ -1,24 +1,29 @@
import { NgModule} from '@angular/core'; import {NgModule} from '@angular/core';
import { CommonModule } from '@angular/common'; import {CommonModule} from '@angular/common';
import { FormsModule } from '@angular/forms'; import {FormsModule} from '@angular/forms';
import {UserRoutingModule} from './user-routing.module';
import {UserComponent} from './user.component';
import {UserComponent } from './user.component';
import { UserRoutingModule } from './user-routing.module';
import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard'; import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard';
import {FreeGuard} from './freeGuard.guard'; import {FreeGuard} from './freeGuard.guard';
import {LoginGuard} from './loginGuard.guard'; import {LoginGuard} from './loginGuard.guard';
import {MetaModule} from '../sharedComponents/metaService.module'; // import {LoginService} from './login.service';
// import {LoginService} from './login.service';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, CommonModule, FormsModule, UserRoutingModule,
UserRoutingModule, MetaModule ],
providers: [
PreviousRouteRecorder, FreeGuard, LoginGuard
], ],
providers:[PreviousRouteRecorder, FreeGuard,LoginGuard ],
declarations: [ declarations: [
UserComponent UserComponent
], exports:[UserComponent] ],
exports: [
UserComponent
]
}) })
export class UserModule { } export class UserModule { }

View File

@ -1,31 +1,34 @@
import {Component, Input, Output, EventEmitter, ViewChild, ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core'; import {Component, Input, Output} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {EventEmitter, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router'; import {ChangeDetectionStrategy} from '@angular/core';
import {Location} from '@angular/common'; import {ViewEncapsulation} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Location} from '@angular/common';
import {Title, Meta} from '@angular/platform-browser';
import { Meta, MetaDefinition} from '../../sharedComponents/metaService'; import {Observable} from 'rxjs/Observable';
import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class'; import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class';
import { FetchDataproviders } from '../../utils/fetchEntitiesClasses/fetchDataproviders.class'; import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
import { FetchProjects } from '../../utils/fetchEntitiesClasses/fetchProjects.class'; import {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class';
import { FetchDatasets } from '../../utils/fetchEntitiesClasses/fetchDatasets.class'; import {FetchDatasets} from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
import { FetchSoftware } from '../../utils/fetchEntitiesClasses/fetchSoftware.class'; import {FetchSoftware} from '../../utils/fetchEntitiesClasses/fetchSoftware.class';
import { FetchOrganizations } from '../../utils/fetchEntitiesClasses/fetchOrganizations.class'; import {FetchOrganizations} from '../../utils/fetchEntitiesClasses/fetchOrganizations.class';
import {SearchPublicationsService} from '../../services/searchPublications.service'; import {SearchPublicationsService} from '../../services/searchPublications.service';
import {SearchDataprovidersService} from '../../services/searchDataproviders.service'; import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
import {SearchProjectsService} from '../../services/searchProjects.service'; import {SearchProjectsService} from '../../services/searchProjects.service';
import {SearchDatasetsService} from '../../services/searchDatasets.service'; import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {SearchSoftwareService} from '../../services/searchSoftware.service'; import {SearchSoftwareService} from '../../services/searchSoftware.service';
import {SearchOrganizationsService} from '../../services/searchOrganizations.service'; import {SearchOrganizationsService} from '../../services/searchOrganizations.service';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {ErrorCodes} from '../../utils/properties/errorCodes'; import {ErrorCodes} from '../../utils/properties/errorCodes';
import {RouterHelper} from '../../utils/routerHelper.class'; import {RouterHelper} from '../../utils/routerHelper.class';
import {RefineFieldResultsService} from '../../services/refineFieldResults.service'; import {RefineFieldResultsService} from '../../services/refineFieldResults.service';
import {PiwikService} from '../../utils/piwik/piwik.service'; import {PiwikService} from '../../utils/piwik/piwik.service';
import { ConfigurationService } from '../../utils/configuration/configuration.service'; import {ConfigurationService} from '../../utils/configuration/configuration.service';
import{EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.Default, changeDetection: ChangeDetectionStrategy.Default,
@ -96,7 +99,10 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
private _searchSoftwareService: SearchSoftwareService, private _searchSoftwareService: SearchSoftwareService,
private _searchOrganizationsService: SearchOrganizationsService, private _searchOrganizationsService: SearchOrganizationsService,
private _refineFieldResultsService:RefineFieldResultsService, private _refineFieldResultsService:RefineFieldResultsService,
private location: Location, private _meta: Meta,private _piwikService:PiwikService, private location: Location,
private _meta: Meta,
private _title: Title,
private _piwikService:PiwikService,
private config: ConfigurationService ) { private config: ConfigurationService ) {
this.fetchPublications = new FetchPublications(this._searchPublicationsService); this.fetchPublications = new FetchPublications(this._searchPublicationsService);
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService); this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
@ -105,11 +111,6 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
this.fetchSoftware = new FetchSoftware(this._searchSoftwareService); this.fetchSoftware = new FetchSoftware(this._searchSoftwareService);
this.fetchOrganizations = new FetchOrganizations( this._searchOrganizationsService); this.fetchOrganizations = new FetchOrganizations( this._searchOrganizationsService);
} }
public ngOnInit() { public ngOnInit() {
@ -117,15 +118,14 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
var description = "open access, research, scientific publication, European Commission, EC, FP7, ERC, Horizon 2020, H2020, search, projects "; var description = "open access, research, scientific publication, European Commission, EC, FP7, ERC, Horizon 2020, H2020, search, projects ";
var title = "OpenAIRE | Search publications, research data, projects... | OpenAIRE"; var title = "OpenAIRE | Search publications, research data, projects... | OpenAIRE";
this.properties = data.envSpecific; this.properties = data.envSpecific;
var url =data.envSpecific.baseLink+this._router.url; var url = data.envSpecific.baseLink+this._router.url;
this._meta.setTitle(title); this._title.setTitle(title);
this._meta.updateMeta("description", description); this._meta.updateTag({content:description},"name='description'");
this._meta.updateProperty("og:description", description); this._meta.updateTag({content:description},"property='og:description'");
this._meta.updateProperty("og:title", title); this._meta.updateTag({content:title},"property='og:title'");
this._meta.updateProperty("og:url", url); this._meta.updateTag({content:url},"property='og:url'");
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE |Search publications, research data, projects...").subscribe(); this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE |Search publications, research data, projects...").subscribe();

View File

@ -1,16 +1,20 @@
import {Component, Input, ViewChild, Output, EventEmitter} from '@angular/core'; import {Component, Input, ViewChild} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Output, EventEmitter} from '@angular/core';
import {Location} from '@angular/common'; import {Location} from '@angular/common';
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {Filter, Value,AdvancedField} from '../searchUtils/searchHelperClasses.class'; import {Title, Meta} from '@angular/platform-browser';
import {SearchResult} from '../../utils/entities/searchResult';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {Observable} from 'rxjs/Observable';
import {SearchUtilsClass} from './searchUtils.class';
import {ModalLoading} from '../../utils/modal/loading.component'; import {Filter, Value, AdvancedField} from '../searchUtils/searchHelperClasses.class';
import {StringUtils, Dates} from '../../utils/string-utils.class'; import {SearchResult} from '../../utils/entities/searchResult';
import { Meta} from '../../sharedComponents/metaService'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {PiwikService} from '../../utils/piwik/piwik.service'; import {SearchUtilsClass} from './searchUtils.class';
import{EnvProperties} from '../../utils/properties/env-properties'; import {ModalLoading} from '../../utils/modal/loading.component';
import {StringUtils, Dates} from '../../utils/string-utils.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties';
@Component({ @Component({
selector: 'advanced-search-page', selector: 'advanced-search-page',
@ -49,7 +53,12 @@ export class AdvancedSearchPageComponent {
properties:EnvProperties; properties:EnvProperties;
@Output() queryChange = new EventEmitter(); @Output() queryChange = new EventEmitter();
constructor (private route: ActivatedRoute,private location: Location, private _meta: Meta, private _piwikService:PiwikService, private router: Router) { constructor (private route: ActivatedRoute,
private location: Location,
private _meta: Meta,
private _title: Title,
private _piwikService:PiwikService,
private router: Router) {
} }
ngOnInit() { ngOnInit() {
@ -68,36 +77,37 @@ export class AdvancedSearchPageComponent {
} }
}); });
var title = "Advanced search "+this.pageTitle;
var description = "Openaire, search, repositories, open access, type, content provider, funder, project, "+ this.pageTitle;
this.updateTitle("Advanced search "+this.pageTitle); this.updateTitle(title);
this.updateDescription("Openaire, search, repositories, open access, type, content provider, funder, project, "+ this.pageTitle); this.updateDescription(description);
this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl;
this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl; this.updateBaseUrlWithParameters();
this.updateBaseUrlWithParameters();
} }
ngOnDestroy() { ngOnDestroy() {
if(this.piwiksub){ if(this.piwiksub){
this.piwiksub.unsubscribe(); this.piwiksub.unsubscribe();
} }
} }
updateDescription(description:string){ updateDescription(description:string) {
this._meta.updateMeta("description", description); this._meta.updateTag({content:description},"name='description'");
this._meta.updateProperty("og:description", description); this._meta.updateTag({content:description},"property='og:description'");
} }
updateTitle(title:string){ updateTitle(title:string) {
var _prefix ="OpenAIRE | "; var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title ); this._title.setTitle(_title);
this._meta.updateProperty("og:title",_title); this._meta.updateTag({content:_title},"property='og:title'");
} }
updateUrl(url:string){ updateUrl(url:string) {
this._meta.updateProperty("og:url", url); this._meta.updateTag({content:url},"property='og:url'");
} }
public getSelectedFiltersFromUrl(params){ public getSelectedFiltersFromUrl(params) {
for(var i=0; i< this.fieldIds.length ; i++){ for(var i=0; i< this.fieldIds.length ; i++){
var fieldId = this.fieldIds[i]; var fieldId = this.fieldIds[i];

View File

@ -1,20 +1,23 @@
import {Component, Input, ViewChild, Output, EventEmitter,ElementRef} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {ViewChild, Output} from '@angular/core';
import {Location} from '@angular/common'; import {EventEmitter,ElementRef} from '@angular/core';
import {Router, ActivatedRoute} from '@angular/router'; import {Location} from '@angular/common';
import {Router, ActivatedRoute} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
import { Filter, Value} from './searchHelperClasses.class'; import {Observable} from 'rxjs/Observable';
import {SearchResult} from '../../utils/entities/searchResult';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {Filter, Value} from './searchHelperClasses.class';
import {SearchUtilsClass} from './searchUtils.class'; import {SearchResult} from '../../utils/entities/searchResult';
import {DOI, StringUtils} from '../../utils/string-utils.class'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {ModalLoading} from '../../utils/modal/loading.component'; import {SearchUtilsClass} from './searchUtils.class';
import { Meta} from '../../sharedComponents/metaService'; import {DOI, StringUtils} from '../../utils/string-utils.class';
import{SearchFilterComponent} from './searchFilter.component'; import {ModalLoading} from '../../utils/modal/loading.component';
import {SearchFilterModalComponent} from './searchFilterModal.component'; import {SearchFilterComponent} from './searchFilter.component';
import { ErrorCodes} from '../../utils/properties/errorCodes'; import {SearchFilterModalComponent} from './searchFilterModal.component';
import {PiwikService} from '../../utils/piwik/piwik.service'; import {ErrorCodes} from '../../utils/properties/errorCodes';
import{EnvProperties} from '../../utils/properties/env-properties'; import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties';
@Component({ @Component({
@ -66,7 +69,13 @@ export class SearchPageComponent {
public isPiwikEnabled; public isPiwikEnabled;
properties:EnvProperties; properties:EnvProperties;
constructor (private route: ActivatedRoute,private location: Location , private _meta: Meta,private element: ElementRef,private _piwikService:PiwikService, private router: Router) { constructor (private route: ActivatedRoute,
private location: Location,
private _meta: Meta,
private _title: Title,
private element: ElementRef,
private _piwikService:PiwikService,
private router: Router) {
} }
ngOnInit() { ngOnInit() {
@ -90,7 +99,8 @@ export class SearchPageComponent {
} }
// this.updateBaseUrlWithParameters(this.filters); // this.updateBaseUrlWithParameters(this.filters);
this.updateTitle(this.pageTitle); this.updateTitle(this.pageTitle);
this.updateDescription("Openaire, search, repositories, open access, type, content provider, funder, project, " + this.type + "," +this.pageTitle); var description = "Openaire, search, repositories, open access, type, content provider, funder, project, " + this.type + "," +this.pageTitle;
this.updateDescription(description);
} }
ngAfterViewChecked(){ ngAfterViewChecked(){
@ -106,18 +116,18 @@ export class SearchPageComponent {
//this.searchFilterModal.open(); //this.searchFilterModal.open();
} }
updateDescription(description:string){ updateDescription(description:string) {
this._meta.updateMeta("description", description); this._meta.updateTag({content:description},"name='description'");
this._meta.updateProperty("og:description", description); this._meta.updateTag({content:description},"property='og:description'");
} }
updateTitle(title:string){ updateTitle(title:string) {
var _prefix ="OpenAIRE | "; var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title ); this._title.setTitle(_title);
this._meta.updateProperty("og:title",_title); this._meta.updateTag({content:_title},"property='og:title'");
} }
updateUrl(url:string){ updateUrl(url:string) {
this._meta.updateProperty("og:url", url); this._meta.updateTag({content:url},"property='og:url'");
} }
public getQueryParametersFromUrl(params){ public getQueryParametersFromUrl(params){

View File

@ -1,23 +1,29 @@
import {Component, Input, ViewChild, Output, EventEmitter, ViewEncapsulation, OnInit, AfterViewInit} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {ViewChild, Output} from '@angular/core';
import { Subject } from 'rxjs/Subject'; import {EventEmitter, ViewEncapsulation} from '@angular/core';
import {Location} from '@angular/common'; import {OnInit, AfterViewInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router'; import {Location} from '@angular/common';
import {ActivatedRoute} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
import { Filter, Value} from './searchHelperClasses.class'; import {Observable} from 'rxjs/Observable';
import {SearchResult} from '../../utils/entities/searchResult'; import {Subject} from 'rxjs/Subject';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {SearchUtilsClass} from './searchUtils.class'; import {DataTableDirective } from 'angular-datatables';
import {DOI, StringUtils} from '../../utils/string-utils.class';
import {ModalLoading} from '../../utils/modal/loading.component'; import {EnvProperties} from '../../utils/properties/env-properties';
import { Meta} from '../../sharedComponents/metaService';
import{SearchFilterComponent} from './searchFilter.component'; import {Filter, Value} from './searchHelperClasses.class';
import {SearchFilterModalComponent} from './searchFilterModal.component'; import {SearchResult} from '../../utils/entities/searchResult';
import { ErrorCodes} from '../../utils/properties/errorCodes'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {PiwikService} from '../../utils/piwik/piwik.service'; import {SearchUtilsClass} from './searchUtils.class';
import { DataTableDirective } from 'angular-datatables'; import {DOI, StringUtils} from '../../utils/string-utils.class';
import {ModalLoading} from '../../utils/modal/loading.component';
import {SearchFilterComponent} from './searchFilter.component';
import {SearchFilterModalComponent} from './searchFilterModal.component';
import {ErrorCodes} from '../../utils/properties/errorCodes';
import {PiwikService} from '../../utils/piwik/piwik.service';
//import {SearchDataprovidersService} from '../../services/searchDataproviders.service'; //import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
import {EnvProperties} from '../../utils/properties/env-properties';
@Component({ @Component({
selector: 'search-page-table', selector: 'search-page-table',
@ -49,7 +55,7 @@ export class SearchPageTableViewComponent implements OnInit, AfterViewInit {
@Input() searchViewLink: string; @Input() searchViewLink: string;
@Input() disableForms: boolean = false; @Input() disableForms: boolean = false;
@Input() searchFormClass: string = "searchForm"; @Input() searchFormClass: string = "searchForm";
@Input() formPlaceholderText = "Type Keywords..."; @Input() formPlaceholderText = "Type Keywords...";
@ViewChild (ModalLoading) loading : ModalLoading ; @ViewChild (ModalLoading) loading : ModalLoading ;
private searchFieldsHelper:SearchFields = new SearchFields(); private searchFieldsHelper:SearchFields = new SearchFields();
private queryParameters: Map<string, string> = new Map<string,string>(); private queryParameters: Map<string, string> = new Map<string,string>();
@ -68,8 +74,13 @@ export class SearchPageTableViewComponent implements OnInit, AfterViewInit {
dtOptions: DataTables.Settings = {}; dtOptions: DataTables.Settings = {};
showTable = false; filteringAdded = false; showTable = false; filteringAdded = false;
@ViewChild(DataTableDirective) datatableElement: DataTableDirective; @ViewChild(DataTableDirective) datatableElement: DataTableDirective;
dtTrigger: Subject<any> = new Subject(); //necessary dtTrigger: Subject<any> = new Subject(); //necessary
constructor (private route: ActivatedRoute,private location: Location , private _meta: Meta, private _piwikService:PiwikService) { }
constructor (private route: ActivatedRoute,
private location: Location,
private _meta: Meta,
private _title: Title,
private _piwikService:PiwikService) { }
ngOnInit() { ngOnInit() {
this.route.data this.route.data
@ -91,7 +102,8 @@ export class SearchPageTableViewComponent implements OnInit, AfterViewInit {
"pageLength": this.rowsOnPage "pageLength": this.rowsOnPage
}; };
this.updateTitle(this.pageTitle); this.updateTitle(this.pageTitle);
this.updateDescription("Openaire, search, repositories, open access, type, content provider, funder, project, " + this.type + "," +this.pageTitle); var description = "Openaire, search, repositories, open access, type, content provider, funder, project, " + this.type + "," +this.pageTitle;
this.updateDescription(description);
} }
ngOnDestroy() { ngOnDestroy() {
@ -127,18 +139,18 @@ export class SearchPageTableViewComponent implements OnInit, AfterViewInit {
} }
updateDescription(description:string){ updateDescription(description:string) {
this._meta.updateMeta("description", description); this._meta.updateTag({content:description},"name='description'");
this._meta.updateProperty("og:description", description); this._meta.updateTag({content:description},"property='og:description'");
} }
updateTitle(title:string){ updateTitle(title:string) {
var _prefix ="OpenAIRE | "; var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title ); this._title.setTitle(_title);
this._meta.updateProperty("og:title",_title); this._meta.updateTag({content:_title},"property='og:title'");
} }
updateUrl(url:string){ updateUrl(url:string) {
this._meta.updateProperty("og:url", url); this._meta.updateTag({content:url},"property='og:url'");
} }
public getParametersFromUrl(params) { public getParametersFromUrl(params) {