+
0"
+ class="uk-margin-medium-bottom">
+
Abstract
-
{{resultLandingInfo.description.substring(0, showNumDescription)}}
-
thresholdDescription">...
-
-
-
thresholdDescription"
- class="uk-text-right">
-
- Read less
-
+
+
diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts
index dc24ff4c..1d5a8c6f 100644
--- a/landingPages/result/resultLanding.component.ts
+++ b/landingPages/result/resultLanding.component.ts
@@ -56,9 +56,6 @@ export class ResultLandingComponent {
public canonicalUrl: string = null;
public linkToSearchPage: string = null;
- public thresholdDescription: number = 670;
- public showNumDescription: number = 670;
-
public citeThisClicked: boolean;
// Metrics tab variables
@@ -390,7 +387,7 @@ export class ResultLandingComponent {
this.addNoIndexFilter();
if (this.resultLandingInfo.title) {
this.updateTitle(this.resultLandingInfo.title);
- this.updateDescription((this.resultLandingInfo.description ? (this.resultLandingInfo.description) : ("," + this.resultLandingInfo.title)));
+ this.updateDescription((this.resultLandingInfo.description && this.resultLandingInfo.description[0] ? (this.resultLandingInfo.description[0].substr(0,157) + (this.resultLandingInfo.description[0].substr(0,157).length == 157?"...":"")) : (this.resultLandingInfo.title)));
}
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.subscriptions.push(this._piwikService.trackViewForCustomUrl(this.properties, this.resultLandingInfo.title, this.linkToLandingPage.split("?")[1] + this.id ,this.piwikSiteId).subscribe());
@@ -472,8 +469,8 @@ export class ResultLandingComponent {
}
private updateDescription(description: string) {
- this._meta.updateTag({content: description.substring(0, 160)}, "name='description'");
- this._meta.updateTag({content: description.substring(0, 160)}, "property='og:description'");
+ this._meta.updateTag({content: description}, "name='description'");
+ this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
@@ -690,7 +687,8 @@ export class ResultLandingComponent {
// || (resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0)
// || (resultLandingInfo.supplementedByResearchResults &&
|| (resultLandingInfo.relatedResults && resultLandingInfo.relatedResults.length > 0)
- )
+ )
+ //&& (resultLandingInfo.description && resultLandingInfo.description[0] && resultLandingInfo.description[0].length >=50 && resultLandingInfo.description[0].length <=5000)
);
// console.log("rich content " + allow)
//spam words to exclude - need to be in lower case
@@ -698,7 +696,7 @@ export class ResultLandingComponent {
let abstract_words = ["operacao-feliz-natal.blogspot.com", "moviedouban.site", "hack-expert-solution.link"];
allow = allow && !(
(this.hasKeyword(resultLandingInfo.title,title_authors_words) || (resultLandingInfo.authors && this.hasKeyword(resultLandingInfo.authors.map(o => o.fullName).join(" "),title_authors_words))
- || (resultLandingInfo.description && this.hasKeyword(resultLandingInfo.description,abstract_words))
+ || (resultLandingInfo.description && resultLandingInfo.description[0] && this.hasKeyword(resultLandingInfo.description[0],abstract_words))
) &&
((resultLandingInfo.publisher && resultLandingInfo.publisher.toLowerCase() == "zenodo") ||
resultLandingInfo.hostedBy_collectedFrom.filter(value => {
@@ -710,7 +708,7 @@ export class ResultLandingComponent {
let common_abstract = ["international audience","n/a","peer reviewed","national audience","info:eu-repo/semantics/published","-",".","graphical abstract","met lit. opg","international audience; no abstract",'
.',"politics","info:eu-repo/semantics/publishedversion","copia digital. madrid : ministerio de educación, cultura y deporte, 2016",'
',"peer-reviewed","copia digital. madrid : ministerio de educación, cultura y deporte. subdirección general de coordinación bibliotecaria, 2015","
-","imperial users only","yüksek lisans"];
let common_authors = ["[s.n.]","null &na;","nn","(:unap)","(:null)","null anonymous","anonymous"];
allow = allow && !(
- this.isKeyword(resultLandingInfo.title,common_titles) || this.isKeyword(resultLandingInfo.description,common_abstract) ||
+ this.isKeyword(resultLandingInfo.title,common_titles) || (resultLandingInfo.description && resultLandingInfo.description[0] && this.isKeyword(resultLandingInfo.description[0],common_abstract)) ||
(resultLandingInfo.authors && this.hasKeyword("_"+resultLandingInfo.authors.map(o => o.fullName).join("_")+"_",common_authors, "_"))
);
// console.log("common content " + allow)
diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts
index fdc27957..3d94e580 100644
--- a/landingPages/result/resultLanding.service.ts
+++ b/landingPages/result/resultLanding.service.ts
@@ -136,16 +136,7 @@ export class ResultLandingService {
this.resultLandingInfo.date = (date && (date).indexOf('-') !== -1) ? date.split('-')[0] : date;
this.resultLandingInfo.dateofacceptance = data[0].dateofacceptance?Dates.getDate(data[0].dateofacceptance):null;
this.resultLandingInfo.publisher = data[0].publisher;
- if(!Array.isArray(data[0].description)) {
- //this.resultLandingInfo.description = String(data[0].description);
- this.resultLandingInfo.description = (data[0] && data[0].description) ? String(data[0].description) : "";
- } else {
- //this.resultLandingInfo.description = String(data[0].description[0]);
- this.resultLandingInfo.description = (data[0] && data[0].description[0]) ? String(data[0].description[0]) : "";
- }
- try{
- this.resultLandingInfo.description = StringUtils.HTMLToString(this.resultLandingInfo.description);
- } catch (e) {}
+ this.resultLandingInfo.description = this.parsingFunctions.parseDescription(data[0] && data[0].description?data[0].description:[]);
this.resultLandingInfo.embargoEndDate = data[0].embargoenddate?Dates.getDate(data[0].embargoenddate):null;
}
diff --git a/orcid/orcidWork.ts b/orcid/orcidWork.ts
index 3c0ac586..83816617 100644
--- a/orcid/orcidWork.ts
+++ b/orcid/orcidWork.ts
@@ -107,7 +107,7 @@ export class WorkV3_0 {
}
if(resultLandingInfo.description && resultLandingInfo.description.length < description_limit) {
- work['short-description'] = resultLandingInfo.description;
+ work['short-description'] = resultLandingInfo.description.length > 0 ? resultLandingInfo.description[0] : "";
}
// citation (Citation, optional),
diff --git a/searchPages/searchUtils/searchResult.component.ts b/searchPages/searchUtils/searchResult.component.ts
index 93f03d20..9bbb2ad5 100644
--- a/searchPages/searchUtils/searchResult.component.ts
+++ b/searchPages/searchUtils/searchResult.component.ts
@@ -42,7 +42,9 @@ export class SearchResultComponent implements OnInit, OnChanges {
}
if((properties.adminToolsPortalType == "explore" || properties.adminToolsPortalType == "community")
- && Session.isLoggedIn() && this.results && this.results.length > 0) {
+ && Session.isLoggedIn() && this.results && this.results.length > 0
+ && (this.type == "result" || this.type == "publication" || this.type == "dataset" || this.type == "software" || this.type == "other")
+ ) {
this.orcidService.getPutCodes(this.previewResults.map(
previewResult => {
if(previewResult.identifiers) {
diff --git a/services/searchResearchResults.service.ts b/services/searchResearchResults.service.ts
index 1877c7a9..6ec1960d 100644
--- a/services/searchResearchResults.service.ts
+++ b/services/searchResearchResults.service.ts
@@ -343,15 +343,9 @@ export class SearchResearchResultsService {
var date: string = (resData.dateofacceptance) + ""; // transform to string in case it is an integer
result.year = (date && (date).indexOf('-') !== -1) ? date.split('-')[0] : date;
-
- if (!Array.isArray(resData.description)) {
- result.description = (resData.description) ? String(resData.description) : "";
- } else {
- result.description = (resData.description[0]) ? String(resData.description[0]) : "";
- }
- try{
- result.description = StringUtils.HTMLToString(result.description);
- } catch (e) {}
+
+ let abstracts = this.parsingFunctions.parseDescription(resData.description);
+ result.description = abstracts.length > 0 ? abstracts[0] : "";
if (result.description && result.description.length > this.sizeOfDescription) {
result.description = result.description.substring(0, this.sizeOfDescription) + "...";
}
diff --git a/sharedComponents/navigationBar.component.ts b/sharedComponents/navigationBar.component.ts
index ee9fad61..c98af504 100644
--- a/sharedComponents/navigationBar.component.ts
+++ b/sharedComponents/navigationBar.component.ts
@@ -103,7 +103,7 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
this.handleError('Error getting community information (e.g. pages,entities) for community with id: ' + this.communityId, error);
}));
}
- if(this.portal != 'connect' && this.portal != 'connect-admin' && this.properties.adminToolsPortalType == 'community') {
+ if(this.properties.environment == "development" && this.portal != 'connect' && this.portal != 'connect-admin' && this.properties.adminToolsPortalType == 'community') {
this.subs.push(
this._helpContentService.getMenuItems(this.portal).subscribe(
data => {
diff --git a/sharedComponents/schema2jsonld/service/jsonld-document-serializer.service.ts b/sharedComponents/schema2jsonld/service/jsonld-document-serializer.service.ts
index 8c95ccc1..69114f1a 100644
--- a/sharedComponents/schema2jsonld/service/jsonld-document-serializer.service.ts
+++ b/sharedComponents/schema2jsonld/service/jsonld-document-serializer.service.ts
@@ -115,12 +115,7 @@ export class JsonldDocumentSerializerService {
}
serializeDescription(doc, buffer){
- if (doc.description && doc.description.length == 1) {
- buffer["description"] = doc.description[0];
- }
- else if (doc.description && doc.description.length > 1) {
- buffer["description"] = doc.description;
- }
+ buffer["description"] = doc.description[0];
}
serializeIdentifier(doc, buffer){
if (doc.identifier && doc.identifier.length == 1) {
diff --git a/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts b/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts
index 28f315b4..d68a3613 100644
--- a/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts
+++ b/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts
@@ -2,6 +2,7 @@ import {Injectable} from '@angular/core';
import {Citation, Dataset, Identifier, License, Organization, Person} from '../model/jsonld-document';
import * as _ from 'lodash';
import {properties} from '../../../../../environments/environment';
+import {ParsingFunctions} from "../../../landingPages/landing-utils/parsingFunctions.class";
@Injectable()
export class OpenAireJsonldConverterService {
@@ -213,9 +214,10 @@ convertDatasource(datasource: any, URL, otherUrl): Organization {
}
private getDescription(result: any): String[] {
const item = _.get(result, "result.metadata.oaf:entity.oaf:result.description", null);
- if (!item) return this.getTitle(result);
- let descr = Array.isArray(item) ? item[0]+ "":item + ""; // +"" to make string: if description is number descr.substring returns error
- return [descr?(descr.substring(0,4997)+(descr.substring(0,4997).length == 4997?'...':'')):"" as String];
+ if (!item) return [ "" + this.getTitle(result)];
+ let parsing = new ParsingFunctions();
+ let abstracts = parsing.parseDescription(item);
+ return [abstracts && abstracts[0] ?(abstracts[0].substring(0,4997)+(abstracts[0].substring(0,4997).length == 4997?'...':'')):"" ];
}
private getDateCreated(result: any): String[] {
diff --git a/utils/entities/resultLandingInfo.ts b/utils/entities/resultLandingInfo.ts
index d3158508..0e47aa92 100644
--- a/utils/entities/resultLandingInfo.ts
+++ b/utils/entities/resultLandingInfo.ts
@@ -35,7 +35,7 @@ export class ResultLandingInfo {
identifiers: Map
; //key is the classname
languages: string[];
countries: string[];
- description: string;
+ description: string[] = [];
hostedBy_collectedFrom: HostedByCollectedFrom[];
diff --git a/utils/properties/searchFields.ts b/utils/properties/searchFields.ts
index 06a7ce50..d948fb09 100644
--- a/utils/properties/searchFields.ts
+++ b/utils/properties/searchFields.ts
@@ -56,7 +56,7 @@ export class SearchFields {
filterType: null
},
["resultdescription"]: {
- name: "Description",
+ name: "Abstract",
type: "keyword",
param: "description",
operator: "ds",
diff --git a/utils/result-preview/result-preview.ts b/utils/result-preview/result-preview.ts
index a3de23c5..7f847f75 100644
--- a/utils/result-preview/result-preview.ts
+++ b/utils/result-preview/result-preview.ts
@@ -148,7 +148,7 @@ export class ResultPreview {
resultPreview.accessMode = result.title.accessMode;
resultPreview.sc39 = result.title.sc39;
if(result.countriesForResults) {
- resultPreview.countries = result.countries;
+ resultPreview.countries = result.countriesForResults;
} else if(result.country) {
resultPreview.countries = [result.country];
} else {
@@ -202,7 +202,7 @@ export class ResultPreview {
resultPreview.accessMode = result.accessMode;
resultPreview.countries = result.countries;
resultPreview.projects = result.fundedByProjects;
- resultPreview.description = result.description;
+ resultPreview.description = result.description.length > 0 ? result.description[0] : "";
if(result.dateofacceptance) {
resultPreview.year = new Date(result.dateofacceptance).getFullYear().toString();
}