2023-12-06 12:50:11 +01:00
|
|
|
import {SearchFieldsBase} from "src/app/openaireLibrary/utils/properties/searchFields.base";
|
2022-05-30 11:44:39 +02:00
|
|
|
|
2023-12-06 12:50:11 +01:00
|
|
|
export class SearchFields extends SearchFieldsBase {
|
2023-07-06 11:53:37 +02:00
|
|
|
|
|
|
|
public static getParameterOrder(fieldId: string, params): number {
|
2021-05-19 09:39:08 +02:00
|
|
|
let fields = [];
|
2023-07-06 11:53:37 +02:00
|
|
|
let searchFields = new SearchFields();
|
|
|
|
if (searchFields.RESULT_REFINE_FIELDS.indexOf(fieldId) != -1) {
|
|
|
|
fields = searchFields.RESULT_REFINE_FIELDS;
|
|
|
|
} else if (searchFields.PROJECT_REFINE_FIELDS.indexOf(fieldId) != -1) {
|
|
|
|
fields = searchFields.PROJECT_REFINE_FIELDS
|
|
|
|
} else if (searchFields.ORGANIZATION_REFINE_FIELDS.indexOf(fieldId) != -1) {
|
|
|
|
fields = searchFields.ORGANIZATION_REFINE_FIELDS;
|
|
|
|
} else if (searchFields.DATASOURCE_REFINE_FIELDS.indexOf(fieldId) != -1) {
|
|
|
|
fields = searchFields.DATASOURCE_REFINE_FIELDS;
|
2021-05-19 09:39:08 +02:00
|
|
|
}
|
|
|
|
let index = fields.indexOf(fieldId);
|
2023-07-06 11:53:37 +02:00
|
|
|
let paramIndex = 0;
|
|
|
|
if (index != -1) {
|
|
|
|
for (let keyValue of params) {
|
|
|
|
if (fields.indexOf(keyValue[0]) > index) {
|
2021-05-19 09:39:08 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
paramIndex++
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return paramIndex;
|
|
|
|
}
|
2020-06-05 14:56:28 +02:00
|
|
|
}
|
2022-04-08 15:54:45 +02:00
|
|
|
|
|
|
|
export enum OpenaireEntities {
|
2022-04-19 17:47:38 +02:00
|
|
|
RESULTS = "Research products",
|
2022-04-08 15:54:45 +02:00
|
|
|
PUBLICATIONS = "Publications",
|
|
|
|
DATASETS = "Research data",
|
2022-04-19 17:47:38 +02:00
|
|
|
SOFTWARE = "Research software",
|
2022-04-08 15:54:45 +02:00
|
|
|
OTHER = "Other research products",
|
|
|
|
PROJECTS = "Projects",
|
|
|
|
ORGANIZATIONS = "Organizations",
|
2022-05-18 11:31:46 +02:00
|
|
|
DATASOURCES = "Data sources",
|
2022-05-13 14:57:31 +02:00
|
|
|
SERVICES = "Services",
|
2022-05-03 13:22:53 +02:00
|
|
|
COMMUNITIES = "Research communities",
|
|
|
|
|
|
|
|
RESULT = "Research product",
|
|
|
|
PUBLICATION = "Publication",
|
|
|
|
DATASET = "Research data",
|
|
|
|
SOFTWARE_SINGULAR = "Research software",
|
|
|
|
OTHER_SINGULAR = "Other research product",
|
|
|
|
PROJECT = "Project",
|
|
|
|
ORGANIZATION = "Organization",
|
2022-05-18 11:31:46 +02:00
|
|
|
DATASOURCE = "Data source",
|
2022-05-13 14:57:31 +02:00
|
|
|
SERVICE = "Service",
|
2022-05-05 19:29:55 +02:00
|
|
|
COMMUNITY = "Research community",
|
|
|
|
|
|
|
|
RESULTS_FILE = "research-products",
|
|
|
|
PUBLICATIONS_FILE = "publications",
|
|
|
|
DATASETS_FILE = "research-data",
|
|
|
|
SOFTWARE_FILE = "research-software",
|
|
|
|
OTHER_FILE = "other-research-products",
|
|
|
|
PROJECTS_FILE = "projects",
|
|
|
|
ORGANIZATIONS_FILE = "organizations",
|
2022-05-18 11:31:46 +02:00
|
|
|
DATASOURCES_FILE = "data-sources",
|
2022-05-13 14:57:31 +02:00
|
|
|
SERVICES_FILE = "services",
|
2022-04-08 15:54:45 +02:00
|
|
|
}
|