diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts index 6ec97875..f16c7166 100644 --- a/landingPages/organization/organization.component.ts +++ b/landingPages/organization/organization.component.ts @@ -303,6 +303,8 @@ export class OrganizationComponent { this.errorMessage = 'No organization found'; } else { this.organizationInfo = data; + this.organizationId = this.organizationInfo.objIdentifier; // reset in case the parameter was a canonical url. The related queries and reports should have the dedup id + this.csvParamsTail = '" and relorganizationid exact "' + this.organizationId + '" ))'; this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToOrganization + this.organizationInfo.relcanId); this.updateTitle((this.organizationInfo.title.name?this.organizationInfo.title.name:(this.organizationInfo.name?this.organizationInfo.name:'No title available'))); this.updateDescription("Organization, country, " + diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 7e65e77e..af62e942 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -348,15 +348,15 @@ export class ResultLandingComponent { this.subscriptions.push(this._resultLandingService.getResultLandingInfo(this.id, this.identifier, this.type, provenanceActionVocabulary, this.properties).subscribe( data => { this.resultLandingInfo = data; + this.id = this.resultLandingInfo.objIdentifier; if(!this.id) { - this.id = this.resultLandingInfo.relcanId; this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.id + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false'; this.downloadsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"' + this.id + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false'; } - if (this.type == "result") { // no type was specified - update URL based this.resultLandingInfo.resultType - this.updateUrlWithType(); - } let pid:Identifier = Identifier.getResultPIDFromIdentifiers(this.resultLandingInfo.identifiers); + if (this.type == "result") { // no type was specified - update URL based this.resultLandingInfo.resultType + this.updateUrlWithType(pid); + } this.seoService.createLinkForCanonicalURL(this.properties.domain+ properties.baseLink + ( pid ? (this.linkToLandingPage.split("?")[0] + "?pid=" + pid.id): (this.linkToLandingPage + this.resultLandingInfo.relcanId))); if ((this.type == "publication") && (this.properties.environment == "beta" || this.properties.environment == "development") && (typeof document !== 'undefined')) { @@ -558,7 +558,7 @@ export class ResultLandingComponent { return ResultPreview.relationResultConvert(result, this.relation); } - updateUrlWithType() { + updateUrlWithType(pid) { this.type = this.resultLandingInfo.resultType; if (this.type == "publication") { @@ -576,7 +576,8 @@ export class ResultLandingComponent { this.linkToSearchPage = this.properties.searchLinkToOrps; } if(!this.identifier) { - this._location.go(this.linkToLandingPage + this.id); + this._location.go(( pid ? (this.linkToLandingPage.split("?")[0] + "?pid=" + pid.id): + (this.linkToLandingPage + this.id))); } // else { // this._location.go(this.linkToLandingPage.split("?")[0] + "?pid=" + this.identifier.id); @@ -625,7 +626,7 @@ export class ResultLandingComponent { this.citeModal.alertTitle = "Cite this " + this.getTypeName(); this.citeModal.open(); } - addNoIndexFilter() { + private addNoIndexFilter() { try { if(!(this.properties.environment == "production" || this.properties.environment == "development") ) { return ; @@ -644,7 +645,13 @@ export class ResultLandingComponent { || (this.resultLandingInfo.similarResearchResults && this.resultLandingInfo.similarResearchResults.length > 0) || (this.resultLandingInfo.supplementaryResearchResults && this.resultLandingInfo.supplementaryResearchResults.length > 0) || (this.resultLandingInfo.supplementedByResearchResults && this.resultLandingInfo.supplementedByResearchResults.length > 0) - )); + ) + ); + allow = allow && !( + (this.hasKeyword(this.resultLandingInfo.title.toLowerCase()) || (this.resultLandingInfo.authors && this.hasKeyword(this.resultLandingInfo.authors.join(" ").toLowerCase()))) && + (this.resultLandingInfo.publisher == "Zenodo" || + this.resultLandingInfo.hostedBy_collectedFrom.filter( value => {return value.downloadName && value.downloadName.toLowerCase().indexOf("zenodo")!=-1}).length > 0)); + if(!allow) { this._meta.updateTag({content: 'noindex'}, "name='robots'"); } @@ -654,4 +661,8 @@ export class ResultLandingComponent { return false; } } + private hasKeyword(value:string){ + let words = ["movie","hd","film","kimetsu", "1080p","4k","call of duty"]; + return words.filter( word => { return value.indexOf(word)!=-1}).length > 0; + } } diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index 711657cd..8b2cf3c1 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -126,6 +126,7 @@ export class ResultLandingService { // res this.resultLandingInfo.record = data[14]; + this.resultLandingInfo.objIdentifier = data[14]["result"]["header"]["dri:objIdentifier"]; this.resultLandingInfo.relcanId = ParsingFunctions.parseRelCanonicalId(this.resultLandingInfo.record, "result"); this.resultLandingInfo.resultType = data[0].resulttype.classid; diff --git a/utils/entities/resultLandingInfo.ts b/utils/entities/resultLandingInfo.ts index 92ed45e7..6782c09e 100644 --- a/utils/entities/resultLandingInfo.ts +++ b/utils/entities/resultLandingInfo.ts @@ -20,6 +20,7 @@ export interface Reference { export class ResultLandingInfo { relcanId; + objIdentifier: string; // PUBLICATION, DATASET, SOFTWARE, ORP record; resultType: "publication"|"dataset"|"other"|"software";