[Trunk | Library]: claimResultSearchForm.component & directLinking.component & search.component: Merge methods for research results (since they are now merged in one common service & component).
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@57084 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
e7d0ef876f
commit
fc3e2f9b19
|
@ -271,46 +271,29 @@ export class ClaimResultSearchFormComponent {
|
||||||
this.totalOpenaireCount = 0;
|
this.totalOpenaireCount = 0;
|
||||||
}
|
}
|
||||||
if (type == "dataset") {
|
if (type == "dataset") {
|
||||||
this._searchResearchResultsService.search("dataset", this.createOpenaireQueryParams(), (mainResults && page==1 ?this.openaireRefineFieldsQuery:null), (mainResults?page:1), (mainResults?size:0), "", (mainResults && page==1 ?this.openaireRefineFields:[]), this.properties).subscribe(
|
this.searchResearchResults("dataset", term, size, page, mainResults, type);
|
||||||
data => {
|
|
||||||
this.setOpenaireResults(data, mainResults, page, type);
|
|
||||||
},
|
|
||||||
err => {
|
|
||||||
this.setOpenaireResultsError(mainResults, term, err);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else if (type == "software") {
|
} else if (type == "software") {
|
||||||
this._searchResearchResultsService.search("software", this.createOpenaireQueryParams(), (mainResults && page==1 ?this.openaireRefineFieldsQuery:null), (mainResults?page:1), (mainResults?size:0), "", (mainResults && page==1 ?this.openaireRefineFields:[]), this.properties).subscribe(
|
this.searchResearchResults("software", term, size, page, mainResults, type);
|
||||||
data => {
|
|
||||||
this.setOpenaireResults(data, mainResults, page, type);
|
|
||||||
},
|
|
||||||
err => {
|
|
||||||
this.setOpenaireResultsError(mainResults, term, err);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else if (type == "other") {
|
} else if (type == "other") {
|
||||||
this._searchResearchResultsService.search("other", this.createOpenaireQueryParams(), (mainResults && page==1 ?this.openaireRefineFieldsQuery:null), (mainResults?page:1), (mainResults?size:0), "", (mainResults && page==1 ?this.openaireRefineFields:[]), this.properties).subscribe(
|
this.searchResearchResults("other", term, size, page, mainResults, type);
|
||||||
data => {
|
|
||||||
this.setOpenaireResults(data, mainResults, page, type);
|
|
||||||
},
|
|
||||||
err => {
|
|
||||||
this.setOpenaireResultsError(mainResults, term, err);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
this._searchResearchResultsService.search("publication", this.createOpenaireQueryParams(), (mainResults && page==1 ?this.openaireRefineFieldsQuery:null), (mainResults?page:1), (mainResults?size:0), "", (mainResults && page==1 ?this.openaireRefineFields:[]), this.properties).subscribe(
|
this.searchResearchResults("publication", term, size, page, mainResults, type);
|
||||||
data => {
|
|
||||||
this.setOpenaireResults(data, mainResults, page, type);
|
|
||||||
},
|
|
||||||
err => {
|
|
||||||
this.setOpenaireResultsError(mainResults, term, err);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public searchResearchResults(resultType: string, term: string, size: number, page: number, mainResults: boolean, type) {
|
||||||
|
this._searchResearchResultsService.search(resultType, this.createOpenaireQueryParams(), (mainResults && page==1 ?this.openaireRefineFieldsQuery:null), (mainResults?page:1), (mainResults?size:0), "", (mainResults && page==1 ?this.openaireRefineFields:[]), this.properties).subscribe(
|
||||||
|
data => {
|
||||||
|
this.setOpenaireResults(data, mainResults, page, type);
|
||||||
|
},
|
||||||
|
err => {
|
||||||
|
this.setOpenaireResultsError(mainResults, term, err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public setOpenaireResults(data, mainResults: boolean, page, type) {
|
public setOpenaireResults(data, mainResults: boolean, page, type) {
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
if (mainResults) {
|
if (mainResults) {
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {EntitiesSearchService} from '../../utils/entitiesAutoComplete/entitySear
|
||||||
import {SearchResearchResultsService} from '../../services/searchResearchResults.service';
|
import {SearchResearchResultsService} from '../../services/searchResearchResults.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";
|
||||||
|
import {enterView} from "@angular/core/src/render3/state";
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -71,13 +72,13 @@ export class DirectLinkingComponent {
|
||||||
// this.linkType = "project";
|
// this.linkType = "project";
|
||||||
this.getProjectById(this.id);
|
this.getProjectById(this.id);
|
||||||
} else if (this.type == "publication") {
|
} else if (this.type == "publication") {
|
||||||
this.getPublicationById(this.id);
|
this.getResearchResultById("publication", this.id);
|
||||||
} else if (this.type == "dataset") {
|
} else if (this.type == "dataset") {
|
||||||
this.getDatasetById(this.id);
|
this.getResearchResultById("dataset", this.id);
|
||||||
} else if (this.type == "software") {
|
} else if (this.type == "software") {
|
||||||
this.getSoftwareById(this.id);
|
this.getResearchResultById("software", this.id);
|
||||||
} else if (this.type == "orp") {
|
} else if (this.type == "orp") {
|
||||||
this.getOrpById(this.id);
|
this.getResearchResultById("other", this.id);
|
||||||
} else {
|
} else {
|
||||||
this.validInput = this.isValidInput(null);
|
this.validInput = this.isValidInput(null);
|
||||||
}
|
}
|
||||||
|
@ -133,51 +134,14 @@ export class DirectLinkingComponent {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getPublicationById(id: string) {
|
getResearchResultById(resultType: string, id: string) {
|
||||||
|
this.sub = this._searchResearchResultsService.searchById(resultType, id, this.properties).subscribe(data => {
|
||||||
this.sub = this._searchResearchResultsService.searchById("publication", id, this.properties).subscribe(data => {
|
this.createClaimEntity(data, resultType);
|
||||||
this.createClaimEntity(data, "publication");
|
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
this.validInput = this.isValidInput(null);
|
this.validInput = this.isValidInput(null);
|
||||||
//console.log("An error occured")
|
//console.log("An error occured")
|
||||||
this.handleError("Error getting publication by id: " + id, err);
|
this.handleError("Error getting "+this.getEntityName(resultType, false, true)+" by id: " + id, err);
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
getDatasetById(id: string) {
|
|
||||||
this.sub = this._searchResearchResultsService.searchById("dataset", id, this.properties).subscribe(
|
|
||||||
data => {
|
|
||||||
this.createClaimEntity(data, "dataset");
|
|
||||||
},
|
|
||||||
err => {
|
|
||||||
this.validInput = this.isValidInput(null);
|
|
||||||
//console.log("An error occured")
|
|
||||||
this.handleError("Error getting research data by id: " + id, err);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
getSoftwareById(id: string) {
|
|
||||||
this.sub = this._searchResearchResultsService.searchById("software", id, this.properties).subscribe(
|
|
||||||
data => {
|
|
||||||
this.createClaimEntity(data, "software");
|
|
||||||
},
|
|
||||||
err => {
|
|
||||||
this.validInput = this.isValidInput(null);
|
|
||||||
//console.log("An error occured")
|
|
||||||
this.handleError("Error getting software by id: " + id, err);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
getOrpById(id: string) {
|
|
||||||
this.sub = this._searchResearchResultsService.searchById("other", id, this.properties).subscribe(
|
|
||||||
data => {
|
|
||||||
this.createClaimEntity(data, "other");
|
|
||||||
},
|
|
||||||
err => {
|
|
||||||
this.validInput = this.isValidInput(null);
|
|
||||||
//console.log("An error occured")
|
|
||||||
this.handleError("Error getting other research product by id: " + id, err);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,4 +176,16 @@ export class DirectLinkingComponent {
|
||||||
private handleError(message: string, error) {
|
private handleError(message: string, error) {
|
||||||
console.error("Direct Linking Page: " + message, error);
|
console.error("Direct Linking Page: " + message, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getEntityName (entityType:string, plural:boolean, full:boolean): string {
|
||||||
|
if(entityType == "publication") {
|
||||||
|
return "publication" + (plural ? "s" : "");
|
||||||
|
} else if(entityType == "dataset") {
|
||||||
|
return (full ? "research data" : ("dataset" + (plural ? "s" : "")));
|
||||||
|
} else if(entityType == "software") {
|
||||||
|
return "software";
|
||||||
|
} else if(entityType == "other") {
|
||||||
|
return (full ? ("other research product" + (plural ? "s" : "")) : "other");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ import {EnvProperties} from '../../utils/properties/env-properties';
|
||||||
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
|
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
|
||||||
import {StringUtils} from '../../utils/string-utils.class';
|
import {StringUtils} from '../../utils/string-utils.class';
|
||||||
import {SearchCustomFilter} from "../searchUtils/searchUtils.class";
|
import {SearchCustomFilter} from "../searchUtils/searchUtils.class";
|
||||||
|
import {Observable} from "rxjs";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
changeDetection: ChangeDetectionStrategy.Default,
|
changeDetection: ChangeDetectionStrategy.Default,
|
||||||
|
@ -257,7 +258,7 @@ export class SearchComponent {
|
||||||
|
|
||||||
public searchPublications() {
|
public searchPublications() {
|
||||||
this.activeTab = "publications";
|
this.activeTab = "publications";
|
||||||
this.advancedSearchLink = "/search/advanced/publications";
|
this.advancedSearchLink = this.properties.searchLinkToAdvancedPublications;//"/search/advanced/publications";
|
||||||
if (this.reloadPublications &&
|
if (this.reloadPublications &&
|
||||||
this.fetchPublications.searchUtils.status != this.errorCodes.NONE /*&&
|
this.fetchPublications.searchUtils.status != this.errorCodes.NONE /*&&
|
||||||
this.fetchPublications.searchUtils.status != this.errorCodes.ERROR*/) {
|
this.fetchPublications.searchUtils.status != this.errorCodes.ERROR*/) {
|
||||||
|
@ -269,7 +270,7 @@ export class SearchComponent {
|
||||||
|
|
||||||
public searchDatasets() {
|
public searchDatasets() {
|
||||||
this.activeTab = "research data";
|
this.activeTab = "research data";
|
||||||
this.advancedSearchLink = "/search/advanced/datasets";
|
this.advancedSearchLink = this.properties.searchLinkToAdvancedDatasets;//"/search/advanced/datasets";
|
||||||
if (this.reloadDatasets &&
|
if (this.reloadDatasets &&
|
||||||
this.fetchDatasets.searchUtils.status != this.errorCodes.NONE /*&&
|
this.fetchDatasets.searchUtils.status != this.errorCodes.NONE /*&&
|
||||||
this.fetchDatasets.searchUtils.status != this.errorCodes.ERROR*/) {
|
this.fetchDatasets.searchUtils.status != this.errorCodes.ERROR*/) {
|
||||||
|
@ -282,7 +283,7 @@ export class SearchComponent {
|
||||||
public searchSoftware() {
|
public searchSoftware() {
|
||||||
|
|
||||||
this.activeTab = "software";
|
this.activeTab = "software";
|
||||||
this.advancedSearchLink = "/search/advanced/software";
|
this.advancedSearchLink = this.properties.searchLinkToAdvancedSoftware;//"/search/advanced/software";
|
||||||
if (this.reloadSoftware
|
if (this.reloadSoftware
|
||||||
&& this.fetchSoftware.searchUtils.status != this.errorCodes.NONE/* &&
|
&& this.fetchSoftware.searchUtils.status != this.errorCodes.NONE/* &&
|
||||||
( this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING ||
|
( this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING ||
|
||||||
|
@ -295,7 +296,7 @@ export class SearchComponent {
|
||||||
|
|
||||||
public searchOrps() {
|
public searchOrps() {
|
||||||
this.activeTab = "other research products";
|
this.activeTab = "other research products";
|
||||||
this.advancedSearchLink = "/search/advanced/other";
|
this.advancedSearchLink = this.properties.searchLinkToAdvancedOrps;//"/search/advanced/other";
|
||||||
if (this.reloadOrps &&
|
if (this.reloadOrps &&
|
||||||
this.fetchOrps.searchUtils.status != this.errorCodes.NONE /*&&
|
this.fetchOrps.searchUtils.status != this.errorCodes.NONE /*&&
|
||||||
this.fetchOrps.searchUtils.status != this.errorCodes.ERROR*/) {
|
this.fetchOrps.searchUtils.status != this.errorCodes.ERROR*/) {
|
||||||
|
@ -307,7 +308,7 @@ export class SearchComponent {
|
||||||
|
|
||||||
public searchProjects() {
|
public searchProjects() {
|
||||||
this.activeTab = "projects";
|
this.activeTab = "projects";
|
||||||
this.advancedSearchLink = "/search/advanced/projects";
|
this.advancedSearchLink = this.properties.searchLinkToAdvancedProjects;//"/search/advanced/projects";
|
||||||
if (this.reloadProjects &&
|
if (this.reloadProjects &&
|
||||||
this.fetchProjects.searchUtils.status != this.errorCodes.NONE /*&&
|
this.fetchProjects.searchUtils.status != this.errorCodes.NONE /*&&
|
||||||
this.fetchProjects.searchUtils.status != this.errorCodes.ERROR*/) {
|
this.fetchProjects.searchUtils.status != this.errorCodes.ERROR*/) {
|
||||||
|
@ -319,7 +320,7 @@ export class SearchComponent {
|
||||||
|
|
||||||
public searchDataProviders() {
|
public searchDataProviders() {
|
||||||
this.activeTab = "content providers";
|
this.activeTab = "content providers";
|
||||||
this.advancedSearchLink = "/search/advanced/dataproviders";
|
this.advancedSearchLink = this.properties.searchLinkToAdvancedDataProviders;//"/search/advanced/dataproviders";
|
||||||
if (this.reloadDataproviders &&
|
if (this.reloadDataproviders &&
|
||||||
this.fetchDataproviders.searchUtils.status != this.errorCodes.NONE /*&&
|
this.fetchDataproviders.searchUtils.status != this.errorCodes.NONE /*&&
|
||||||
this.fetchDataproviders.searchUtils.status != this.errorCodes.ERROR*/) {
|
this.fetchDataproviders.searchUtils.status != this.errorCodes.ERROR*/) {
|
||||||
|
@ -331,7 +332,7 @@ export class SearchComponent {
|
||||||
|
|
||||||
public searchOrganizations() {
|
public searchOrganizations() {
|
||||||
this.activeTab = "organizations";
|
this.activeTab = "organizations";
|
||||||
this.advancedSearchLink = "/search/advanced/organizations";
|
this.advancedSearchLink = this.properties.searchLinkToAdvancedOrganizations;//"/search/advanced/organizations";
|
||||||
if (this.reloadOrganizations &&
|
if (this.reloadOrganizations &&
|
||||||
this.fetchOrganizations.searchUtils.status != this.errorCodes.NONE /*&&
|
this.fetchOrganizations.searchUtils.status != this.errorCodes.NONE /*&&
|
||||||
this.fetchOrganizations.searchUtils.status != this.errorCodes.ERROR*/) {
|
this.fetchOrganizations.searchUtils.status != this.errorCodes.ERROR*/) {
|
||||||
|
@ -382,81 +383,22 @@ export class SearchComponent {
|
||||||
this.fetchPublications.searchUtils.status = this.errorCodes.LOADING;
|
this.fetchPublications.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.fetchPublications.results = [];
|
this.fetchPublications.results = [];
|
||||||
|
|
||||||
this.subPub = this._searchResearchResultsService.numOfSearchResults("publication", this.keyword, this.properties, refineParams).subscribe(
|
this.subPub = this.numOfSearchResults("publication", this.fetchPublications, refineParams);
|
||||||
data => {
|
|
||||||
this.fetchPublications.searchUtils.totalResults = data;
|
|
||||||
this.fetchPublications.searchUtils.status = this.errorCodes.DONE;
|
|
||||||
if (this.fetchPublications.searchUtils.totalResults == 0) {
|
|
||||||
this.fetchPublications.searchUtils.status = this.errorCodes.NONE;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
err => {
|
|
||||||
//console.log(err);
|
|
||||||
this.handleError("Error getting number of Publications", err);
|
|
||||||
this.fetchPublications.searchUtils.status = this.errorCodes.ERROR;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (this.activeTab != "research data" && this.showDatasets) {
|
if (this.activeTab != "research data" && this.showDatasets) {
|
||||||
this.fetchDatasets.searchUtils.status = this.errorCodes.LOADING;
|
this.fetchDatasets.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.fetchDatasets.results = [];
|
this.fetchDatasets.results = [];
|
||||||
this.subData = this._searchResearchResultsService.numOfSearchResults("dataset", this.keyword, this.properties, refineParams).subscribe(
|
this.subData = this.numOfSearchResults("dataset", this.fetchDatasets, refineParams);
|
||||||
data => {
|
|
||||||
this.fetchDatasets.searchUtils.totalResults = data;
|
|
||||||
this.fetchDatasets.searchUtils.status = this.errorCodes.DONE;
|
|
||||||
if (this.fetchDatasets.searchUtils.totalResults == 0) {
|
|
||||||
this.fetchDatasets.searchUtils.status = this.errorCodes.NONE;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
err => {
|
|
||||||
//console.log(err);
|
|
||||||
this.handleError("Error getting number of Research Data", err);
|
|
||||||
this.fetchDatasets.searchUtils.status = this.errorCodes.ERROR;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (this.activeTab != "software" && this.showSoftware) {
|
if (this.activeTab != "software" && this.showSoftware) {
|
||||||
this.fetchSoftware.searchUtils.status = this.errorCodes.LOADING;
|
this.fetchSoftware.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.fetchSoftware.results = [];
|
this.fetchSoftware.results = [];
|
||||||
this.subSoftware = this._searchResearchResultsService.numOfSearchResults("software", this.keyword, this.properties, refineParams).subscribe(
|
this.subSoftware = this.numOfSearchResults("software", this.fetchSoftware, refineParams);
|
||||||
data => {
|
|
||||||
this.fetchSoftware.searchUtils.totalResults = data;
|
|
||||||
this.fetchSoftware.searchUtils.status = this.errorCodes.DONE;
|
|
||||||
if (this.fetchSoftware.searchUtils.totalResults == 0) {
|
|
||||||
this.fetchSoftware.searchUtils.status = this.errorCodes.NONE;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
err => {
|
|
||||||
this.handleError("Error getting number of Software", err);
|
|
||||||
/*console.log(err);
|
|
||||||
if(err.status == '404') {
|
|
||||||
this.fetchSoftware.searchUtils.status = this.errorCodes.NOT_FOUND;
|
|
||||||
} else if(err.status == '500') {
|
|
||||||
this.fetchSoftware.searchUtils.status = this.errorCodes.ERROR;
|
|
||||||
} else {
|
|
||||||
this.fetchSoftware.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
|
||||||
}*/
|
|
||||||
this.fetchSoftware.searchUtils.status = this.errorCodes.ERROR;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (this.activeTab != "other research products" && this.showOrps) {
|
if (this.activeTab != "other research products" && this.showOrps) {
|
||||||
this.fetchOrps.searchUtils.status = this.errorCodes.LOADING;
|
this.fetchOrps.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.fetchOrps.results = [];
|
this.fetchOrps.results = [];
|
||||||
this.subOrps = this._searchResearchResultsService.numOfSearchResults("other", this.keyword, this.properties, refineParams).subscribe(
|
this.subOrps = this.numOfSearchResults("other", this.fetchOrps, refineParams);
|
||||||
data => {
|
|
||||||
this.fetchOrps.searchUtils.totalResults = data;
|
|
||||||
this.fetchOrps.searchUtils.status = this.errorCodes.DONE;
|
|
||||||
if (this.fetchOrps.searchUtils.totalResults == 0) {
|
|
||||||
this.fetchOrps.searchUtils.status = this.errorCodes.NONE;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
err => {
|
|
||||||
//console.log(err);
|
|
||||||
this.handleError("Error getting number of Other Research Products", err);
|
|
||||||
this.fetchOrps.searchUtils.status = this.errorCodes.ERROR;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (this.activeTab != "projects" && this.showProjects) {
|
if (this.activeTab != "projects" && this.showProjects) {
|
||||||
this.fetchProjects.searchUtils.status = this.errorCodes.LOADING;
|
this.fetchProjects.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
@ -503,6 +445,22 @@ export class SearchComponent {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private numOfSearchResults(resultType: string, fetchClass: FetchResearchResults, refineParams): Observable<any> {
|
||||||
|
return this._searchResearchResultsService.numOfSearchResults(resultType, this.keyword, this.properties, refineParams).subscribe(
|
||||||
|
data => {
|
||||||
|
fetchClass.searchUtils.totalResults = data;
|
||||||
|
fetchClass.searchUtils.status = this.errorCodes.DONE;
|
||||||
|
if (fetchClass.searchUtils.totalResults == 0) {
|
||||||
|
fetchClass.searchUtils.status = this.errorCodes.NONE;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
err => {
|
||||||
|
this.handleError("Error getting number of "+this.getEntityName(resultType, true, true), err);
|
||||||
|
fetchClass.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
private reloadTabs() {
|
private reloadTabs() {
|
||||||
this.reloadPublications = true;
|
this.reloadPublications = true;
|
||||||
this.reloadDatasets = true;
|
this.reloadDatasets = true;
|
||||||
|
@ -523,4 +481,16 @@ export class SearchComponent {
|
||||||
private handleError(message: string, error) {
|
private handleError(message: string, error) {
|
||||||
console.error("General Search Page: " + message, error);
|
console.error("General Search Page: " + message, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getEntityName (entityType:string, plural:boolean, full:boolean): string {
|
||||||
|
if(entityType == "publication") {
|
||||||
|
return "publication" + (plural ? "s" : "");
|
||||||
|
} else if(entityType == "dataset") {
|
||||||
|
return (full ? "research data" : ("dataset" + (plural ? "s" : "")));
|
||||||
|
} else if(entityType == "software") {
|
||||||
|
return "software";
|
||||||
|
} else if(entityType == "other") {
|
||||||
|
return (full ? ("other research product" + (plural ? "s" : "")) : "other");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue