[Trunk | Connect]: Fix and add when missing: schema2jsonld, canonincal url, meta tags, piwik call.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@56841 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2019-08-02 14:56:03 +00:00
parent 4170e3197b
commit fb97379ab4
56 changed files with 678 additions and 341 deletions

View File

@ -1,3 +1,5 @@
<schema2jsonld *ngIf="url" [URL]="url" [name]="pageTitle" type="other"></schema2jsonld>
<ng-template #card let-organization="organization" let-fullView="fullView">
<div class="affiliation-logo uk-flex uk-flex-middle uk-flex-center uk-padding-remove-horizontal"
[ngClass]="(!fullView)?'uk-card-body':'uk-card-media-top uk-padding-small'">

View File

@ -5,6 +5,9 @@ import {EnvProperties} from '../openaireLibrary/utils/properties/env-pr
import {AffiliationService} from "../openaireLibrary/connect/affiliations/affiliation.service";
import {Affiliation} from "../openaireLibrary/utils/entities/CuratorInfo";
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {PiwikHelper} from "../utils/piwikHelper";
@Component({
selector: 'affiliations',
@ -24,8 +27,15 @@ export class AffiliationsComponent {
communityId: string;
properties:EnvProperties;
public piwiksub: any;
public url: string = null;
public pageTitle: string = "Related Organizations";
constructor ( private route: ActivatedRoute, private _router: Router,
private _meta: Meta, private _title: Title,
private _meta: Meta,
private _title: Title,
private seoService: SEOService,
private _piwikService: PiwikService,
private affiliationService: AffiliationService) {}
public ngOnInit() {
@ -40,9 +50,17 @@ export class AffiliationsComponent {
this.properties = data.envSpecific;
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, PiwikHelper.getSiteId(this.communityId,this.properties.environment)).subscribe();
}
this.url = this.properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
this.updateUrl(this.url);
this.updateTitle(this.pageTitle);
this.updateDescription("OpenAIRE - Connect, Community Gateway, research community, organizations");
if(this.getAffiliationsFromAPI) {
this.showLoading = true;
console.info("onInit: before affiliations");
this.affiliationService.initAffiliations(this.properties, this.properties.communityAPI + this.communityId + "/organizations");
this.affiliationService.affiliations.subscribe(
affiliations => {
@ -58,4 +76,25 @@ export class AffiliationsComponent {
});
});
}
public ngOnDestroy() {
if (this.piwiksub) {
this.piwiksub.unsubscribe();
}
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _title = ((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'");
}
}

View File

@ -8,10 +8,14 @@ import {RouterModule} from '@angular/router';
import {AffiliationsComponent} from './affiliations.component';
import {AffiliationService} from "../openaireLibrary/connect/affiliations/affiliation.service";
import {CommonModule} from "@angular/common";
import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
import {PiwikServiceModule} from "../openaireLibrary/utils/piwik/piwikService.module";
@NgModule({
imports: [
CommonModule, RouterModule
CommonModule, RouterModule, Schema2jsonldModule, SEOServiceModule,
PiwikServiceModule
],
declarations: [
AffiliationsComponent

View File

@ -44,7 +44,6 @@ const routes: Routes = [
{ path: 'search/find/software', loadChildren: './searchPages/simple/searchSoftware.module#LibSearchSoftwareModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'search/find/projects', loadChildren: './searchPages/simple/searchProjects.module#LibSearchProjectsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'search/find/dataproviders', loadChildren: './searchPages/simple/searchDataProviders.module#LibSearchDataProvidersModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'search/find/organizations', loadChildren: './searchPages/simple/searchOrganizations.module#LibSearchOrganizationsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'search/find/other', loadChildren: './searchPages/simple/searchOrps.module#LibSearchOrpsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
// Advanced Search Pages

View File

@ -1,14 +1,16 @@
import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {PiwikHelper} from "../../utils/piwikHelper";
@Component({
selector: 'openaire-directLinking',
template: `
<directLinking [communityId]=communityId></directLinking>`
<directLinking [communityId]=communityId [piwikSiteId]="piwikSiteId"></directLinking>`
})
export class OpenaireDirectLinkingComponent {
communityId: string;
public piwikSiteId = null;
constructor(private route: ActivatedRoute) {
@ -23,6 +25,7 @@ export class OpenaireDirectLinkingComponent {
if (!this.communityId) {
this.communityId = communityId['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId,data.envSpecific.environment);
})
});
}

View File

@ -1,14 +1,17 @@
import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {PiwikHelper} from "../../utils/piwikHelper";
@Component({
selector: 'openaire-linking-generic',
template: `<linking-generic [communityId]=communityId></linking-generic>`
template: `<linking-generic [communityId]=communityId [piwikSiteId]="piwikSiteId" title="Linking"></linking-generic>`
})
export class OpenaireLinkingComponent {
communityId:string;
public piwikSiteId = null;
constructor (private route: ActivatedRoute) {
this.route.data
.subscribe((data: { envSpecific: any }) => {
@ -18,6 +21,7 @@ export class OpenaireLinkingComponent {
if(!this.communityId) {
this.communityId = communityId['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId,data.envSpecific.environment);
});
});

View File

@ -2,23 +2,24 @@ import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {PiwikHelper} from "../../utils/piwikHelper";
@Component({
selector: 'openaire-my-claims',
template: `
<my-claims [claimsInfoURL]=claimsInfoURL [communityId]=communityId>
</my-claims>
<my-claims [claimsInfoURL]=claimsInfoURL [communityId]=communityId [piwikSiteId]="piwikSiteId"></my-claims>
`
})
export class OpenaireMyClaimsComponent {
claimsInfoURL:string;
claimsInfoURL:string;
communityId:string;
constructor (private route: ActivatedRoute) {
public piwikSiteId = null;
}
public ngOnInit() {
constructor (private route: ActivatedRoute) {}
public ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.claimsInfoURL = data.envSpecific.claimsInformationLink;
@ -28,8 +29,9 @@ import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
if(!this.communityId) {
this.communityId = communityId['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId,data.envSpecific.environment);
});
});
}
}
}

View File

@ -1,3 +1,7 @@
<schema2jsonld [URL]="properties.baseLink"
[logoURL]="properties.baseLink+'/assets/common-assets/logo-small-connect.png'" type="home"
name="OpenAIRE Connect">
</schema2jsonld>
<div *ngIf="(managerOfCommunities.length > 0 || subscriberOfCommunities.length > 0)"
class="banner-background image-front-topbar uk-section uk-background-norepeat uk-background-bottom-center uk-background-cover uk-section-secondary uk-section-overlap uk-position-relative uk-preserve-color"
uk-scrollspy="{&quot;target&quot;:&quot;[uk-scrollspy-class]&quot;,&quot;cls&quot;:&quot;uk-animation-fade&quot;,&quot;delay&quot;:false}"

View File

@ -13,6 +13,7 @@ import {StringUtils} from '../openaireLibrary/utils/string-utils.class';
import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../openaireLibrary/utils/errorMessages.component';
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
@Component({
selector: 'communities',
@ -50,7 +51,8 @@ export class CommunitiesComponent {
private _piwikService: PiwikService,
private _communitiesService: CommunitiesService,
private _subscribeService: SubscribeService,
private helper: HelperService) {
private helper: HelperService,
private seoService: SEOService) {
var description = "OpenAIRE - Connect, Community Dashboard, research community";
var title = "OpenAIRE - Connect";
@ -69,7 +71,8 @@ export class CommunitiesComponent {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
var url = data.envSpecific.baseLink + this._router.url
var url = data.envSpecific.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(url, false);
this._meta.updateTag({content: url}, "property='og:url'");
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect", this.properties.piwikSiteId).subscribe();

View File

@ -17,12 +17,14 @@ import {BrowseCommunityModule} from './browseCommunity/browse-community.modul
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
import {GifSliderModule} from "../openaireLibrary/utils/gif-slider/gif-slider.module";
import {OtherPortalsModule} from "../openaireLibrary/sharedComponents/other-portals/other-portals.module";
import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
@NgModule({
imports: [
CommonModule, FormsModule, RouterModule,
ManageModule, ErrorMessagesModule,
SearchFormModule, BrowseCommunityModule, GifSliderModule, OtherPortalsModule,
HelperModule
HelperModule, Schema2jsonldModule, SEOServiceModule
],
declarations: [
CommunitiesComponent

View File

@ -1,3 +1,7 @@
<schema2jsonld *ngIf="community" [URL]="url"
[logoURL]="community.logoUrl" type="home"
[name]="community.title">
</schema2jsonld>
<div id="stickhere">
</div>

View File

@ -19,6 +19,7 @@ import {SearchCommunityDataprovidersService} from "../openaireLibrary/connect/co
import {SearchCommunityProjectsService} from "../openaireLibrary/connect/projects/searchProjects.service";
import {SearchResearchResultsService} from "../openaireLibrary/services/searchResearchResults.service";
import {RouterHelper} from "../openaireLibrary/utils/routerHelper.class";
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
@Component({
selector: 'community',
@ -26,6 +27,8 @@ import {RouterHelper} from "../openaireLibrary/utils/routerHelper.class";
})
export class CommunityComponent {
public url: string = null;
public sub: any;
public piwiksub: any;
public subfunders: any;
@ -89,7 +92,8 @@ export class CommunityComponent {
private _searchCommunityProjectsService: SearchCommunityProjectsService,
private _searchResearchResultsService: SearchResearchResultsService,
private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService,
private _ΖenodoCommunitieService: ZenodoCommunitiesService) {
private _ΖenodoCommunitieService: ZenodoCommunitiesService,
private seoService: SEOService) {
var description = "OpenAIRE - Connect, Community Dashboard, research community";
var title = "OpenAIRE - Connect";
@ -112,8 +116,9 @@ export class CommunityComponent {
this.searchLinkToDataProviders = this.properties.searchLinkToDataProviders;
this.searchLinkToAdvancedPublications = this.properties.searchLinkToAdvancedPublications;
this.shareInZenodoPage = this.properties.shareInZenodoPage;
var url = data.envSpecific.baseLink + this._router.url;
this._meta.updateTag({content: url}, "property='og:url'");
this.url = data.envSpecific.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url, false);
this._meta.updateTag({content: this.url}, "property='og:url'");
if (this.communityId != null && this.communityId != '') {
this._communityService.getCommunity(this.properties, this.properties.communityAPI + this.communityId).subscribe(

View File

@ -24,6 +24,8 @@ import {SearchResearchResultsServiceModule} from "../openaireLibrary/services/se
import {SearchResultsModule} from "../openaireLibrary/searchPages/searchUtils/searchResults.module";
import {CuratorsModule} from "../curators/curators.module";
import {AffiliationsModule} from "../affiliations/affiliations.module";
import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
import {MatSelectModule} from "@angular/material";
@NgModule({
@ -31,8 +33,8 @@ import {MatSelectModule} from "@angular/material";
CommonModule, FormsModule, RouterModule,
SubscribeModule, StatisticsModule, ManageModule, InviteModule,
SearchZenodoCommunitiesServiceModule, ZenodoCommunitiesServiceModule, SearchFormModule, SearchDataprovidersServiceModule, SearchProjectsServiceModule,
SearchResearchResultsServiceModule, SearchResultsModule, CuratorsModule, AffiliationsModule, MatSelectModule
SearchResearchResultsServiceModule, SearchResultsModule, CuratorsModule, AffiliationsModule,
Schema2jsonldModule, SEOServiceModule, MatSelectModule
],
declarations: [
CommunityComponent, ResultsComponent

View File

@ -1,3 +1,5 @@
<schema2jsonld *ngIf="url" [URL]="url" [name]="pageTitle" type="other"></schema2jsonld>
<ng-template #info>
<helper *ngIf="pageContents && pageContents['right'] && pageContents['right'].length > 0"
[texts]="pageContents['right']"></helper>

View File

@ -6,10 +6,11 @@ import {Email} from "../openaireLibrary/utils/email/email";
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
import {ContactForm} from "../openaireLibrary/utils/email/contact-form";
import {Composer} from "../openaireLibrary/utils/email/composer";
import {Title} from "@angular/platform-browser";
import {Meta, Title} from "@angular/platform-browser";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
@Component({
selector: 'contact',
@ -17,128 +18,152 @@ import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
})
export class ContactComponent implements OnInit {
public url: string = null;
public pageTitle: string = "OpenAIRE - Connect | Contact Us";
@Input('group')
myForm: FormGroup;
public piwiksub: any;
public showLoading = true;
public errorMessage = '';
public isSubmitted = false;
public email: Email;
public note = '';
public properties: EnvProperties = null;
public pageContents = null;
public divContents = null;
@Input('group')
myForm: FormGroup;
public piwiksub: any;
public showLoading = true;
public errorMessage = '';
public isSubmitted = false;
public email: Email;
public note = '';
public properties: EnvProperties = null;
public pageContents = null;
public divContents = null;
public contactForm: ContactForm = new ContactForm();
@ViewChild('AlertModal') modal;
@ViewChild('name') name;
@ViewChild('surname') surname;
@ViewChild('sender') sender;
@ViewChild('affiliation') affiliation;
@ViewChild('community') community;
@ViewChild('message') message;
@ViewChild('recaptcha') recaptcha;
public contactForm: ContactForm = new ContactForm();
@ViewChild('AlertModal') modal;
@ViewChild('name') name;
@ViewChild('surname') surname;
@ViewChild('sender') sender;
@ViewChild('affiliation') affiliation;
@ViewChild('community') community;
@ViewChild('message') message;
@ViewChild('recaptcha') recaptcha;
constructor(private route: ActivatedRoute,
private _router: Router,
private _emailService: EmailService,
private _title: Title,
private _piwikService: PiwikService,
private helper: HelperService) {
}
constructor(private route: ActivatedRoute,
private _router: Router,
private _emailService: EmailService,
private _meta: Meta,
private _title: Title,
private seoService: SEOService,
private _piwikService: PiwikService,
private helper: HelperService) {
}
ngOnInit() {
this._title.setTitle('OpenAIRE-Connect | Contact Us');
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.email = {body: '', subject: '', recipients: []};
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe();
}
this.url = this.properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
this.updateUrl(this.url);
this.updateTitle(this.pageTitle);
this.updateDescription("OpenAIRE - Connect, Community Gateway, research community");
//this.getDivContents();
this.getPageContents();
HelperFunctions.scroll();
this.showLoading = false;
});
}
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.pageContents = contents;
})
}
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.divContents = contents;
})
}
public send() {
HelperFunctions.scroll();
if(!this.name.invalid && !this.surname.invalid && !this.sender.invalid &&
this.contactForm.email.match('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$') &&
!this.affiliation.invalid && !this.message.invalid && this.contactForm.recaptcha != '') {
this.sendMail(this.properties.admins);
}
else {
this.errorMessage = 'Please fill in all the required fields!'
this.isSubmitted = true;
}
}
public reset() {
this.contactForm = new ContactForm();
this.isSubmitted = false;
this.errorMessage = '';
this.contactForm.recaptcha = '';
}
private sendMail(admins: any) {
this.showLoading = true;
this._emailService.contact(this.properties.adminToolsAPIURL + '/contact',
Composer.composeEmailForNewCommunity(this.contactForm, admins), this.contactForm.recaptcha).subscribe(
res => {
if(res) {
this.reset();
this.modalOpen();
this.showLoading = false;
}
},
error => {
this.handleError('Email sent failed! Please try again.', error);
this.showLoading = false;
this.contactForm.recaptcha = '';
}
);
}
public modalOpen() {
this.modal.okButton = true;
this.modal.alertTitle = 'Your request has been successfully submitted';
this.modal.alertMessage = false;
this.modal.cancelButton = false;
this.modal.okButtonLeft = false;
this.modal.okButtonText = 'OK';
this.modal.open();
}
public handleRecaptcha(captchaResponse: string) {
this.contactForm.recaptcha = captchaResponse;
}
ngOnInit() {
this._title.setTitle('OpenAIRE-Connect | Contact Us');
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.email = {body: '', subject: '', recipients: []};
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect|Contact Us", this.properties.piwikSiteId).subscribe();
}
//this.getDivContents();
this.getPageContents();
HelperFunctions.scroll();
this.showLoading = false;
});
}
handleError(message: string, error) {
this.errorMessage = message;
console.log('Server responded: ' + error);
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.pageContents = contents;
})
}
this.showLoading = false;
}
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.divContents = contents;
})
}
public goToHome(data: any) {
this._router.navigate(['/']);
}
public send() {
HelperFunctions.scroll();
if(!this.name.invalid && !this.surname.invalid && !this.sender.invalid &&
this.contactForm.email.match('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$') &&
!this.affiliation.invalid && !this.message.invalid && this.contactForm.recaptcha != '') {
this.sendMail(this.properties.admins);
}
else {
this.errorMessage = 'Please fill in all the required fields!'
this.isSubmitted = true;
}
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
public reset() {
this.contactForm = new ContactForm();
this.isSubmitted = false;
this.errorMessage = '';
this.contactForm.recaptcha = '';
}
private sendMail(admins: any) {
this.showLoading = true;
this._emailService.contact(this.properties.adminToolsAPIURL + '/contact',
Composer.composeEmailForNewCommunity(this.contactForm, admins), this.contactForm.recaptcha).subscribe(
res => {
if(res) {
this.reset();
this.modalOpen();
this.showLoading = false;
}
},
error => {
this.handleError('Email sent failed! Please try again.', error);
this.showLoading = false;
this.contactForm.recaptcha = '';
}
);
}
public modalOpen() {
this.modal.okButton = true;
this.modal.alertTitle = 'Your request has been successfully submitted';
this.modal.alertMessage = false;
this.modal.cancelButton = false;
this.modal.okButtonLeft = false;
this.modal.okButtonText = 'OK';
this.modal.open();
}
public handleRecaptcha(captchaResponse: string) {
this.contactForm.recaptcha = captchaResponse;
}
handleError(message: string, error) {
this.errorMessage = message;
console.log('Server responded: ' + error);
this.showLoading = false;
}
public goToHome(data: any) {
this._router.navigate(['/']);
}
private updateTitle(title: string) {
var _title = ((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'");
}
}

View File

@ -11,12 +11,15 @@ import {AlertModalModule} from "../openaireLibrary/utils/modal/alertModal.module
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard";
import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
@NgModule({
imports: [
ContactRoutingModule, CommonModule, FormsModule, RouterModule,
AlertModalModule, RecaptchaModule.forRoot(), HelperModule
AlertModalModule, RecaptchaModule.forRoot(), HelperModule,
Schema2jsonldModule, SEOServiceModule
],
declarations: [
ContactComponent

View File

@ -1,3 +1,5 @@
<schema2jsonld *ngIf="url" [URL]="url" [name]="pageTitle" type="other"></schema2jsonld>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0" [texts]="pageContents['top']"></helper>
<!--
<div class="uk-margin-large-top tm-middle uk-container" id="tm-main">

View File

@ -3,6 +3,8 @@ import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
@Component({
selector: 'content',
@ -14,21 +16,40 @@ export class ContentPageComponent {
public pageContents = null;
public divContents = null;
public url: string = null;
public pageTitle: string = "OpenAIRE - Connect | Content Policy";
piwiksub: any;
constructor(private route: ActivatedRoute, private _router: Router,
private _meta: Meta, private _title: Title,
private helper: HelperService) {
}
private _meta: Meta,
private _title: Title,
private seoService: SEOService,
private _piwikService: PiwikService,
private helper: HelperService) {}
public ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.updateTitle("Content");
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe();
}
this.url = this.properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
this.updateUrl(this.url);
this.updateTitle(this.pageTitle);
this.updateDescription("content, open access");
//this.getDivContents();
this.getPageContents();
});
}
ngOnDestroy() {
if(this.piwiksub) {
this.piwiksub.unsubscribe();
}
}
private updateDescription(description: string) {
@ -37,8 +58,7 @@ export class ContentPageComponent {
}
private updateTitle(title: string) {
var _prefix = "OpenAIRE | ";
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
var _title = ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title);
this._meta.updateTag({content: _title}, "property='og:title'");
}

View File

@ -8,11 +8,16 @@ import {ContentPageComponent} from './contentPage.component';
import {ContentPageRoutingModule} from './content-routing.module';
import {CommonModule} from "@angular/common";
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
import {PiwikServiceModule} from "../openaireLibrary/utils/piwik/piwikService.module";
@NgModule({
imports: [
ContentPageRoutingModule, RouterModule, CommonModule, HelperModule
ContentPageRoutingModule, RouterModule, CommonModule, HelperModule,
Schema2jsonldModule, SEOServiceModule, PiwikServiceModule
],
declarations: [
ContentPageComponent

View File

@ -1,3 +1,5 @@
<schema2jsonld *ngIf="url" [URL]="url" [name]="pageTitle" type="other"></schema2jsonld>
<ng-container *ngIf="main else child">
<div class="image-front-topbar uk-section-default uk-position-relative"
uk-scrollspy="{&quot;target&quot;:&quot;[uk-scrollspy-class]&quot;,&quot;cls&quot;:&quot;uk-animation-fade&quot;,&quot;delay&quot;:false}"

View File

@ -7,6 +7,10 @@ import {CommunitiesService} from "../openaireLibrary/connect/communities/communi
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
import {Meta, Title} from "@angular/platform-browser";
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {PiwikHelper} from "../utils/piwikHelper";
@Component({
selector: 'curators',
@ -30,16 +34,34 @@ export class CuratorsComponent {
public pageContents = null;
public divContents = null;
public piwiksub: any;
public url: string = null;
public pageTitle: string = "Curators";
constructor (private route: ActivatedRoute,
private curatorsService: CuratorService,
private communitiesService: CommunitiesService,
private _router: Router,
private helper: HelperService) {}
private helper: HelperService,
private _meta: Meta,
private _title: Title,
private seoService: SEOService,
private _piwikService: PiwikService) {}
ngOnInit() {
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
this.showLoading = true;
this.properties = data.envSpecific;
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, PiwikHelper.getSiteId(this.communityId,this.properties.environment)).subscribe();
}
this.url = this.properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
this.updateUrl(this.url);
this.updateTitle(this.pageTitle);
this.updateDescription("OpenAIRE - Connect, Community Gateway, research community");
this.downloadUrl = this.properties.utilsService + '/download/';
if(!this.main) {
let emails = this.managers.join();
@ -77,7 +99,12 @@ export class CuratorsComponent {
});
}
});
}
ngOnDestroy() {
if(this.piwiksub) {
this.piwiksub.unsubscribe();
}
}
private getPageContents() {
@ -103,4 +130,19 @@ export class CuratorsComponent {
return null;
}
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _title = ((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'");
}
}

View File

@ -8,11 +8,16 @@ import {CuratorService} from "../openaireLibrary/connect/curators/curator.servic
import {CuratorsRoutingModule} from "./curators-routing.module";
import {AffiliationsModule} from "../affiliations/affiliations.module";
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {PiwikServiceModule} from "../openaireLibrary/utils/piwik/piwikService.module";
@NgModule({
imports: [
CommonModule, FormsModule, RouterModule,
CuratorsRoutingModule, AffiliationsModule, HelperModule
CuratorsRoutingModule, AffiliationsModule, HelperModule,
Schema2jsonldModule, SEOServiceModule, PiwikServiceModule
],
declarations: [
CuratorsComponent

View File

@ -48,7 +48,7 @@ export class OpenaireDepositComponent {
}
if (communityId != null && communityId != '') {
this.communityId = communityId;
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId,this.properties.environment);
this._communityService.getCommunity(this.properties, this.properties.communityAPI + communityId).subscribe(
community => {
let masterZenodoCommunityId = community.zenodoCommunity;

View File

@ -43,7 +43,7 @@ export class OpenaireSearchDataprovidersToDepositComponent {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.siteIDs[this.communityId];
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId,this.properties.environment);
if(this.communityId) {

View File

@ -1,4 +1,5 @@
<div class="uk-section uk-padding-remove-bottom uk-padding-remove-top">
<schema2jsonld *ngIf="url" [URL]="url" [name]="title" type="other"></schema2jsonld>
<div class="uk-section uk-padding-remove-bottom uk-padding-remove-top">
<div class="communityPanelBackground uk-margin-top uk-padding-small">
<div class="uk-container uk-container-large uk-margin-top uk-margin-bottom">
<ul class="uk-breadcrumb">

View File

@ -1,4 +1,4 @@
import {Component} from '@angular/core';
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
@ -13,12 +13,21 @@ import {ErrorCodes} from '../../openaireLibrary/utils/properties/errorCodes';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {HelperService} from "../../openaireLibrary/utils/helper/helper.service";
import {RouterHelper} from "../../openaireLibrary/utils/routerHelper.class";
import {SEOService} from "../../openaireLibrary/sharedComponents/SEO/SEO.service";
import {PiwikService} from "../../openaireLibrary/utils/piwik/piwik.service";
import {PiwikHelper} from "../../utils/piwikHelper";
@Component({
selector: 'share-in-zenodo',
templateUrl: './shareInZenodo.component.html'
})
export class ShareInZenodoComponent {
public url: string = null;
public title: string = "Share in Zenodo";
piwiksub:any;
public piwikSiteId = null;
properties: EnvProperties;
private communityId: string = null;
private community: CommunityInfo = null;
@ -49,82 +58,88 @@ export class ShareInZenodoComponent {
private _ΖenodoCommunitieService: ZenodoCommunitiesService,
private _communityService: CommunityService,
private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService,
private helper: HelperService) {
private helper: HelperService,
private _piwikService:PiwikService,
private seoService: SEOService) {
}
public ngOnInit() {
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
;
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.updateUrl(data.envSpecific.baseLink + this._router.url);
this.updateTitle("Share in Zenodo");
this.url = data.envSpecific.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url, false);
this.updateUrl(this.url);
this.updateTitle(this.title);
this.updateDescription("Zenodo, repository, deposit, share");
this.properties = data.envSpecific;
this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId,this.properties.environment);
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, this.title, this.piwikSiteId).subscribe();
}
this.depositLearnHowPage = this.properties.depositLearnHowPage;
//this.getDivContents();
this.getPageContents();
if (this.communityId) {
if (this.communityId != null && this.communityId != '') {
this._communityService.getCommunity(this.properties, this.properties.communityAPI + this.communityId).subscribe(
community => {
this.community = community;
this.masterZenodoCommunityId = this.community.zenodoCommunity;
if (typeof document !== 'undefined') {
HelperFunctions.scroll();
}
if (this.masterZenodoCommunityId) {
this._ΖenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.masterZenodoCommunityId, null).subscribe(
result => {
this.masterZenodoCommunity = result;
},
error => {
this.handleError("Error getting Master Zenodo community with id: " + this.masterZenodoCommunityId, error);
}
);
}
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
;
this._searchZenodoCommunitiesService.searchZCommunities(this.properties, this.communityId).subscribe(
if (this.communityId && this.communityId != '') {
this._communityService.getCommunity(this.properties, this.properties.communityAPI + this.communityId).subscribe(
community => {
this.community = community;
this.masterZenodoCommunityId = this.community.zenodoCommunity;
if (typeof document !== 'undefined') {
HelperFunctions.scroll();
}
if (this.masterZenodoCommunityId) {
this._ΖenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.masterZenodoCommunityId, null).subscribe(
result => {
this.CommunityIds = result;
this.zenodoSearchUtils.totalResults = this.CommunityIds.length;
if (this.CommunityIds.length == 0) {
this.zenodoSearchUtils.status = this.errorCodes.NONE;
}
for (let i = 0; i < this.CommunityIds.length; i++) {
this.getZenodoCommunityById(this.CommunityIds[i]["zenodoid"], this.CommunityIds[i]["id"]);
}
this.masterZenodoCommunity = result;
},
error => {
//console.error("list of zenodo communities couldn't be loaded");
this.handleError("Error getting list of zenodo communities for community with openaire id: " + this.communityId, error);
this.zenodoSearchUtils.status = this.errorCodes.ERROR;
} //this.handleError('System error retrieving community profile', error)
this.handleError("Error getting Master Zenodo community with id: " + this.masterZenodoCommunityId, error);
}
);
},
error => {
//console.error("Community couldn't be loaded");
this.handleError("Error getting community with id: " + this.communityId, error);
this.zenodoSearchUtils.status = this.errorCodes.ERROR;
}
);
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
this._searchZenodoCommunitiesService.searchZCommunities(this.properties, this.communityId).subscribe(
result => {
this.CommunityIds = result;
this.zenodoSearchUtils.totalResults = this.CommunityIds.length;
if (this.CommunityIds.length == 0) {
this.zenodoSearchUtils.status = this.errorCodes.NONE;
}
for (let i = 0; i < this.CommunityIds.length; i++) {
this.getZenodoCommunityById(this.CommunityIds[i]["zenodoid"], this.CommunityIds[i]["id"]);
}
}
},
error => {
//console.error("list of zenodo communities couldn't be loaded");
this.handleError("Error getting list of zenodo communities for community with openaire id: " + this.communityId, error);
this.zenodoSearchUtils.status = this.errorCodes.ERROR;
} //this.handleError('System error retrieving community profile', error)
);
},
error => {
//console.error("Community couldn't be loaded");
this.handleError("Error getting community with id: " + this.communityId, error);
this.zenodoSearchUtils.status = this.errorCodes.ERROR;
}
);
}
});
});
@ -137,8 +152,7 @@ export class ShareInZenodoComponent {
}
private updateTitle(title: string) {
var _prefix = "OpenAIRE | ";
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
var _title = ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title);
this._meta.updateTag({content: _title}, "property='og:title'");
}

View File

@ -13,11 +13,15 @@ import {SearchZenodoCommunitiesServiceModule} from '../../openaireLibrary/connec
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
import {RouterModule} from "@angular/router";
import {HelperModule} from "../../openaireLibrary/utils/helper/helper.module";
import {PiwikServiceModule} from "../../openaireLibrary/utils/piwik/piwikService.module";
import {Schema2jsonldModule} from "../../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../../openaireLibrary/sharedComponents/SEO/SEOService.module";
@NgModule({
imports: [
CommonModule,ShareInZenodoRoutingModule, ZenodoCommunitiesServiceModule, SearchZenodoCommunitiesServiceModule,
RouterModule, HelperModule
RouterModule, HelperModule,
PiwikServiceModule, Schema2jsonldModule, SEOServiceModule
],
declarations: [
ShareInZenodoComponent

View File

@ -15,9 +15,13 @@ export class OpenaireDataProviderComponent {
constructor(private route: ActivatedRoute) {
this.route.data
.subscribe((data: { envSpecific: any }) => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
this.piwikSiteId = PiwikHelper.siteIDs[this.communityId];
this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, data.envSpecific.environment);
});
});
}

View File

@ -15,9 +15,13 @@ export class OpenaireDatasetComponent {
constructor(private route: ActivatedRoute) {
this.route.data
.subscribe((data: { envSpecific: any }) => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
this.piwikSiteId = PiwikHelper.siteIDs[this.communityId];
this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, data.envSpecific.environment);
});
});
}

View File

@ -12,9 +12,13 @@ export class OpenaireHtmlProjectReportComponent{
constructor (private route: ActivatedRoute ) {
this.route.data
.subscribe((data: { envSpecific: any }) => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
this.piwikSiteId = PiwikHelper.siteIDs[this.communityId];
this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, data.envSpecific.environment);
});
});
}

View File

@ -15,9 +15,13 @@ export class OpenaireOrganizationComponent {
constructor(private route: ActivatedRoute) {
this.route.data
.subscribe((data: { envSpecific: any }) => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
this.piwikSiteId = PiwikHelper.siteIDs[this.communityId];
this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, data.envSpecific.environment);
});
});
}

View File

@ -14,8 +14,13 @@ export class OpenaireOrpComponent {
constructor (private route: ActivatedRoute ) {
this.route.data
.subscribe((data: { envSpecific: any }) => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
this.piwikSiteId = PiwikHelper.siteIDs[this.communityId];
this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, data.envSpecific.environment);
});
});
}

View File

@ -15,9 +15,13 @@ export class OpenaireProjectComponent {
constructor(private route: ActivatedRoute) {
this.route.data
.subscribe((data: { envSpecific: any }) => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
this.piwikSiteId = PiwikHelper.siteIDs[this.communityId];
this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, data.envSpecific.environment);
});
});
}

View File

@ -15,9 +15,13 @@ export class OpenairePublicationComponent {
constructor(private route: ActivatedRoute) {
this.route.data
.subscribe((data: { envSpecific: any }) => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
this.piwikSiteId = PiwikHelper.siteIDs[this.communityId];
this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, data.envSpecific.environment);
});
});
}

View File

@ -15,9 +15,13 @@ export class OpenaireSoftwareComponent {
constructor(private route: ActivatedRoute) {
this.route.data
.subscribe((data: { envSpecific: any }) => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
this.piwikSiteId = PiwikHelper.siteIDs[this.communityId];
this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, data.envSpecific.environment);
});
});
}

View File

@ -1,13 +1,16 @@
import {Component} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title} from '@angular/platform-browser';
import {Meta, Title} from '@angular/platform-browser';
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
@Component({
selector: 'learn-how',
template: `
<schema2jsonld *ngIf="url" [URL]="url" [name]="pageTitle" type="other"></schema2jsonld>
<ng-template #one>
<h5 class="uk-text-bold uk-margin-small-bottom">1. Understanding your needs</h5>
<div>
@ -123,27 +126,34 @@ export class LearnHowComponent {
public pageContents = null;
public divContents = null;
private pageTitle = "OpenAIRE - Connect | Learn How";
public url: string = null;
public pageTitle: string = "OpenAIRE - Connect | Learn How";
properties: EnvProperties;
constructor(
private route: ActivatedRoute,
private _router: Router,
private _meta: Meta,
private _title: Title,
private seoService: SEOService,
private _piwikService: PiwikService,
private helper: HelperService) {
this._title.setTitle(this.pageTitle);
}
private helper: HelperService) {}
public ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect | Create and manage your community page", this.properties.piwikSiteId).subscribe();
this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe();
}
this.url = this.properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
this.updateUrl(this.url);
this.updateTitle(this.pageTitle);
this.updateDescription("OpenAIRE - Connect, Community Gateway, research community");
//this.getDivContents();
this.getPageContents();
});
@ -200,4 +210,19 @@ export class LearnHowComponent {
text: "Invite more users to subscribe, manage community subscribers, your personal info and notification settings."
});
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _title = ((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'");
}
}

View File

@ -11,10 +11,13 @@ import {LearnHowRoutingModule} from "./learn-how-routing.module";
import {GifSliderModule} from "../openaireLibrary/utils/gif-slider/gif-slider.module";
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard";
import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
@NgModule({
imports: [
CommonModule, RouterModule, LearnHowRoutingModule, GifSliderModule, HelperModule
CommonModule, RouterModule, LearnHowRoutingModule, GifSliderModule, HelperModule,
Schema2jsonldModule, SEOServiceModule
],
declarations: [
LearnHowComponent

View File

@ -1,13 +1,16 @@
import {Component} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title} from '@angular/platform-browser';
import {Meta, Title} from '@angular/platform-browser';
import {PiwikService} from '../../openaireLibrary/utils/piwik/piwik.service';
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
import {HelperService} from "../../openaireLibrary/utils/helper/helper.service";
import {SEOService} from "../../openaireLibrary/sharedComponents/SEO/SEO.service";
@Component({
selector: 'learn-in-depth',
template: `
<schema2jsonld *ngIf="url" [URL]="url" [name]="pageTitle" type="other"></schema2jsonld>
<div class="image-front-topbar"
uk-scrollspy="{&quot;target&quot;:&quot;[uk-scrollspy-class]&quot;,&quot;cls&quot;:&quot;uk-animation-fade&quot;,&quot;delay&quot;:false}"
tm-header-transparent="light" tm-header-transparent-placeholder="">
@ -207,27 +210,35 @@ export class LearnInDepthComponent {
public pageContents = null;
public divContents = null;
private pageTitle = "OpenAIRE - Connect | Learn In Depth";
public url: string = null;
public pageTitle: string = "OpenAIRE - Connect | Learn In Depth";
properties: EnvProperties;
constructor(
private route: ActivatedRoute,
private _router: Router,
private _meta: Meta,
private _title: Title,
private seoService: SEOService,
private _piwikService: PiwikService,
private helper: HelperService) {
var description = "OpenAIRE - Connect, Community Dashboard, research community";
this._title.setTitle(this.pageTitle);
}
public ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect | Create and manage your community page - learn in depth", this.properties.piwikSiteId).subscribe();
this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe();
}
this.url = this.properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
this.updateUrl(this.url);
this.updateTitle(this.pageTitle);
this.updateDescription("OpenAIRE - Connect, Community Gateway, research community");
//this.getDivContents();
this.getPageContents();
});
@ -250,4 +261,19 @@ export class LearnInDepthComponent {
this.piwiksub.unsubscribe();
}
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _title = ((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'");
}
}

View File

@ -10,10 +10,13 @@ import {LearnInDepthComponent} from "./learn-in-depth.component";
import {LearnInDepthRoutingModule} from "./learn-in-depth-routing.module";
import {HelperModule} from "../../openaireLibrary/utils/helper/helper.module";
import {IsRouteEnabled} from "../../openaireLibrary/error/isRouteEnabled.guard";
import {Schema2jsonldModule} from "../../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../../openaireLibrary/sharedComponents/SEO/SEOService.module";
@NgModule({
imports: [
CommonModule, RouterModule, LearnInDepthRoutingModule, HelperModule
CommonModule, RouterModule, LearnInDepthRoutingModule, HelperModule,
Schema2jsonldModule, SEOServiceModule
],
declarations: [
LearnInDepthComponent

View File

@ -8,7 +8,7 @@ import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/
@Component({
selector: 'openaire-advanced-search-datasets',
template: `
<advanced-search-datasets [customFilter]=customFilter [piwikSiteId]="piwikSiteId">
<advanced-search-datasets [customFilter]=customFilter [piwikSiteId]="piwikSiteId" [hasPrefix]="false">
</advanced-search-datasets>
`
@ -27,16 +27,16 @@ export class OpenaireAdvancedSearchDatasetsComponent {
var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
this.piwikSiteId = PiwikHelper.getSiteId(communityId,data.envSpecific.environment);
if(communityId){
this.connectCommunityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}else{
this.route.queryParams.subscribe(data => {
this.route.queryParams.subscribe(params => {
if(data['communityId'] && data['communityId']!=""){
this.connectCommunityId = data['communityId'];
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
if(params['communityId'] && params['communityId']!=""){
this.connectCommunityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId,data.envSpecific.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}
});

View File

@ -8,7 +8,7 @@ import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/
@Component({
selector: 'openaire-advanced-search-orps',
template: `
<advanced-search-orps [customFilter]=customFilter [piwikSiteId]="piwikSiteId">
<advanced-search-orps [customFilter]=customFilter [piwikSiteId]="piwikSiteId" [hasPrefix]="false">
</advanced-search-orps>
`
})
@ -24,18 +24,19 @@ export class OpenaireAdvancedSearchOrpsComponent {
this.route.data
.subscribe((data: { envSpecific: any }) => {
var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
if(communityId){
this.piwikSiteId = PiwikHelper.getSiteId(communityId,data.envSpecific.environment);
if(communityId){
this.connectCommunityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}else{
this.route.queryParams.subscribe(data => {
this.route.queryParams.subscribe(params => {
if(data['communityId'] && data['communityId']!=""){
this.connectCommunityId = data['communityId'];
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
if(params['communityId'] && params['communityId']!=""){
this.connectCommunityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId, data.envSpecific.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}
});

View File

@ -8,7 +8,7 @@ import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/
@Component({
selector: 'openaire-advanced-search-publications',
template: `
<advanced-search-publications [customFilter]=customFilter [piwikSiteId]="piwikSiteId">
<advanced-search-publications [customFilter]=customFilter [piwikSiteId]="piwikSiteId" [hasPrefix]="false">
</advanced-search-publications>
`
})
@ -22,22 +22,22 @@ export class OpenaireAdvancedSearchPublicationsComponent {
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: any }) => {
var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
this.piwikSiteId = PiwikHelper.getSiteId(communityId, data.envSpecific.environment);
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
if(communityId){
this.connectCommunityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}else{
this.route.queryParams.subscribe(data => {
if(communityId){
this.connectCommunityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}else{
this.route.queryParams.subscribe(params => {
if(data['communityId'] && data['communityId']!=""){
this.connectCommunityId = data['communityId'];
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}
});
if(params['communityId'] && params['communityId']!=""){
this.connectCommunityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId, params.envSpecific.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}
});
}
});
}

View File

@ -7,7 +7,7 @@ import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/
@Component({
selector: 'openaire-advanced-search-software',
template: `
<advanced-search-software [customFilter]=customFilter [piwikSiteId]="piwikSiteId">
<advanced-search-software [customFilter]=customFilter [piwikSiteId]="piwikSiteId" [hasPrefix]="false">
</advanced-search-software>
`
@ -23,22 +23,23 @@ export class OpenaireAdvancedSearchSoftwareComponent {
this.route.data
.subscribe((data: { envSpecific: any }) => {
var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
if(communityId){
this.connectCommunityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}else{
this.route.queryParams.subscribe(data => {
this.piwikSiteId = PiwikHelper.getSiteId(communityId, data.envSpecific.environment);
if(data['communityId'] && data['communityId']!=""){
this.connectCommunityId = data['communityId'];
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}
});
}
if(communityId){
this.connectCommunityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
} else{
this.route.queryParams.subscribe(params => {
if(params['communityId'] && params['communityId']!=""){
this.connectCommunityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId, data.envSpecific.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}
});
}
});
}
}

View File

@ -12,14 +12,14 @@ import {Session} from "../../openaireLibrary/login/utils/helper.class";
import {CommunityInfo} from "../../openaireLibrary/connect/community/communityInfo";
import {SubscribeService} from "../../openaireLibrary/utils/subscribe/subscribe.service";
import {StringUtils} from "../../openaireLibrary/utils/string-utils.class";
import {PiwikService} from "../../openaireLibrary/utils/piwik/piwik.service";
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
@Component({
selector: 'search-communities',
template: `
<search-page pageTitle="OpenAIRE-Connect | Search Communities"
[hasPrefix]=false searchFormClass="communitiesSearchForm"
[hasPrefix]=false [piwikSiteId]="piwikSiteId"
searchFormClass="communitiesSearchForm"
formPlaceholderText="Search for Research Communities and Initiatives"
type="communities" entityType="community" [filters]="filters"
[results]="results" [searchUtils]="searchUtils"
@ -30,7 +30,7 @@ import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class
`
})
export class SearchCommunitiesComponent {
public piwiksub: any;
public piwikSiteId = null;
private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent;
public results: CommunityInfo[] = [];
@ -47,8 +47,7 @@ export class SearchCommunitiesComponent {
constructor (private route: ActivatedRoute,
private _communitiesService: CommunitiesService,
private _subscribeService: SubscribeService,
private _piwikService: PiwikService) {
private _subscribeService: SubscribeService) {
this.errorCodes = new ErrorCodes();
this.errorMessages = new ErrorMessagesComponent();
this.searchUtils.status = this.errorCodes.LOADING;
@ -58,10 +57,8 @@ export class SearchCommunitiesComponent {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.piwikSiteId = this.properties.piwikSiteId;
this.baseUrl = data.envSpecific.searchLinkToCommunities;
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect|Search Communities", this.properties.piwikSiteId).subscribe();
}
});
this.sub = this.route.queryParams.subscribe(params => {
this.searchPage.resultsPerPage = 10;

View File

@ -6,7 +6,6 @@ import {SearchPageModule} from "../../openaireLibrary/searchPages/searchUtils/se
import {SearchFormModule} from "../../openaireLibrary/searchPages/searchUtils/searchForm.module";
import {SearchCommunitiesRoutingModule} from "./searchCommunities-routing.module";
import {PreviousRouteRecorder} from "../../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
import {PiwikService} from "../../openaireLibrary/utils/piwik/piwik.service";
@NgModule({
imports: [
@ -17,7 +16,7 @@ import {PiwikService} from "../../openaireLibrary/utils/piwik/piwik.service";
declarations: [
SearchCommunitiesComponent
],
providers:[ PreviousRouteRecorder, PiwikService],
providers:[ PreviousRouteRecorder],
exports: [
SearchCommunitiesComponent
]

View File

@ -20,15 +20,15 @@ export class OpenaireSearchComponent{
this.route.data
.subscribe((data: { envSpecific: any }) => {
var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
this.piwikSiteId = PiwikHelper.getSiteId(communityId,data.envSpecific.environment);
if(communityId){
this.connectCommunityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}else{
this.route.queryParams.subscribe(data => {
if(data['communityId'] && data['communityId']!=""){
this.connectCommunityId = data['communityId'];
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
this.route.queryParams.subscribe(params => {
if(params['communityId'] && params['communityId']!=""){
this.connectCommunityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId,data.envSpecific.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}
});

View File

@ -18,7 +18,7 @@ import {PiwikHelper} from '../../utils/piwikHelper';
selector: 'openaire-search-dataproviders',
template: `
<search-page-table pageTitle="OpenAIRE Content Providers Table"
<search-page-table pageTitle="Search Content Providers"
type="content providers" entityType="dataprovider"
[(results)] = "results" [(searchUtils)] = "searchUtils"
[columnNames]="columnNames"
@ -27,7 +27,8 @@ import {PiwikHelper} from '../../utils/piwikHelper';
[disableForms]="disableForms"
[enableSearchView]="enableSearchView"
searchFormClass="datasourcesTableSearchForm"
formPlaceholderText="Search for Content Providers">
formPlaceholderText="Search for Content Providers"
[piwikSiteId]="piwikSiteId" [hasPrefix]="false">
</search-page-table>
`
@ -72,7 +73,7 @@ export class OpenaireSearchDataprovidersComponent {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.siteIDs[this.communityId];
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId,this.properties.environment);
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
//this.filters = this.createFilters();
//this.searchPage.getParametersFromUrl(params);

View File

@ -10,7 +10,7 @@ import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/
<search-datasets
openaireLink="https://beta.explore.openaire.eu/search/find/datasets"
[customFilter]=customFilter [piwikSiteId]="piwikSiteId">
[customFilter]=customFilter [piwikSiteId]="piwikSiteId" [hasPrefix]="false">
</search-datasets>
`
})
@ -30,15 +30,15 @@ export class OpenaireSearchDatasetsComponent {
var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if(communityId){
this.connectCommunityId = communityId
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
this.connectCommunityId = communityId;
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId,data.envSpecific.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}else{
this.route.queryParams.subscribe(data => {
if(data['communityId'] && data['communityId']!=""){
this.connectCommunityId = data['communityId'];
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
this.route.queryParams.subscribe(params => {
if(params['communityId'] && params['communityId']!=""){
this.connectCommunityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId,data.envSpecific.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}

View File

@ -25,12 +25,12 @@ export class OpenaireSearchOrganizationsComponent {
var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if(communityId){
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
this.piwikSiteId = PiwikHelper.getSiteId(communityId,data.envSpecific.environment);
}else{
this.route.queryParams.subscribe(data => {
if(data['communityId'] && data['communityId']!=""){
communityId = data['communityId'];
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
this.route.queryParams.subscribe(params => {
if(params['communityId'] && params['communityId']!=""){
communityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(communityId,data.envSpecific.environment);
}
});
}

View File

@ -10,7 +10,7 @@ import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/
<search-orps openaireLink="https://beta.explore.openaire.eu/search/find/other"
[customFilter]=customFilter [piwikSiteId]="piwikSiteId">
[customFilter]=customFilter [piwikSiteId]="piwikSiteId" [hasPrefix]="false">
</search-orps>
`
@ -34,14 +34,14 @@ export class OpenaireSearchOrpsComponent {
var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if (communityId) {
this.connectCommunityId = communityId
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId,data.envSpecific.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
} else {
this.route.queryParams.subscribe(data => {
if (data['communityId'] && data['communityId'] != "") {
this.connectCommunityId = data['communityId'];
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
this.route.queryParams.subscribe(params => {
if (params['communityId'] && params['communityId'] != "") {
this.connectCommunityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId,data.envSpecific.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}

View File

@ -18,7 +18,7 @@ import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
selector: 'openaire-search-projects',
template: `
<search-page-table pageTitle="OpenAIRE Projects Table"
<search-page-table pageTitle="Search Projects"
type="projects" entityType="project" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils"
[columnNames]="columnNames"
@ -27,7 +27,8 @@ import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
[disableForms]="disableForms"
[enableSearchView]="enableSearchView"
searchFormClass="projectsTableSearchForm"
formPlaceholderText="Search for Projects">
formPlaceholderText="Search for Projects"
[piwikSiteId]="piwikSiteId" [hasPrefix]="false">
</search-page-table>
`
@ -72,7 +73,7 @@ export class OpenaireSearchProjectsComponent {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.siteIDs[this.communityId];
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId,this.properties.environment);
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
//this.filters = this.createFilters();
//this.searchPage.getParametersFromUrl(params);

View File

@ -3,6 +3,7 @@ import {ActivatedRoute} from '@angular/router';
import {PiwikHelper} from '../../utils/piwikHelper';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
@Component({
selector: 'openaire-search-publications',
@ -10,7 +11,7 @@ import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/
<search-publications openaireLink="https://beta.explore.openaire.eu/search/find/publications"
[customFilter]=customFilter [piwikSiteId]="piwikSiteId">
[customFilter]=customFilter [piwikSiteId]="piwikSiteId" [hasPrefix]="false">
</search-publications>
`
@ -21,6 +22,7 @@ export class OpenaireSearchPublicationsComponent {
connectCommunityId: string;
piwikSiteId = null;
customFilter: SearchCustomFilter = null;
properties:EnvProperties;
constructor(private route: ActivatedRoute) {
}
@ -33,14 +35,14 @@ export class OpenaireSearchPublicationsComponent {
var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if (communityId) {
this.connectCommunityId = communityId;
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId,data.envSpecific.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
} else {
this.route.queryParams.subscribe(data => {
if (data['communityId'] && data['communityId'] != "") {
this.connectCommunityId = data['communityId'];
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
this.route.queryParams.subscribe(params => {
if (params['communityId'] && params['communityId'] != "") {
this.connectCommunityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId,data.envSpecific.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}

View File

@ -10,7 +10,7 @@ import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/
<search-software
openaireLink="https://beta.explore.openaire.eu/search/find/software"
[customFilter]=customFilter [piwikSiteId]="piwikSiteId">
[customFilter]=customFilter [piwikSiteId]="piwikSiteId" [hasPrefix]="false">
</search-software>
`
})
@ -31,15 +31,16 @@ export class OpenaireSearchSoftwareComponent {
var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if (communityId) {
this.connectCommunityId = communityId
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
this.connectCommunityId = communityId;
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId,data.envSpecific.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
} else {
this.route.queryParams.subscribe(data => {
if (data['communityId'] && data['communityId'] != "") {
this.connectCommunityId = data['communityId'];
this.piwikSiteId = PiwikHelper.siteIDs[this.connectCommunityId];
this.route.queryParams.subscribe(params => {
if (params['communityId'] && params['communityId'] != "") {
this.connectCommunityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId,data.envSpecific.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}

View File

@ -1,3 +1,5 @@
<schema2jsonld *ngIf="url" [URL]="url" [name]="pageTitle" type="other"></schema2jsonld>
<div *ngIf="longView == true">
<div class="uk-section uk-padding-remove-top tm-middle uk-container" id="tm-main">

View File

@ -17,6 +17,10 @@ import {ErrorMessagesComponent} from '../../../openaireLibrary/utils/errorMessag
import {Session} from '../../../openaireLibrary/login/utils/helper.class';
import {HelperFunctions} from "../../../openaireLibrary/utils/HelperFunctions.class";
import {HelperService} from "../../../openaireLibrary/utils/helper/helper.service";
import {Meta, Title} from "@angular/platform-browser";
import {SEOService} from "../../../openaireLibrary/sharedComponents/SEO/SEO.service";
import {PiwikService} from "../../../openaireLibrary/utils/piwik/piwik.service";
import {PiwikHelper} from "../../piwikHelper";
@Component({
selector: 'invite',
@ -61,21 +65,27 @@ export class InviteComponent implements OnInit {
public pageContents = null;
public divContents = null;
public url: string = null;
public pageTitle: string = "Invite";
piwiksub: any;
constructor(
private route: ActivatedRoute,
private _router: Router,
public _fb: FormBuilder,
private _emailService: EmailService,
private _communityService: CommunityService,
private helper: HelperService) {
private helper: HelperService,
private _meta: Meta,
private _title: Title,
private seoService: SEOService,
private _piwikService: PiwikService) {
this.errorCodes = new ErrorCodes();
this.errorMessages = new ErrorMessagesComponent();
this.status = this.errorCodes.LOADING;
}
public ngOnInit() {
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
@ -90,6 +100,15 @@ export class InviteComponent implements OnInit {
this.communityId = communityId['communityId'];
}
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, PiwikHelper.getSiteId(this.communityId,this.properties.environment)).subscribe();
}
this.url = this.properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
this.updateUrl(this.url);
this.updateTitle(this.pageTitle);
this.updateDescription("OpenAIRE - Connect, Community Gateway, research community, invite");
this.communityIdParam = (this.properties.environment != "development") ? {} : {communityId: this.communityId};
if (this.communityId != null && this.communityId != '') {
//this.getDivContents();
@ -123,6 +142,12 @@ export class InviteComponent implements OnInit {
});
}
ngOnDestroy() {
if(this.piwiksub) {
this.piwiksub.unsubscribe();
}
}
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.pageContents = contents;
@ -265,4 +290,19 @@ export class InviteComponent implements OnInit {
private handleError(message: string, error) {
console.error("Invite Page (or component): " + message, error);
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _title = ((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'");
}
}

View File

@ -15,18 +15,22 @@ import {CommunityService} from '../../../openaireLibrary/connect/commu
import {ErrorMessagesModule} from '../../../openaireLibrary/utils/errorMessages.module';
import {IsRouteEnabled} from "../../../openaireLibrary/error/isRouteEnabled.guard";
import {HelperModule} from "../../../openaireLibrary/utils/helper/helper.module";
import {Schema2jsonldModule} from "../../../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../../../openaireLibrary/sharedComponents/SEO/SEOService.module";
import {PiwikService} from "../../../openaireLibrary/utils/piwik/piwik.service";
@NgModule({
imports: [
CommonModule, FormsModule, RouterModule, InviteRoutingModule, CKEditorModule, ErrorMessagesModule,
HelperModule
HelperModule, Schema2jsonldModule, SEOServiceModule
],
declarations: [
InviteComponent
],
providers: [
LoginGuard, PreviousRouteRecorder,
EmailService, CommunityService, IsRouteEnabled
EmailService, CommunityService, IsRouteEnabled,
PiwikService
],
exports: [
InviteComponent