[Trunk | Library]: 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-services-library/trunk/ng-openaire-library/src/app@56840 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2019-08-02 14:55:32 +00:00
parent 3d79e469ef
commit 30bc39aa22
30 changed files with 210 additions and 85 deletions

View File

@ -1,4 +1,4 @@
<schema2jsonld *ngIf="url" [URL]="url" name="Manage links" type="other"></schema2jsonld> <schema2jsonld *ngIf="url" [URL]="url" [name]="title" type="other"></schema2jsonld>
<div class="uk-width-1-1"> <div class="uk-width-1-1">
</div> </div>

View File

@ -14,6 +14,8 @@ import {IndexInfoService} from "../../../utils/indexInfo.service";
import {ClaimDBRecord} from "../claimHelper.class"; import {ClaimDBRecord} from "../claimHelper.class";
import {Dates} from "../../../utils/string-utils.class"; import {Dates} from "../../../utils/string-utils.class";
import {HelperService} from "../../../utils/helper/helper.service"; import {HelperService} from "../../../utils/helper/helper.service";
import {Meta, Title} from "@angular/platform-browser";
import {PiwikService} from "../../../utils/piwik/piwik.service";
@Component({ @Component({
@ -23,6 +25,10 @@ import {HelperService} from "../../../utils/helper/helper.service";
}) })
export class DisplayClaimsComponent { export class DisplayClaimsComponent {
@Input() piwikSiteId = null;
@Input() title: string = "";
piwiksub:any;
properties: EnvProperties; properties: EnvProperties;
public searchTermStream = new Subject<string>(); public searchTermStream = new Subject<string>();
sub: any; sub: any;
@ -77,6 +83,7 @@ export class DisplayClaimsComponent {
public pageContents = null; public pageContents = null;
constructor(private _claimService: ClaimsService, private route: ActivatedRoute, private _router: Router, private location: Location, constructor(private _claimService: ClaimsService, private route: ActivatedRoute, private _router: Router, private location: Location,
private _meta: Meta, private _title: Title, private _piwikService:PiwikService,
private seoService: SEOService, private indexInfoService:IndexInfoService, private helper: HelperService) { private seoService: SEOService, private indexInfoService:IndexInfoService, private helper: HelperService) {
} }
@ -85,6 +92,16 @@ export class DisplayClaimsComponent {
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.url = data.envSpecific.baseLink + this._router.url; this.url = data.envSpecific.baseLink + this._router.url;
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);
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.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.pageContents = contents; this.pageContents = contents;
}); });
@ -92,7 +109,7 @@ export class DisplayClaimsComponent {
this.lastIndexDate = res; this.lastIndexDate = res;
}); });
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url, false); this.seoService.createLinkForCanonicalURL(this.url, false);
if (this.myClaims) { if (this.myClaims) {
this.fetchBy = "User"; this.fetchBy = "User";
@ -132,6 +149,9 @@ export class DisplayClaimsComponent {
ngOnDestroy() { ngOnDestroy() {
this.sub.unsubscribe(); this.sub.unsubscribe();
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
//this.searchTermStreamSub.unsubscribe(); //this.searchTermStreamSub.unsubscribe();
} }
@ -587,4 +607,21 @@ export class DisplayClaimsComponent {
} }
return totalPages; return totalPages;
} }
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'");
}
} }

View File

@ -12,11 +12,13 @@ import {HelperModule} from '../../../utils/helper/helper.module';
import {Schema2jsonldModule} from '../../../sharedComponents/schema2jsonld/schema2jsonld.module'; import {Schema2jsonldModule} from '../../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../../sharedComponents/SEO/SEOService.module'; import { SEOServiceModule } from '../../../sharedComponents/SEO/SEOService.module';
import {IndexInfoServiceModule} from "../../../utils/indexInfoService.module"; import {IndexInfoServiceModule} from "../../../utils/indexInfoService.module";
import {PiwikServiceModule} from "../../../utils/piwik/piwikService.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, RouterModule, ClaimServiceModule, LoadingModalModule, AlertModalModule, CommonModule, FormsModule, RouterModule, ClaimServiceModule, LoadingModalModule, AlertModalModule,
ClaimEntityFormatterModule, PagingModule, HelperModule, Schema2jsonldModule, SEOServiceModule, IndexInfoServiceModule ClaimEntityFormatterModule, PagingModule, HelperModule, Schema2jsonldModule, SEOServiceModule, PiwikServiceModule,
IndexInfoServiceModule
], ],
declarations: [ declarations: [

View File

@ -1,5 +1,6 @@
<linking-generic *ngIf="validInput" [localStoragePrefix]="localStoragePrefix" [results]="results" [sources]="sources" <linking-generic *ngIf="validInput" [localStoragePrefix]="localStoragePrefix" [results]="results" [sources]="sources"
[communityId]="communityId" [inlineEntity]="inlineEntity" [showOptions]="showOptions"> [communityId]="communityId" [inlineEntity]="inlineEntity" [showOptions]="showOptions"
[piwikSiteId]="piwikSiteId" title="Direct Linking">
</linking-generic> </linking-generic>
<div *ngIf="!validInput" id="tm-main" class=" uk-section uk-margin-small-top tm-middle"> <div *ngIf="!validInput" id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
@ -14,7 +15,7 @@
<div class="uk-grid helper-grid"> <div class="uk-grid helper-grid">
<div class="uk-width-expand"> <div class="uk-width-expand">
<div *ngIf="validInput != null && !validInput" class="uk-alert uk-alert-warning" <div *ngIf="validInput != null && !validInput" class="uk-alert uk-alert-warning"
role="alert">No valid arguments provided in order to start linking openAIRE entities. role="alert">No valid arguments provided in order to start linking OpenAIRE entities.
</div> </div>
</div> </div>

View File

@ -9,7 +9,6 @@ import {SearchPublicationsService} from '../../services/searchPublications.servi
import {SearchDatasetsService} from '../../services/searchDatasets.service'; import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {SearchSoftwareService} from '../../services/searchSoftware.service'; import {SearchSoftwareService} from '../../services/searchSoftware.service';
import {SearchOrpsService} from '../../services/searchOrps.service'; import {SearchOrpsService} from '../../services/searchOrps.service';
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {LinkingGenericComponent} from "../linking/linkingGeneric.component"; import {LinkingGenericComponent} from "../linking/linkingGeneric.component";
import {ClaimResultSearchFormComponent} from "../claim-utils/claimResultSearchForm.component"; import {ClaimResultSearchFormComponent} from "../claim-utils/claimResultSearchForm.component";
@ -19,6 +18,8 @@ import {ClaimResultSearchFormComponent} from "../claim-utils/claimResultSearchFo
templateUrl: 'directLinking.component.html' templateUrl: 'directLinking.component.html'
}) })
export class DirectLinkingComponent { export class DirectLinkingComponent {
@Input() piwikSiteId = null;
@ViewChild(LinkingGenericComponent) linking: LinkingGenericComponent; @ViewChild(LinkingGenericComponent) linking: LinkingGenericComponent;
results: ClaimEntity[] = []; results: ClaimEntity[] = [];
@ -40,22 +41,13 @@ export class DirectLinkingComponent {
localStoragePrefix: string = ""; localStoragePrefix: string = "";
constructor(private _router: Router, private route: ActivatedRoute,private entitySearch:EntitiesSearchService, constructor(private _router: Router, private route: ActivatedRoute,private entitySearch:EntitiesSearchService,
private publicationsSearch: SearchPublicationsService, private datasetsSearch: SearchDatasetsService, private publicationsSearch: SearchPublicationsService, private datasetsSearch: SearchDatasetsService,
private softwareSearch: SearchSoftwareService, private ORPSearch: SearchOrpsService, 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);
} }
ngOnInit() { ngOnInit() {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; 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 => { this.sub = this.route.queryParams.subscribe(params => {

View File

@ -10,6 +10,7 @@ import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {AlertModal} from "../../utils/modal/alert"; import {AlertModal} from "../../utils/modal/alert";
import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service"; import {HelperService} from "../../utils/helper/helper.service";
import {PiwikService} from "../../utils/piwik/piwik.service";
declare var UIkit:any; declare var UIkit:any;
@ -19,6 +20,10 @@ declare var UIkit:any;
}) })
export class LinkingGenericComponent { export class LinkingGenericComponent {
@Input() piwikSiteId = null;
@Input() title: string = null;
piwiksub:any;
@Input() communityId:string= null; @Input() communityId:string= null;
sourceType:string; sourceType:string;
targetType:string; targetType:string;
@ -43,14 +48,8 @@ export class LinkingGenericComponent {
constructor (private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService, constructor (private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService,
private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService, private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService,
private _meta: Meta, private _title: Title, private _meta: Meta, private _title: Title, private _piwikService:PiwikService,
private seoService: SEOService, private helper: HelperService ) { private seoService: SEOService, private helper: HelperService ) {
let title = "OpenAIRE | Linking";
this._meta.updateTag({content:title},"property='og:title'");
this._title.setTitle(title);
} }
ngOnInit() { ngOnInit() {
this.showOptions.show = 'source'; this.showOptions.show = 'source';
@ -63,7 +62,18 @@ export class LinkingGenericComponent {
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.url = data.envSpecific.baseLink+this._router.url; 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.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.pageContents = contents; this.pageContents = contents;
}) })
@ -81,6 +91,12 @@ export class LinkingGenericComponent {
} }
} }
ngOnDestroy() {
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
}
openSelectionModal() { openSelectionModal() {
this.alert.cancelButton = false; this.alert.cancelButton = false;
this.alert.okButton = false; this.alert.okButton = false;
@ -105,6 +121,23 @@ export class LinkingGenericComponent {
} }
scrollUp(){ scrollUp(){
HelperFunctions.scroll(); 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'");
} }
} }

View File

@ -20,6 +20,7 @@ import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {MetadataPreviewModule} from './selected/metadataPreview.module'; import {MetadataPreviewModule} from './selected/metadataPreview.module';
import {ClaimEntitiesMetadataModule} from "./selected/ClaimEntitiesMetadata.module"; import {ClaimEntitiesMetadataModule} from "./selected/ClaimEntitiesMetadata.module";
import {AlertModalModule} from '../../utils/modal/alertModal.module'; import {AlertModalModule} from '../../utils/modal/alertModal.module';
import {PiwikServiceModule} from "../../utils/piwik/piwikService.module";
@NgModule({ @NgModule({
imports: [ imports: [
@ -27,7 +28,8 @@ import {AlertModalModule} from '../../utils/modal/alertModal.module';
SelectedPublicationsModule, SelectedPublicationsModule,
StartOverModule, StartOverModule,
ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule, ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule,
HelperModule, Schema2jsonldModule, SEOServiceModule, MetadataPreviewModule, ClaimEntitiesMetadataModule, AlertModalModule HelperModule, Schema2jsonldModule, SEOServiceModule, MetadataPreviewModule, ClaimEntitiesMetadataModule, AlertModalModule,
PiwikServiceModule
], ],
providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled], providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled],
declarations: [ declarations: [

View File

@ -17,9 +17,10 @@ import {Meta, Title} from '@angular/platform-browser';
Manage your links in OpenAIRE Manage your links in OpenAIRE
</div> </div>
<div> <div>
<displayClaims [enableDelete]=true [myClaims]=true [isAdmin]=false [showUserEmail]=false <displayClaims [enableDelete]=true [myClaims]=true [isAdmin]=false [showUserEmail]=false
[claimsInfoURL]=claimsInfoURL [communityId]=communityId [claimsInfoURL]=claimsInfoURL [communityId]=communityId
></displayClaims> [piwikSiteId]="piwikSiteId" title="My links">
</displayClaims>
</div> </div>
</div> </div>
</div> </div>
@ -31,15 +32,10 @@ import {Meta, Title} from '@angular/platform-browser';
export class MyClaimsComponent { export class MyClaimsComponent {
@Input() claimsInfoURL: string; @Input() claimsInfoURL: string;
@Input() communityId:string; @Input() communityId:string;
constructor(private _meta: Meta, private _title: Title) { @Input() piwikSiteId = null;
let title = "OpenAIRE | My links";
this._meta.updateTag({content: title}, "property='og:title'"); constructor() {}
this._title.setTitle(title);
}
ngOnInit() { ngOnInit() {}
}
} }

View File

@ -5,10 +5,14 @@ import {ActivatedRoute, Router} from "@angular/router";
import {PiwikService} from "../utils/piwik/piwik.service"; import {PiwikService} from "../utils/piwik/piwik.service";
import {HelperService} from "../utils/helper/helper.service"; import {HelperService} from "../utils/helper/helper.service";
import {RouterHelper} from "../utils/routerHelper.class"; import {RouterHelper} from "../utils/routerHelper.class";
import {SEOService} from "../sharedComponents/SEO/SEO.service";
import {Meta, Title} from "@angular/platform-browser";
@Component({ @Component({
selector: 'deposit-first-page', selector: 'deposit-first-page',
template: ` template: `
<schema2jsonld *ngIf="url" [URL]="url" [name]="title" type="other"></schema2jsonld>
<div class="uk-section uk-padding-remove-bottom uk-padding-remove-top"> <div class="uk-section uk-padding-remove-bottom uk-padding-remove-top">
<div class="communityPanelBackground uk-margin-top uk-padding-small"> <div class="communityPanelBackground uk-margin-top uk-padding-small">
<div class="uk-align-center uk-container uk-container-large uk-margin-large-top uk-margin-large-bottom"> <div class="uk-align-center uk-container uk-container-large uk-margin-large-top uk-margin-large-bottom">
@ -147,6 +151,9 @@ import {RouterHelper} from "../utils/routerHelper.class";
}) })
export class DepositFirstPageComponent { export class DepositFirstPageComponent {
public url: string = null;
public title: string = "Deposit your research - Learn How";
@Input() public zenodoInformation: ZenodoInformationClass = new ZenodoInformationClass(); @Input() public zenodoInformation: ZenodoInformationClass = new ZenodoInformationClass();
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
piwiksub:any; piwiksub:any;
@ -164,13 +171,24 @@ export class DepositFirstPageComponent {
constructor (private route: ActivatedRoute, private _piwikService:PiwikService, constructor (private route: ActivatedRoute, private _piwikService:PiwikService,
private helper: HelperService, private helper: HelperService,
private _router: Router) {} private _router: Router,
private _meta: Meta, private _title: Title,
private seoService: SEOService) {
}
ngOnInit() { ngOnInit() {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.url = this.properties.baseLink+this._router.url;
this.seoService.createLinkForCanonicalURL(this.url, false);
var description = "Openaire, Zenodo, repositories, open access, content provider, compatibility, deposit";
this.updateTitle(this.title);
this.updateDescription(description);
this.updateUrl(this.url);
this.depositRoute = this.properties.depositSearchPage; this.depositRoute = this.properties.depositSearchPage;
//this.getDivContents(); //this.getDivContents();
this.getPageContents(); this.getPageContents();
@ -185,7 +203,7 @@ export class DepositFirstPageComponent {
} }
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, "Deposit your research (first page)", this.piwikSiteId).subscribe(); this.piwiksub = this._piwikService.trackView(this.properties, this.title, this.piwikSiteId).subscribe();
} }
}); });
} }
@ -207,4 +225,21 @@ export class DepositFirstPageComponent {
this.piwiksub.unsubscribe(); 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 _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'");
}
} }

View File

@ -6,11 +6,10 @@ import {ErrorCodes} from '../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../utils/errorMessages.component';
import {SearchFields} from '../utils/properties/searchFields'; import {SearchFields} from '../utils/properties/searchFields';
import {SearchPageComponent } from '../searchPages/searchUtils/searchPage.component'; import {SearchPageComponent } from '../searchPages/searchUtils/searchPage.component';
import {SearchCustomFilter, SearchUtilsClass} from '../searchPages/searchUtils/searchUtils.class'; import {SearchUtilsClass} from '../searchPages/searchUtils/searchUtils.class';
import {EnvProperties} from '../utils/properties/env-properties'; import {EnvProperties} from '../utils/properties/env-properties';
import {StringUtils} from "../utils/string-utils.class"; import {StringUtils} from "../utils/string-utils.class";
import {ZenodoInformationClass} from "./utils/zenodoInformation.class"; import {ZenodoInformationClass} from "./utils/zenodoInformation.class";
import {PiwikService} from "../utils/piwik/piwik.service";
import {RouterHelper} from "../utils/routerHelper.class"; import {RouterHelper} from "../utils/routerHelper.class";
@Component({ @Component({
@ -30,7 +29,7 @@ import {RouterHelper} from "../utils/routerHelper.class";
</div> </div>
</div> </div>
</div> </div>
<search-page pageTitle="Search Content Providers" <search-page pageTitle="Deposit Browse & Search repositories" [hasPrefix]=false
formPlaceholderText = "Search for Content Providers" formPlaceholderText = "Search for Content Providers"
type="content providers" entityType="dataprovider" [(filters)] = "filters" type="content providers" entityType="dataprovider" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl" [(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl"
@ -53,8 +52,6 @@ export class SearchDataprovidersToDepositComponent {
private errorCodes: ErrorCodes; private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
piwiksub:any;
@Input() customFilter:SearchCustomFilter= null;
public results =[]; public results =[];
public filters =[]; public filters =[];
public totalResults:number = 0 ; public totalResults:number = 0 ;
@ -83,8 +80,7 @@ export class SearchDataprovidersToDepositComponent {
depositLearnHowPage: string = null; depositLearnHowPage: string = null;
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper:RouterHelper = new RouterHelper();
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService, constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService) {
private _piwikService:PiwikService) {
this.errorCodes = new ErrorCodes(); this.errorCodes = new ErrorCodes();
this.errorMessages = new ErrorMessagesComponent(); this.errorMessages = new ErrorMessagesComponent();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
@ -98,10 +94,6 @@ export class SearchDataprovidersToDepositComponent {
this.depositLearnHowPage = this.properties.depositLearnHowPage; this.depositLearnHowPage = this.properties.depositLearnHowPage;
this.baseUrl = this.properties.depositSearchPage; this.baseUrl = this.properties.depositSearchPage;
this.pagingLimit = this.properties.pagingLimit; this.pagingLimit = this.properties.pagingLimit;
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, "Deposit search page)", this.piwikSiteId).subscribe();
}
}); });
this.searchPage.refineFields = this.refineFields; this.searchPage.refineFields = this.refineFields;
this.searchPage.fieldIdsMap = this.fieldIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap;
@ -126,7 +118,6 @@ export class SearchDataprovidersToDepositComponent {
if(this.searchUtils.size != 5 && this.searchUtils.size != 10 && this.searchUtils.size != 20 && this.searchUtils.size != 50) { if(this.searchUtils.size != 5 && this.searchUtils.size != 10 && this.searchUtils.size != 20 && this.searchUtils.size != 50) {
this.searchUtils.size = 5; this.searchUtils.size = 5;
} }
this.searchPage.customFilter = this.customFilter;
this.searchPage.usedBy = "deposit"; this.searchPage.usedBy = "deposit";
var queryParameters = this.searchPage.getQueryParametersFromUrl(params); var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size); this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size);
@ -140,10 +131,6 @@ export class SearchDataprovidersToDepositComponent {
if(this.subResults){ if(this.subResults){
this.subResults.unsubscribe(); this.subResults.unsubscribe();
} }
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
} }
public getResults(keyword:string,refine:boolean, page: number, size: number){ public getResults(keyword:string,refine:boolean, page: number, size: number){

View File

@ -12,13 +12,11 @@ import {SearchFormModule} from '../searchPages/searchUtils/searchForm.module';
import {SearchPageModule} from '../searchPages/searchUtils/searchPage.module'; import {SearchPageModule} from '../searchPages/searchUtils/searchPage.module';
import {FreeGuard} from'../login/freeGuard.guard'; import {FreeGuard} from'../login/freeGuard.guard';
import {IsRouteEnabled} from '../error/isRouteEnabled.guard'; import {IsRouteEnabled} from '../error/isRouteEnabled.guard';
import {PiwikServiceModule} from "../utils/piwik/piwikService.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, CommonModule, FormsModule,
RouterModule, RouterModule,
PiwikServiceModule,
DataProvidersServiceModule, DataProvidersServiceModule,
SearchFormModule, SearchResultsModule, SearchPageModule SearchFormModule, SearchResultsModule, SearchPageModule

View File

@ -235,7 +235,10 @@ export class DataProviderComponent {
} }
private updateTitle(title: string) { private updateTitle(title: string) {
var _prefix = "OpenAIRE | "; var _prefix = "";
if(this.communityId) {
_prefix = "OpenAIRE | ";
}
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title); this._title.setTitle(_title);
this._meta.updateTag({content: _title}, "property='og:title'"); this._meta.updateTag({content: _title}, "property='og:title'");

View File

@ -210,7 +210,10 @@ export class DatasetComponent {
} }
private updateTitle(title: string) { private updateTitle(title: string) {
var _prefix = "OpenAIRE | "; var _prefix = "";
if(!this.communityId) {
_prefix = "OpenAIRE | ";
}
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title); this._title.setTitle(_title);
this._meta.updateTag({content: _title}, "property='og:title'"); this._meta.updateTag({content: _title}, "property='og:title'");

View File

@ -289,7 +289,10 @@ export class HtmlProjectReportComponent {
} }
private updateTitle(title: string) { private updateTitle(title: string) {
var _prefix = "OpenAIRE | "; var _prefix = "";
if(!this.communityId) {
_prefix = "OpenAIRE | ";
}
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title); this._title.setTitle(_title);
this._meta.updateTag({content: _title}, "property='og:title'"); this._meta.updateTag({content: _title}, "property='og:title'");

View File

@ -487,7 +487,10 @@ export class OrganizationComponent {
} }
private updateTitle(title: string) { private updateTitle(title: string) {
var _prefix = "OpenAIRE | "; var _prefix = "";
if(!this.communityId) {
_prefix = "OpenAIRE | ";
}
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title); this._title.setTitle(_title);
this._meta.updateTag({content: _title}, "property='og:title'"); this._meta.updateTag({content: _title}, "property='og:title'");

View File

@ -196,7 +196,10 @@ export class OrpComponent {
} }
private updateTitle(title: string) { private updateTitle(title: string) {
var _prefix = "OpenAIRE | "; var _prefix = "";
if(!this.communityId) {
_prefix = "OpenAIRE | ";
}
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title); this._title.setTitle(_title);
this._meta.updateTag({content: _title}, "property='og:title'"); this._meta.updateTag({content: _title}, "property='og:title'");

View File

@ -488,7 +488,10 @@ export class ProjectComponent {
} }
private updateTitle(title: string) { private updateTitle(title: string) {
var _prefix = "OpenAIRE | "; var _prefix = "";
if(!this.communityId) {
_prefix = "OpenAIRE | ";
}
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title); this._title.setTitle(_title);
this._meta.updateTag({content: _title}, "property='og:title'"); this._meta.updateTag({content: _title}, "property='og:title'");

View File

@ -272,10 +272,13 @@ export class PublicationComponent {
} }
private updateTitle(title: string) { private updateTitle(title: string) {
var _prefix = "OpenAIRE | "; var _prefix = "";
if(!this.communityId) {
_prefix = "OpenAIRE | ";
}
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(title); this._title.setTitle(_title);
this._meta.updateTag({content: title}, "property='og:title'"); this._meta.updateTag({content: _title}, "property='og:title'");
} }
private updateUrl(url: string) { private updateUrl(url: string) {

View File

@ -203,7 +203,10 @@ export class SoftwareComponent {
} }
private updateTitle(title: string) { private updateTitle(title: string) {
var _prefix = "OpenAIRE | "; var _prefix = "";
if(!this.communityId) {
_prefix = "OpenAIRE | ";
}
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title); this._title.setTitle(_title);
this._meta.updateTag({content: _title}, "property='og:title'"); this._meta.updateTag({content: _title}, "property='og:title'");

View File

@ -24,7 +24,8 @@ import{EnvProperties} from '../../utils/properties/env-properties';
[csvParams]="csvParams" csvPath="datasets" simpleSearchLink="/search/find/datasets" [csvParams]="csvParams" csvPath="datasets" simpleSearchLink="/search/find/datasets"
[disableForms]="disableForms" [disableForms]="disableForms"
[loadPaging]="loadPaging" [loadPaging]="loadPaging"
[oldTotalResults]="oldTotalResults" [piwikSiteId]=piwikSiteId [oldTotalResults]="oldTotalResults"
[piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix"
searchFormClass="datasetsSearchForm" searchFormClass="datasetsSearchForm"
[(sort)]=sort > [(sort)]=sort >
</advanced-search-page> </advanced-search-page>
@ -37,6 +38,7 @@ export class AdvancedSearchDatasetsComponent {
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
properties:EnvProperties; properties:EnvProperties;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() hasPrefix: boolean = true;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
public results =[]; public results =[];

View File

@ -24,7 +24,8 @@ import{EnvProperties} from '../../utils/properties/env-properties';
[csvParams]="csvParams" csvPath="other" simpleSearchLink="/search/find/other" [csvParams]="csvParams" csvPath="other" simpleSearchLink="/search/find/other"
[disableForms]="disableForms" [disableForms]="disableForms"
[loadPaging]="loadPaging" [loadPaging]="loadPaging"
[oldTotalResults]="oldTotalResults" [piwikSiteId]=piwikSiteId [oldTotalResults]="oldTotalResults"
[piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix"
searchFormClass="orpsSearchForm" searchFormClass="orpsSearchForm"
[(sort)]=sort > [(sort)]=sort >
</advanced-search-page> </advanced-search-page>
@ -36,7 +37,8 @@ export class AdvancedSearchOrpsComponent {
private errorCodes: ErrorCodes; private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
properties:EnvProperties; properties:EnvProperties;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() hasPrefix: boolean = true;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
public results =[]; public results =[];

View File

@ -26,7 +26,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';
[loadPaging]="loadPaging" [loadPaging]="loadPaging"
[oldTotalResults]="oldTotalResults" [oldTotalResults]="oldTotalResults"
[(openaireLink)]=openaireLink [(openaireLink)]=openaireLink
[piwikSiteId]=piwikSiteId [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix"
searchFormClass="publicationsSearchForm" searchFormClass="publicationsSearchForm"
[(sort)]=sort > [(sort)]=sort >
</advanced-search-page> </advanced-search-page>
@ -36,7 +36,8 @@ import{EnvProperties} from '../../utils/properties/env-properties';
export class AdvancedSearchPublicationsComponent { export class AdvancedSearchPublicationsComponent {
private errorCodes: ErrorCodes; private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() hasPrefix: boolean = true;
public results =[]; public results =[];
public filters =[]; public filters =[];

View File

@ -24,7 +24,8 @@ import{EnvProperties} from '../../utils/properties/env-properties';
[csvParams]="csvParams" csvPath="software" simpleSearchLink="/search/find/software" [csvParams]="csvParams" csvPath="software" simpleSearchLink="/search/find/software"
[disableForms]="disableForms" [disableForms]="disableForms"
[loadPaging]="loadPaging" [loadPaging]="loadPaging"
[oldTotalResults]="oldTotalResults" [piwikSiteId]=piwikSiteId [oldTotalResults]="oldTotalResults"
[piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix"
searchFormClass="softwareSearchForm" searchFormClass="softwareSearchForm"
[(sort)]=sort > [(sort)]=sort >
</advanced-search-page> </advanced-search-page>
@ -35,7 +36,8 @@ import{EnvProperties} from '../../utils/properties/env-properties';
export class AdvancedSearchSoftwareComponent { export class AdvancedSearchSoftwareComponent {
private errorCodes: ErrorCodes; private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() hasPrefix: boolean = true;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
public results =[]; public results =[];
public filters =[]; public filters =[];

View File

@ -21,6 +21,7 @@ import {HelperService} from "../../utils/helper/helper.service";
}) })
export class AdvancedSearchPageComponent { export class AdvancedSearchPageComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() hasPrefix: boolean = true;
@Input() pageTitle = ""; @Input() pageTitle = "";
@Input() results = []; @Input() results = [];
@Input() type; @Input() type;
@ -89,10 +90,9 @@ export class AdvancedSearchPageComponent {
} }
}); });
var title = "Advanced search " + this.pageTitle;
var description = "Openaire, search, repositories, open access, type, content provider, funder, project, " + this.pageTitle; var description = "Openaire, search, repositories, open access, type, content provider, funder, project, " + this.pageTitle;
this.updateTitle(title); this.updateTitle(this.pageTitle);
this.updateDescription(description); this.updateDescription(description);
this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl; this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl;
@ -128,7 +128,10 @@ export class AdvancedSearchPageComponent {
} }
updateTitle(title: string) { updateTitle(title: string) {
var _prefix = "OpenAIRE | "; var _prefix = "";
if(this.hasPrefix) {
_prefix = "OpenAIRE | ";
}
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title); this._title.setTitle(_title);
this._meta.updateTag({content: _title}, "property='og:title'"); this._meta.updateTag({content: _title}, "property='og:title'");

View File

@ -147,7 +147,7 @@ export class SearchPageComponent {
updateTitle(title:string) { updateTitle(title:string) {
let _title: string; let _title: string;
if(this.hasPrefix) { if(this.hasPrefix && !this.customFilter) {
let _prefix ="OpenAIRE | "; let _prefix ="OpenAIRE | ";
_title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
} else { } else {

View File

@ -39,6 +39,7 @@ import { SEOService } from '../../sharedComponents/SEO/SEO.service';
}) })
export class SearchPageTableViewComponent implements OnInit, AfterViewInit { export class SearchPageTableViewComponent implements OnInit, AfterViewInit {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() hasPrefix: boolean = true;
@Input() pageTitle = ""; @Input() pageTitle = "";
@Input() results; @Input() results;
@Input() filters = []; @Input() filters = [];
@ -165,7 +166,10 @@ export class SearchPageTableViewComponent implements OnInit, AfterViewInit {
this._meta.updateTag({content:description},"property='og:description'"); this._meta.updateTag({content:description},"property='og:description'");
} }
updateTitle(title:string) { updateTitle(title:string) {
var _prefix ="OpenAIRE | "; var _prefix: string = "";
if(this.hasPrefix) {
_prefix = "OpenAIRE | ";
}
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._title.setTitle(_title); this._title.setTitle(_title);
this._meta.updateTag({content:_title},"property='og:title'"); this._meta.updateTag({content:_title},"property='og:title'");

View File

@ -30,7 +30,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';
'communityPanelBackground' : 'datasetsSearchForm'" 'communityPanelBackground' : 'datasetsSearchForm'"
[(openaireLink)]=openaireLink [(openaireLink)]=openaireLink
[(advancedSearchParameters)]=advancedSearchParameters [(advancedSearchParameters)]=advancedSearchParameters
[piwikSiteId]=piwikSiteId [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix"
[(sort)]=sort > [(sort)]=sort >
</search-page> </search-page>
<!--[(sortBy)]="sortBy"--> <!--[(sortBy)]="sortBy"-->
@ -40,7 +40,8 @@ import{EnvProperties} from '../../utils/properties/env-properties';
export class SearchDatasetsComponent { export class SearchDatasetsComponent {
private errorCodes: ErrorCodes; private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() hasPrefix: boolean = true;
public results =[]; public results =[];
public filters: Filter[] =[]; public filters: Filter[] =[];
// public totalResults:number = 0 ; // public totalResults:number = 0 ;

View File

@ -30,7 +30,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';
'communityPanelBackground' : 'orpsSearchForm'" 'communityPanelBackground' : 'orpsSearchForm'"
[(openaireLink)]=openaireLink [(openaireLink)]=openaireLink
[(advancedSearchParameters)]=advancedSearchParameters [(advancedSearchParameters)]=advancedSearchParameters
[piwikSiteId]=piwikSiteId [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix"
[(sort)]=sort > [(sort)]=sort >
</search-page> </search-page>
` `
@ -40,6 +40,7 @@ export class SearchOrpsComponent {
private errorCodes: ErrorCodes; private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() hasPrefix: boolean = true;
public results =[]; public results =[];
public filters: Filter[] =[]; public filters: Filter[] =[];
public baseUrl:string; public baseUrl:string;

View File

@ -31,7 +31,7 @@ import {EnvProperties} from '../../utils/properties/env-properties';
'communityPanelBackground' : 'publicationsSearchForm'" 'communityPanelBackground' : 'publicationsSearchForm'"
[(openaireLink)]=openaireLink [(openaireLink)]=openaireLink
[(advancedSearchParameters)]=advancedSearchParameters [(advancedSearchParameters)]=advancedSearchParameters
[piwikSiteId]=piwikSiteId [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix"
[(sort)]=sort > [(sort)]=sort >
</search-page> </search-page>
@ -41,7 +41,8 @@ import {EnvProperties} from '../../utils/properties/env-properties';
export class SearchPublicationsComponent { export class SearchPublicationsComponent {
private errorCodes: ErrorCodes; private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() hasPrefix: boolean = true;
public results =[]; public results =[];
public filters =[]; public filters =[];
public searchUtils:SearchUtilsClass = new SearchUtilsClass(); public searchUtils:SearchUtilsClass = new SearchUtilsClass();

View File

@ -30,7 +30,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';
'communityPanelBackground' : 'softwareSearchForm'" 'communityPanelBackground' : 'softwareSearchForm'"
[(openaireLink)]=openaireLink [(openaireLink)]=openaireLink
[(advancedSearchParameters)]=advancedSearchParameters [(advancedSearchParameters)]=advancedSearchParameters
[piwikSiteId]=piwikSiteId [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix"
[(sort)]=sort > [(sort)]=sort >
</search-page> </search-page>
` `
@ -43,6 +43,7 @@ export class SearchSoftwareComponent {
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
@Input() advancedSearchParameters ; @Input() advancedSearchParameters ;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() hasPrefix: boolean = true;
public results =[]; public results =[];
public filters: Filter[] =[]; public filters: Filter[] =[];
// public totalResults:number = 0 ; // public totalResults:number = 0 ;