No valid arguments provided in order to start linking openAIRE entities.
+ role="alert">No valid arguments provided in order to start linking OpenAIRE entities.
diff --git a/claims/directLinking/directLinking.component.ts b/claims/directLinking/directLinking.component.ts
index 2faf7fb1..25525622 100644
--- a/claims/directLinking/directLinking.component.ts
+++ b/claims/directLinking/directLinking.component.ts
@@ -9,7 +9,6 @@ import {SearchPublicationsService} from '../../services/searchPublications.servi
import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {SearchSoftwareService} from '../../services/searchSoftware.service';
import {SearchOrpsService} from '../../services/searchOrps.service';
-import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {LinkingGenericComponent} from "../linking/linkingGeneric.component";
import {ClaimResultSearchFormComponent} from "../claim-utils/claimResultSearchForm.component";
@@ -19,6 +18,8 @@ import {ClaimResultSearchFormComponent} from "../claim-utils/claimResultSearchFo
templateUrl: 'directLinking.component.html'
})
export class DirectLinkingComponent {
+ @Input() piwikSiteId = null;
+
@ViewChild(LinkingGenericComponent) linking: LinkingGenericComponent;
results: ClaimEntity[] = [];
@@ -40,22 +41,13 @@ export class DirectLinkingComponent {
localStoragePrefix: string = "";
constructor(private _router: Router, private route: ActivatedRoute,private entitySearch:EntitiesSearchService,
private publicationsSearch: SearchPublicationsService, private datasetsSearch: SearchDatasetsService,
- private softwareSearch: SearchSoftwareService, private ORPSearch: SearchOrpsService,
- private _meta: Meta, private _title: Title, private seoService: SEOService) {
-
- let title = "OpenAIRE | Direct Linking";
- this._meta.updateTag({content: title}, "property='og:title'");
- this._title.setTitle(title);
-
+ private softwareSearch: SearchSoftwareService, private ORPSearch: SearchOrpsService) {
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
- let url = data.envSpecific.baseLink + this._router.url;
- this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url, false);
-
});
this.sub = this.route.queryParams.subscribe(params => {
diff --git a/claims/linking/linkingGeneric.component.ts b/claims/linking/linkingGeneric.component.ts
index 83a4550a..1b9615dc 100644
--- a/claims/linking/linkingGeneric.component.ts
+++ b/claims/linking/linkingGeneric.component.ts
@@ -10,6 +10,7 @@ import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {AlertModal} from "../../utils/modal/alert";
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
+import {PiwikService} from "../../utils/piwik/piwik.service";
declare var UIkit:any;
@@ -19,6 +20,10 @@ declare var UIkit:any;
})
export class LinkingGenericComponent {
+ @Input() piwikSiteId = null;
+ @Input() title: string = null;
+ piwiksub:any;
+
@Input() communityId:string= null;
sourceType:string;
targetType:string;
@@ -43,14 +48,8 @@ export class LinkingGenericComponent {
constructor (private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService,
private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService,
- private _meta: Meta, private _title: Title,
- private seoService: SEOService, private helper: HelperService ) {
-
- let title = "OpenAIRE | Linking";
- this._meta.updateTag({content:title},"property='og:title'");
- this._title.setTitle(title);
-
-
+ private _meta: Meta, private _title: Title, private _piwikService:PiwikService,
+ private seoService: SEOService, private helper: HelperService ) {
}
ngOnInit() {
this.showOptions.show = 'source';
@@ -63,7 +62,18 @@ export class LinkingGenericComponent {
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.url = data.envSpecific.baseLink+this._router.url;
- this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url, false);
+
+ var description = "Openaire, linking, claim, publication, research data, software, other research product, project, community";
+ this.updateTitle(this.title);
+ this.updateDescription(description);
+ this.updateUrl(this.url);
+
+ this.seoService.createLinkForCanonicalURL(this.url, false);
+
+ if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
+ this.piwiksub = this._piwikService.trackView(this.properties, this.title, this.piwikSiteId).subscribe();
+ }
+
this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.pageContents = contents;
})
@@ -81,6 +91,12 @@ export class LinkingGenericComponent {
}
}
+ ngOnDestroy() {
+ if(this.piwiksub){
+ this.piwiksub.unsubscribe();
+ }
+ }
+
openSelectionModal() {
this.alert.cancelButton = false;
this.alert.okButton = false;
@@ -105,6 +121,23 @@ export class LinkingGenericComponent {
}
scrollUp(){
HelperFunctions.scroll();
+ }
+
+ private updateDescription(description:string) {
+ this._meta.updateTag({content:description},"name='description'");
+ this._meta.updateTag({content:description},"property='og:description'");
+ }
+ private updateTitle(title:string) {
+ var _prefix ="";
+ if(!this.communityId) {
+ _prefix ="OpenAIRE | ";
+ }
+ var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
+ this._title.setTitle(_title);
+ this._meta.updateTag({content:_title},"property='og:title'");
+ }
+ private updateUrl(url:string) {
+ this._meta.updateTag({content:url},"property='og:url'");
}
}
diff --git a/claims/linking/linkingGeneric.module.ts b/claims/linking/linkingGeneric.module.ts
index 606b16aa..1e588150 100644
--- a/claims/linking/linkingGeneric.module.ts
+++ b/claims/linking/linkingGeneric.module.ts
@@ -20,6 +20,7 @@ import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {MetadataPreviewModule} from './selected/metadataPreview.module';
import {ClaimEntitiesMetadataModule} from "./selected/ClaimEntitiesMetadata.module";
import {AlertModalModule} from '../../utils/modal/alertModal.module';
+import {PiwikServiceModule} from "../../utils/piwik/piwikService.module";
@NgModule({
imports: [
@@ -27,7 +28,8 @@ import {AlertModalModule} from '../../utils/modal/alertModal.module';
SelectedPublicationsModule,
StartOverModule,
ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule,
- HelperModule, Schema2jsonldModule, SEOServiceModule, MetadataPreviewModule, ClaimEntitiesMetadataModule, AlertModalModule
+ HelperModule, Schema2jsonldModule, SEOServiceModule, MetadataPreviewModule, ClaimEntitiesMetadataModule, AlertModalModule,
+ PiwikServiceModule
],
providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled],
declarations: [
diff --git a/claims/myClaims/myClaims.component.ts b/claims/myClaims/myClaims.component.ts
index eacb7794..ed8b1e32 100644
--- a/claims/myClaims/myClaims.component.ts
+++ b/claims/myClaims/myClaims.component.ts
@@ -17,9 +17,10 @@ import {Meta, Title} from '@angular/platform-browser';
Manage your links in OpenAIRE