complete previous commit for
clean up search dataproviders for doiRawValue
This commit is contained in:
parent
49dfdd6e1b
commit
514cd0dd12
|
@ -43,7 +43,6 @@ import {properties} from "../../../environments/environment";
|
||||||
[sort]="false" [showBreadcrumb]="showBreadcrumb" [basicMetaDescription]="metaDescription">
|
[sort]="false" [showBreadcrumb]="showBreadcrumb" [basicMetaDescription]="metaDescription">
|
||||||
|
|
||||||
</new-search-page>
|
</new-search-page>
|
||||||
<!-- [filters]="filters"-->
|
|
||||||
|
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
@ -140,13 +139,9 @@ export class SearchDataProvidersComponent {
|
||||||
this.searchPage.keywordFields = this.searchFields.DEPOSIT_DATASOURCE_KEYWORD_FIELDS;
|
this.searchPage.keywordFields = this.searchFields.DEPOSIT_DATASOURCE_KEYWORD_FIELDS;
|
||||||
this.searchPage.usedBy = "deposit";
|
this.searchPage.usedBy = "deposit";
|
||||||
}
|
}
|
||||||
// console.log(this.refineFields)
|
|
||||||
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, [], this.fieldIdsMap,this.customFilter,params, "dataprovider");
|
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, [], this.fieldIdsMap,this.customFilter,params, "dataprovider");
|
||||||
if(refine /*&& (this.type == "all" || this.type == "deposit")*/) {
|
if(refine) {
|
||||||
this._getFilters(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, 0, true, this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
|
this._getFilters(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, 0, true, this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
|
||||||
// } else if(refine) { // static filters
|
|
||||||
// this.searchUtils.refineStatus = this.errorCodes.LOADING;
|
|
||||||
// this.filters = DatasourcesHelperClass.createFilters(this.type);
|
|
||||||
} else {
|
} else {
|
||||||
this.searchUtils.refineStatus = this.errorCodes.DONE;
|
this.searchUtils.refineStatus = this.errorCodes.DONE;
|
||||||
}
|
}
|
||||||
|
@ -198,7 +193,6 @@ export class SearchDataProvidersComponent {
|
||||||
if (refine) {
|
if (refine) {
|
||||||
this.filters = this.searchPage.prepareFiltersToShow(filters, totalResults);
|
this.filters = this.searchPage.prepareFiltersToShow(filters, totalResults);
|
||||||
}
|
}
|
||||||
console.log(filters)
|
|
||||||
this.searchUtils.refineStatus = this.errorCodes.DONE;
|
this.searchUtils.refineStatus = this.errorCodes.DONE;
|
||||||
if(totalResults == 0) {
|
if(totalResults == 0) {
|
||||||
this.searchUtils.refineStatus = this.errorCodes.NONE;
|
this.searchUtils.refineStatus = this.errorCodes.NONE;
|
||||||
|
@ -232,35 +226,22 @@ console.log(filters)
|
||||||
size=0;
|
size=0;
|
||||||
}
|
}
|
||||||
if(page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) {
|
if(page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) {
|
||||||
// if(parameters!= null && parameters != '' ) {
|
|
||||||
// this.csvParams ="&fq=( "+this.resourcesQuery + "and (" + parameters + "))";
|
|
||||||
// }else{
|
|
||||||
// this.csvParams ="&fq="+this.resourcesQuery;
|
|
||||||
// }
|
|
||||||
// this.csvParams += (refineFieldsFilterQuery?refineFieldsFilterQuery:'');
|
|
||||||
|
|
||||||
this.csvParams = (parameters ? ("&fq=("+parameters) : "") + (parameters ? ")" : "");
|
this.csvParams = (parameters ? ("&fq=("+parameters) : "") + (parameters ? ")" : "");
|
||||||
this.csvParams += (refineFieldsFilterQuery ? refineFieldsFilterQuery : "");
|
this.csvParams += (refineFieldsFilterQuery ? refineFieldsFilterQuery : "");
|
||||||
|
|
||||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
|
||||||
this.searchUtils.status = this.errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
//this.searchPage.openLoading();
|
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.searchPageUpdates.emit({disableForms: this.disableForms, disableRefineForms: this.disableRefineForms, searchUtils: this.searchUtils});
|
this.searchPageUpdates.emit({disableForms: this.disableForms, disableRefineForms: this.disableRefineForms, searchUtils: this.searchUtils});
|
||||||
|
|
||||||
this.results = [];
|
this.results = [];
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
|
|
||||||
//console.info("Advanced Search for Content Providers: Execute search query "+parameters);
|
|
||||||
let datasourceQueryPrefix = DatasourcesHelperClass.getQueryPrefix(this.type);
|
let datasourceQueryPrefix = DatasourcesHelperClass.getQueryPrefix(this.type);
|
||||||
//this._searchDataProvidersService.advancedSearchDataproviders( datasourceQueryPrefix +(datasourceQueryPrefix.length > 0 && parameters.length > 0 ?' and (':'') + parameters +(datasourceQueryPrefix.length > 0 && parameters.length > 0 ?' ) ':''), page, size, this.properties, (refine && (this.type=="all" || this.type == "deposit")) ? this.searchPage.getRefineFieldsQuery() : null, this.searchPage.getFields(), refineFieldsFilterQuery, (this.type == "deposit")).subscribe(
|
|
||||||
this.searchResultsSub = this._searchDataProvidersService.advancedSearchDataproviders( datasourceQueryPrefix +(datasourceQueryPrefix.length > 0 && parameters.length > 0 ?' and (':'') + parameters +(datasourceQueryPrefix.length > 0 && parameters.length > 0 ?' ) ':''), page, size, this.properties, null, this.searchPage.getFields(), refineFieldsFilterQuery, (this.type == "deposit")).subscribe(
|
this.searchResultsSub = this._searchDataProvidersService.advancedSearchDataproviders( datasourceQueryPrefix +(datasourceQueryPrefix.length > 0 && parameters.length > 0 ?' and (':'') + parameters +(datasourceQueryPrefix.length > 0 && parameters.length > 0 ?' ) ':''), page, size, this.properties, null, this.searchPage.getFields(), refineFieldsFilterQuery, (this.type == "deposit")).subscribe(
|
||||||
data => {
|
data => {
|
||||||
let totalResults = data[0];
|
let totalResults = data[0];
|
||||||
let results = data[1];
|
let results = data[1];
|
||||||
/* if(refine && !(this.type == "all" || this.type == "deposit")){
|
|
||||||
this.filtersReturned(refine, this.filters, totalResults, page);
|
|
||||||
}*/
|
|
||||||
this.resultsReturned(refine, results, totalResults, page);
|
this.resultsReturned(refine, results, totalResults, page);
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
|
|
@ -157,13 +157,22 @@ export class Identifier {
|
||||||
var words: string[] = str.split(" ");
|
var words: string[] = str.split(" ");
|
||||||
|
|
||||||
for (var i = 0; i < words.length; i++) {
|
for (var i = 0; i < words.length; i++) {
|
||||||
if (DOI.isValidDOI(words[i]) && DOIs.indexOf(words[i]) == -1) {
|
let id = words[i];
|
||||||
DOIs.push(words[i]);
|
if (DOI.isValidDOI(id) ) {
|
||||||
|
id = Identifier.getRawDOIValue(id);
|
||||||
|
if( DOIs.indexOf(id) == -1){
|
||||||
|
DOIs.push(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return DOIs;
|
return DOIs;
|
||||||
}
|
}
|
||||||
|
public static getRawDOIValue(id: string): string {
|
||||||
|
if(id.indexOf("doi.org")!=-1 && id.split("doi.org/").length > 1){
|
||||||
|
id = id.split("doi.org/")[1];
|
||||||
|
}
|
||||||
|
return id;
|
||||||
|
}
|
||||||
public static getIdentifiersFromString(str: string): Identifier[] {
|
public static getIdentifiersFromString(str: string): Identifier[] {
|
||||||
let identifiers: Identifier[] = [];
|
let identifiers: Identifier[] = [];
|
||||||
let words: string[] = str.split(" ");
|
let words: string[] = str.split(" ");
|
||||||
|
@ -181,6 +190,7 @@ export class Identifier {
|
||||||
|
|
||||||
public static getIdentifierFromString(pid: string,strict:boolean = true): Identifier {
|
public static getIdentifierFromString(pid: string,strict:boolean = true): Identifier {
|
||||||
if (Identifier.isValidDOI(pid)) {
|
if (Identifier.isValidDOI(pid)) {
|
||||||
|
pid = Identifier.getRawDOIValue(pid);
|
||||||
return {"class": "doi", "id": pid};
|
return {"class": "doi", "id": pid};
|
||||||
} else if (Identifier.isValidORCID(pid)) {
|
} else if (Identifier.isValidORCID(pid)) {
|
||||||
return {"class": "ORCID", "id": pid};
|
return {"class": "ORCID", "id": pid};
|
||||||
|
|
Loading…
Reference in New Issue