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
2018-04-17 15:00:23 +02:00
|
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
import {Router, ActivatedRoute} from '@angular/router';
|
|
|
|
import {Title, Meta} from '@angular/platform-browser';
|
|
|
|
|
2019-06-03 15:20:36 +02:00
|
|
|
import {Observable} from 'rxjs';
|
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
2018-04-17 15:00:23 +02:00
|
|
|
|
|
|
|
import {EnvProperties} from '../utils/properties/env-properties';
|
|
|
|
|
|
|
|
import {PiwikService} from '../utils/piwik/piwik.service';
|
2018-11-14 11:38:53 +01:00
|
|
|
import { SEOService } from '../sharedComponents/SEO/SEO.service';
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-11-26 16:44:32 +01:00
|
|
|
import {ZenodoInformationClass} from './utils/zenodoInformation.class';
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'deposit',
|
|
|
|
templateUrl: 'deposit.component.html'
|
|
|
|
})
|
|
|
|
|
|
|
|
export class DepositComponent {
|
2018-11-26 16:44:32 +01:00
|
|
|
@Input() zenodoInformation: ZenodoInformationClass;
|
2017-12-19 13:53:46 +01:00
|
|
|
@Input() compatibility: string = '';
|
|
|
|
@Input() mapUrl: string = null; // optional in case i-frame is needed
|
|
|
|
@Input() searchBySubjects: boolean = false; // optional: in case search by subjects is needed
|
2018-04-11 10:59:01 +02:00
|
|
|
@Input() piwikSiteId = null;
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
public status: number;
|
|
|
|
|
|
|
|
// Type of entity: Publication or Research Data
|
|
|
|
@Input() requestFor: string = "Publications";
|
|
|
|
|
|
|
|
// url's needed for information text
|
|
|
|
public openAccess: string;
|
|
|
|
public openAccessRepo: string;
|
|
|
|
public fp7Guidlines: string;
|
|
|
|
public h2020Guidlines: string;
|
|
|
|
public ercGuidlines: string;
|
|
|
|
public helpdesk: string;
|
|
|
|
|
|
|
|
// Id of the new selected organization to be searched
|
|
|
|
public selectedId: string = "";
|
|
|
|
|
|
|
|
public warningMessage: string = "";
|
|
|
|
|
|
|
|
piwiksub:any;
|
2018-02-05 14:14:59 +01:00
|
|
|
properties:EnvProperties;
|
2018-11-14 11:38:53 +01:00
|
|
|
url=null;
|
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
2018-04-17 15:00:23 +02:00
|
|
|
constructor (private route: ActivatedRoute, private _router: Router,
|
|
|
|
private _meta: Meta, private _title: Title,
|
2018-11-14 11:38:53 +01:00
|
|
|
private _piwikService:PiwikService,
|
|
|
|
private seoService: SEOService ) {
|
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
2018-04-17 15:00:23 +02:00
|
|
|
|
|
|
|
var title = "Deposit "+this.requestFor;
|
|
|
|
var description = "Openaire, repositories, open access, content provider, compatibility, organization, deposit "+ this.requestFor;
|
|
|
|
this.updateTitle(title);
|
|
|
|
this.updateDescription(description);
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2018-02-05 14:14:59 +01:00
|
|
|
ngOnInit() {
|
|
|
|
this.route.data
|
|
|
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
|
|
|
this.properties = data.envSpecific;
|
2019-02-12 12:40:06 +01:00
|
|
|
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url, false);
|
|
|
|
this.updateUrl(data.envSpecific.baseLink+this._router.url);
|
|
|
|
this.url = data.envSpecific.baseLink+this._router.url;
|
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
this.openAccess = this.properties.openAccess;
|
|
|
|
this.openAccessRepo = this.properties.openAccessRepo;
|
|
|
|
this.fp7Guidlines = this.properties.fp7Guidlines
|
|
|
|
this.h2020Guidlines = this.properties.h2020Guidlines
|
|
|
|
this.ercGuidlines = this.properties.ercGuidlines
|
|
|
|
this.helpdesk = this.properties.helpdesk;
|
2019-02-12 12:40:06 +01:00
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
2018-04-11 10:59:01 +02:00
|
|
|
this.piwiksub = this._piwikService.trackView(this.properties, "Deposit "+this.requestFor, this.piwikSiteId).subscribe();
|
2018-02-05 14:14:59 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
ngOnDestroy() {
|
|
|
|
if(this.piwiksub){
|
|
|
|
this.piwiksub.unsubscribe();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public organizationSelected(id: string) {
|
|
|
|
if(id && id.length > 0){
|
|
|
|
if(this.requestFor == "Publications") {
|
|
|
|
this._router.navigate( ['participate/deposit-publications-result'], { queryParams: { "organizationId": id } } );
|
|
|
|
} else if(this.requestFor == "Research Data") {
|
|
|
|
this._router.navigate( ['participate/deposit-datasets-result'], { queryParams: { "organizationId": id } } );
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.warningMessage = "No organization selected";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
2018-04-17 15:00:23 +02:00
|
|
|
public valueChanged($event) {
|
2017-12-19 13:53:46 +01:00
|
|
|
this.selectedId = $event.value;
|
|
|
|
}
|
|
|
|
|
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
2018-04-17 15:00:23 +02:00
|
|
|
private updateDescription(description:string) {
|
|
|
|
this._meta.updateTag({content:description},"name='description'");
|
|
|
|
this._meta.updateTag({content:description},"property='og:description'");
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
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
2018-04-17 15:00:23 +02:00
|
|
|
private updateTitle(title:string) {
|
2017-12-19 13:53:46 +01:00
|
|
|
var _prefix ="OpenAIRE | ";
|
|
|
|
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
|
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
2018-04-17 15:00:23 +02:00
|
|
|
this._title.setTitle(_title);
|
|
|
|
this._meta.updateTag({content:_title},"property='og:title'");
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
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
2018-04-17 15:00:23 +02:00
|
|
|
private updateUrl(url:string) {
|
|
|
|
this._meta.updateTag({content:url},"property='og:url'");
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
}
|