From bb8f30fa3a7f68c8d7240612c6359faaeaadc3db Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Tue, 16 Jun 2020 17:22:48 +0300 Subject: [PATCH 01/26] Add OpenAIRE Organizations source for the ExternalUrls --- .../resources/externalUrls/ExternalUrls.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dmp-backend/web/src/main/resources/externalUrls/ExternalUrls.xml b/dmp-backend/web/src/main/resources/externalUrls/ExternalUrls.xml index 7236ef4b9..ccf0352b7 100644 --- a/dmp-backend/web/src/main/resources/externalUrls/ExternalUrls.xml +++ b/dmp-backend/web/src/main/resources/externalUrls/ExternalUrls.xml @@ -799,6 +799,24 @@ $['number_of_results'] + + openaire + + 1 + External + https://services.openaire.eu/search/v2/api/organizations/?q={like}&page={page}&size={pageSize}&format=json + 0 + application/json; charset=utf-8 + + $['results'][*]['result']['metadata']['oaf:entity']['oaf:organization'] + + 'originalId' + 'legalname' + 'count' + + + $['meta']['pagination']['page','pages','count'] + + + + {{ lang.name }} + + + + {{formGroup.get('language').getError('backendError').message}} + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.SECOND-STEP.FIELDS.HELP' | translate}}
diff --git a/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts b/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts index 4a6a00f82..716eb29b9 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard.component.ts @@ -18,6 +18,9 @@ import { TranslateService } from '@ngx-translate/core'; import { Observable, of as observableOf } from 'rxjs'; import { DmpEditorWizardModel } from './dmp-editor-wizard-model'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; +import { LanguageInfo } from '@app/core/model/language-info'; +import { LanguageService } from '@app/core/services/language/language.service'; +import { LanguageInfoService } from '@app/core/services/culture/language-info-service'; @Component({ @@ -47,7 +50,8 @@ export class DmpEditorWizardComponent extends BaseComponent implements OnInit, I private route: ActivatedRoute, private _service: DmpService, public language: TranslateService, - private formService: FormService + private formService: FormService, + private languageInfoService: LanguageInfoService ) { super(); } @@ -130,4 +134,8 @@ export class DmpEditorWizardComponent extends BaseComponent implements OnInit, I } return false; } + + getLanguageInfos(): LanguageInfo[] { + return this.languageInfoService.getLanguageInfoValues(); + } } From 1771ffa426c085368a0d53b3debd003a84c69643 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Thu, 18 Jun 2020 16:04:08 +0300 Subject: [PATCH 07/26] Add DMP language a placeholder on UI --- .../general-tab/general-tab.component.html | 2 +- dmp-frontend/src/assets/i18n/en.json | 3 +- dmp-frontend/src/assets/i18n/es.json | 23 ++++++++++-- dmp-frontend/src/assets/i18n/gr.json | 37 +++++++++++++++++-- 4 files changed, 55 insertions(+), 10 deletions(-) diff --git a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html index 943ed9ce5..b7a6386e2 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html @@ -69,7 +69,7 @@ - + {{ lang.name }} diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 088a11275..e73477672 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -706,7 +706,8 @@ "FUNDER": "Funder", "STATUS": "DMP Status", "EXTERNAL-SOURCE-HINT": "List of values provided by external source(s)", - "COLLABORATORS": "Collaborators" + "COLLABORATORS": "Collaborators", + "LANGUAGE": "Language" }, "ACTIONS": { "GO-TO-GRANT": "Go To DMP Grant", diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index c00b54876..eb1574916 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -706,7 +706,8 @@ "FUNDER": "Financiador", "STATUS": "Estado del PGD", "EXTERNAL-SOURCE-HINT": "Lista de valores proporcioador por fuente(s) externa(s)", - "COLLABORATORS": "Collaborators" + "COLLABORATORS": "Collaborators", + "LANGUAGE": "Language" }, "ACTIONS": { "GO-TO-GRANT": "Ir a las subvención del PGD", @@ -771,8 +772,9 @@ } }, "DATASET-PROFILE": { - "LIKE": "Buscar" - }, + "LIKE": "Buscar", + "STATUS": "Status" + }, "DATA-SETS": { "PERIOD-FROM": "Inicio", "PERIOD-TO": "Fin", @@ -932,7 +934,15 @@ "FREE-TEXT": "Texto libre", "RADIO-BOX": "Casilla", "TEXT-AREA": "Area de texto", - "DATE-PICKER": "Campo de entrada para fecha" + "DATE-PICKER": "Campo de entrada para fecha", + "EXTERNAL-DATASETS": "External Datasets", + "DATA-REPOSITORIES": "Data Repositories", + "REGISTRIES": "Registries", + "SERVICES": "Services", + "TAGS": "Tags", + "RESEARCHERS": "Researchers", + "ORGANIZATIONS": "Organizations", + "DATASET-IDENTIFIER": "Dataset Identifier" }, "DATASET-PROFILE-COMBO-BOX-TYPE": { "WORD-LIST": "Lista de palabras", @@ -1267,5 +1277,10 @@ } }, "HINT": "(Nombre sugerido por defecto)" + }, + "DATASET-PROFILE-STATUS": { + "NONE": "None", + "DRAFT": "Draft", + "FINALIZED": "Finalized" } } diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 29cdcf64b..6e1877f71 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -531,6 +531,10 @@ "ERROR": { "DELETED-DMP": "Το επιλεγμένο Σχέδιο Διαχείρισης Δεδομένων θα διαγραφεί", "FORBIDEN-DMP": "Δεν επιτρέπεται η πρόσβαση σε αυτό το Σχέδιο Διαχείρισης Δεδομένων" + }, + "MULTIPLE-DIALOG": { + "ZENODO-LOGIN": "Login with Zenodo", + "USE-DEFAULT": "Use Default Token" } }, "DATASET-LISTING": { @@ -702,7 +706,8 @@ "FUNDER": "Χορηγός", "STATUS": "Κατάσταση Σχεδίου Διαχείρισης Δεδομένων", "EXTERNAL-SOURCE-HINT": "Κατάλογος των τιμών που παρέχονται από εξωτερικές πηγές", - "COLLABORATORS": "Συνεργάτες" + "COLLABORATORS": "Συνεργάτες", + "LANGUAGE": "Language" }, "ACTIONS": { "GO-TO-GRANT": "Μεταβείτε στην Επιχορήγηση Σχεδίου Διαχείρισης Δεδομένων", @@ -767,7 +772,8 @@ } }, "DATASET-PROFILE": { - "LIKE": "Αναζήτηση" + "LIKE": "Αναζήτηση", + "STATUS": "Status" }, "DATA-SETS": { "PERIOD-FROM": "Έναρξη", @@ -831,7 +837,8 @@ "ACTIONS": { "SAVE": "Αποθήκευση", "CANCEL": "Ακύρωση", - "DELETE": "Διαγραφή" + "DELETE": "Διαγραφή", + "UPDATE": "Update" }, "VERSION-DIALOG": { "ABOUT": "Η δημιουργία νέας έκδοσης συμβαίνει αυτόματα", @@ -927,7 +934,15 @@ "FREE-TEXT": "Ελεύθερο Κείμενο", "RADIO-BOX": "Πλαίσιο Επιλογής", "TEXT-AREA": "Περιοχή Κειμένου", - "DATE-PICKER": "Επιλογή Ημερομηνίας" + "DATE-PICKER": "Επιλογή Ημερομηνίας", + "EXTERNAL-DATASETS": "External Datasets", + "DATA-REPOSITORIES": "Data Repositories", + "REGISTRIES": "Registries", + "SERVICES": "Services", + "TAGS": "Tags", + "RESEARCHERS": "Researchers", + "ORGANIZATIONS": "Organizations", + "DATASET-IDENTIFIER": "Dataset Identifier" }, "DATASET-PROFILE-COMBO-BOX-TYPE": { "WORD-LIST": "Λίστα Λέξεων", @@ -949,6 +964,14 @@ "TITLE": "Προσθήκη Ερευνητή", "FIRST_NAME": "Όνομα", "LAST_NAME": "Επώνυμο", + "ACTIONS": { + "SAVE": "Save", + "CANCEL": "Cancel" + } + }, + "ADDORGANIZATION-EDITOR": { + "TITLE": "Add an Organization", + "NAME": "Name", "ACTIONS": { "SAVE": "Αποθήκευση", "CANCEL": "Ακύρωση" @@ -1092,6 +1115,12 @@ "SHOW-ALL": "Προβολή Όλων", "CREATOR": "Συντάκτης", "MEMBER": "Μέλος" + }, + "ZENODO": { + "LOGIN": "Login to Zenodo", + "LOGOUT": "Remove Zenodo", + "TITLE": "Zenodo Account", + "DESCRIPTION": "Linked Zenodo Account:" } }, "DATASET-REFERENCED-MODELS": { From 791f2fee61704c59ef61fadc722c29ba81653a39 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Thu, 25 Jun 2020 13:00:29 +0300 Subject: [PATCH 08/26] Add currency field type for dataset templates --- .../java/eu/eudat/cache/ResponsesCache.java | 1 + .../eudat/controllers/CurrencyController.java | 31 + .../logic/managers/LocalFetchManager.java | 28 + .../logic/proxy/fetching/LocalFetcher.java | 99 + .../logic/proxy/fetching/entities/Config.java | 21 + .../proxy/fetching/entities/ConfigSingle.java | 71 + .../fetching/entities/CurrencyModel.java | 21 + .../entities/CurrencySingleModel.java | 53 + .../utilities/builders/ModelBuilder.java | 2 + .../commons/datafield/CurrencyData.java | 42 + .../models/data/local/LocalFetchModel.java | 27 + .../main/resources/internal/fetchConfig.xml | 13 + .../src/main/resources/internal/iso-4217.xml | 1949 +++++++++++++++++ .../enum/dataset-profile-field-view-style.ts | 3 +- .../src/app/core/core-service.module.ts | 2 + .../field-data/field-data.ts | 4 + .../model/local-fetch/local-fetch.model.ts | 4 + .../services/currency/currency.service.ts | 21 + .../currency/currency.service.ts | 19 + .../services/utilities/enum-utils.service.ts | 1 + .../field-data/currency-data-editor-models.ts | 19 + .../admin/field-editor-model.ts | 2 + .../dataset-profile/dataset-profile.module.ts | 4 +- ...ofile-editor-currency-field.component.html | 9 + ...ofile-editor-currency-field.component.scss | 3 + ...profile-editor-currency-field.component.ts | 18 + ...ataset-profile-editor-field.component.html | 2 + .../dataset-profile-editor-field.component.ts | 5 + .../form-field/form-field.component.html | 12 + .../form-field/form-field.component.ts | 19 +- dmp-frontend/src/assets/i18n/en.json | 3 +- dmp-frontend/src/assets/i18n/es.json | 3 +- dmp-frontend/src/assets/i18n/gr.json | 5 +- 33 files changed, 2509 insertions(+), 7 deletions(-) create mode 100644 dmp-backend/web/src/main/java/eu/eudat/controllers/CurrencyController.java create mode 100644 dmp-backend/web/src/main/java/eu/eudat/logic/managers/LocalFetchManager.java create mode 100644 dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/LocalFetcher.java create mode 100644 dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/Config.java create mode 100644 dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/ConfigSingle.java create mode 100644 dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencyModel.java create mode 100644 dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencySingleModel.java create mode 100644 dmp-backend/web/src/main/java/eu/eudat/models/data/components/commons/datafield/CurrencyData.java create mode 100644 dmp-backend/web/src/main/java/eu/eudat/models/data/local/LocalFetchModel.java create mode 100644 dmp-backend/web/src/main/resources/internal/fetchConfig.xml create mode 100644 dmp-backend/web/src/main/resources/internal/iso-4217.xml create mode 100644 dmp-frontend/src/app/core/model/local-fetch/local-fetch.model.ts create mode 100644 dmp-frontend/src/app/core/services/currency/currency.service.ts create mode 100644 dmp-frontend/src/app/core/services/external-sources/currency/currency.service.ts create mode 100644 dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/currency-data-editor-models.ts create mode 100644 dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.html create mode 100644 dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.scss create mode 100644 dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.ts diff --git a/dmp-backend/web/src/main/java/eu/eudat/cache/ResponsesCache.java b/dmp-backend/web/src/main/java/eu/eudat/cache/ResponsesCache.java index c87d616ab..4a5858bde 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/cache/ResponsesCache.java +++ b/dmp-backend/web/src/main/java/eu/eudat/cache/ResponsesCache.java @@ -40,6 +40,7 @@ public class ResponsesCache { caches.add(new GuavaCache("tags", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build())); caches.add(new GuavaCache("researchers", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build())); caches.add(new GuavaCache("externalDatasets", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build())); + caches.add(new GuavaCache("currencies", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build())); simpleCacheManager.setCaches(caches); logger.info("OK"); return simpleCacheManager; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/CurrencyController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/CurrencyController.java new file mode 100644 index 000000000..e562eadfb --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/CurrencyController.java @@ -0,0 +1,31 @@ +package eu.eudat.controllers; + +import eu.eudat.logic.managers.LocalFetchManager; +import eu.eudat.models.data.helpers.responses.ResponseItem; +import eu.eudat.models.data.local.LocalFetchModel; +import eu.eudat.types.ApiMessageCode; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@CrossOrigin +@RequestMapping(value = "api/currency") +public class CurrencyController { + + private LocalFetchManager localFetchManager; + + @Autowired + public CurrencyController(LocalFetchManager localFetchManager) { + this.localFetchManager = localFetchManager; + } + + @RequestMapping(method = RequestMethod.GET) + public ResponseEntity>> getCurrencies( @RequestParam(value = "query", required = false) String query) throws Exception { + List currencies = localFetchManager.getCurrency(query); + return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem>().status(ApiMessageCode.NO_MESSAGE).payload(currencies)); + } +} diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/LocalFetchManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/LocalFetchManager.java new file mode 100644 index 000000000..fa135debe --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/LocalFetchManager.java @@ -0,0 +1,28 @@ +package eu.eudat.logic.managers; + +import eu.eudat.logic.proxy.fetching.LocalFetcher; +import eu.eudat.logic.utilities.helpers.StreamDistinctBy; +import eu.eudat.models.data.local.LocalFetchModel; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Component +public class LocalFetchManager { + private LocalFetcher localFetcher; + + @Autowired + public LocalFetchManager(LocalFetcher localFetcher) { + this.localFetcher = localFetcher; + } + + public List getCurrency(String query) throws Exception { + List> data = localFetcher.retrieveCurrency(); + List result = data.stream().map(entry -> new LocalFetchModel(entry.get("name"), entry.get("value"))).collect(Collectors.toList()); + result = result.stream().filter(localFetchModel -> localFetchModel.getValue() != null).filter(StreamDistinctBy.distinctByKey(LocalFetchModel::getValue)).filter(localFetchModel -> localFetchModel.getName().contains(query)).collect(Collectors.toList()); + return result; + } +} diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/LocalFetcher.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/LocalFetcher.java new file mode 100644 index 000000000..5562f1f89 --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/LocalFetcher.java @@ -0,0 +1,99 @@ +package eu.eudat.logic.proxy.fetching; + +import com.fasterxml.jackson.databind.ObjectMapper; +import eu.eudat.logic.proxy.fetching.entities.Config; +import eu.eudat.logic.proxy.fetching.entities.ConfigSingle; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Component; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Unmarshaller; +import java.beans.PropertyDescriptor; +import java.io.InputStream; +import java.lang.reflect.Method; +import java.util.*; + +@Component +public class LocalFetcher { + + @Cacheable("currencies") + public List> retrieveCurrency() throws Exception { + InputStream is = getClass().getClassLoader().getResource("internal/fetchConfig.xml").openStream(); + JAXBContext context = JAXBContext.newInstance(Config.class); + Unmarshaller unmarshaller = context.createUnmarshaller(); + Config config = (Config) unmarshaller.unmarshal(is); + ConfigSingle currencyConfig = config.getConfigs().stream().filter(configSingle -> configSingle.getType().equals("currency")).findFirst().get(); + + return retrieveData(currencyConfig); + } + + public List> retrieveData(ConfigSingle configSingle) throws Exception { + List> result = new ArrayList<>(); + InputStream is = getClass().getClassLoader().getResource(configSingle.getFilePath()).openStream(); + FileType type = FileType.fromName(configSingle.getFileType()); + switch(type) { + case XML: + { + Class aClass = Class.forName(configSingle.getParseClass()); + JAXBContext context = JAXBContext.newInstance(aClass); + Unmarshaller unmarshaller = context.createUnmarshaller(); + + Object object = unmarshaller.unmarshal(is); + + Method reader = null; + if (configSingle.getParseField() != null && !configSingle.getParseField().isEmpty()) { + reader = new PropertyDescriptor(configSingle.getParseField(), aClass).getReadMethod(); + } + ObjectMapper objectMapper = new ObjectMapper(); + List> values = new ArrayList<>(); + int max = 1; + if (reader != null) { + Object invokedField = reader.invoke(object); + if (invokedField instanceof Collection) { + max = ((Collection) invokedField).size(); + } + } + for (int i = 0; i< max; i++) { + Object value; + if (reader != null) { + Object invokedField = reader.invoke(object); + if (invokedField instanceof Collection) { + value = ((Collection) invokedField).toArray()[i]; + } else { + value = invokedField; + } + } else { + value = object; + } + Map map = objectMapper.convertValue(value, Map.class); + result.add(new HashMap<>()); + result.get(result.size() - 1).put("name", map.get(configSingle.getName())); + result.get(result.size() - 1).put("value", map.get(configSingle.getValue())); + } + } + } + return result; + } + + public enum FileType { + XML("xml"), JSON("json"); + private String name; + + FileType(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public static FileType fromName(String name) { + for (FileType type: FileType.values()) { + if (name.equals(type.getName())) { + return type; + } + } + throw new NoSuchElementException("File Type [" + name + "] is not supported"); + } + } +} diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/Config.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/Config.java new file mode 100644 index 000000000..1f9e8494d --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/Config.java @@ -0,0 +1,21 @@ +package eu.eudat.logic.proxy.fetching.entities; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; +import java.util.List; + +@XmlRootElement(name = "fetchConfig") +public class Config { + private List configs; + + @XmlElementWrapper + @XmlElement(name = "config") + public List getConfigs() { + return configs; + } + public void setConfigs(List configs) { + this.configs = configs; + } + +} diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/ConfigSingle.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/ConfigSingle.java new file mode 100644 index 000000000..022cfec23 --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/ConfigSingle.java @@ -0,0 +1,71 @@ +package eu.eudat.logic.proxy.fetching.entities; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "config") +public class ConfigSingle { + private String type; + private String fileType; + private String filePath; + private String parseClass; + private String parseField; + private String name; + private String value; + + @XmlElement(name = "type") + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + @XmlElement(name = "fileType") + public String getFileType() { + return fileType; + } + public void setFileType(String fileType) { + this.fileType = fileType; + } + + @XmlElement(name = "filePath") + public String getFilePath() { + return filePath; + } + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + @XmlElement(name = "parseClass") + public String getParseClass() { + return parseClass; + } + public void setParseClass(String parseClass) { + this.parseClass = parseClass; + } + + @XmlElement(name = "parseField") + public String getParseField() { + return parseField; + } + public void setParseField(String parseField) { + this.parseField = parseField; + } + + @XmlElement(name = "name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + @XmlElement(name = "value") + public String getValue() { + return value; + } + public void setValue(String value) { + this.value = value; + } +} diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencyModel.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencyModel.java new file mode 100644 index 000000000..af8c02d8b --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencyModel.java @@ -0,0 +1,21 @@ +package eu.eudat.logic.proxy.fetching.entities; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; +import java.util.List; + +@XmlRootElement(name = "ISO_4217") +public class CurrencyModel { + private List currencies; + + @XmlElementWrapper(name = "CcyTbl") + @XmlElement(name = "CcyNtry") + public List getCurrencies() { + return currencies; + } + public void setCurrencies(List currencies) { + this.currencies = currencies; + } + +} diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencySingleModel.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencySingleModel.java new file mode 100644 index 000000000..2259c902c --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/entities/CurrencySingleModel.java @@ -0,0 +1,53 @@ +package eu.eudat.logic.proxy.fetching.entities; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "CcyNtry") +public class CurrencySingleModel { + private String country; + private String currency; + private String code; + private Integer numericCode; + private Integer unit; + + @XmlElement(name = "CtryNm") + public String getCountry() { + return country; + } + public void setCountry(String country) { + this.country = country; + } + + @XmlElement(name = "CcyNm") + public String getCurrency() { + return currency; + } + public void setCurrency(String currency) { + this.currency = currency; + } + + @XmlElement(name = "Ccy") + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + @XmlElement(name = "CcyNbr") + public Integer getNumericCode() { + return numericCode; + } + public void setNumericCode(Integer numericCode) { + this.numericCode = numericCode; + } + + @XmlElement(name = "CcyMnrUnts") + public Integer getUnit() { + return unit; + } + public void setUnit(Integer unit) { + this.unit = unit; + } +} diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/builders/ModelBuilder.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/builders/ModelBuilder.java index fe0ede1e3..5b8bea223 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/builders/ModelBuilder.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/builders/ModelBuilder.java @@ -93,6 +93,7 @@ public class ModelBuilder { if (type.equals("researchers")) return (FieldData) new ResearcherData().fromData(data); if (type.equals("organizations")) return (FieldData) new OrganizationsData().fromData(data); if (type.equals("datasetIdentifier")) return (FieldData) new DatasetIdentifierData().fromData(data); + if (type.equals("currency")) return (FieldData) new CurrencyData().fromData(data); return null; } @@ -130,6 +131,7 @@ public class ModelBuilder { if (type.equals("researchers")) return (FieldData) new ResearcherData().fromData(data); if (type.equals("organizations")) return (FieldData) new OrganizationsData().fromData(data); if (type.equals("datasetIdentifier")) return (FieldData) new DatasetIdentifierData().fromData(data); + if (type.equals("currency")) return (FieldData) new CurrencyData().fromData(data); return null; } } diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/components/commons/datafield/CurrencyData.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/components/commons/datafield/CurrencyData.java new file mode 100644 index 000000000..2bf7ca475 --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/components/commons/datafield/CurrencyData.java @@ -0,0 +1,42 @@ +package eu.eudat.models.data.components.commons.datafield; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import java.util.HashMap; +import java.util.Map; + +public class CurrencyData extends FieldData { + @Override + public CurrencyData fromData(Object data) { + if (data != null) { + this.setLabel((String) ((Map) data).get("label")); + } + return this; + } + + @Override + public Object toData() { + return null; + } + + @Override + public Element toXml(Document doc) { + Element root = doc.createElement("data"); + root.setAttribute("label", this.getLabel()); + return root; + } + + @Override + public CurrencyData fromXml(Element item) { + this.setLabel(item != null ? item.getAttribute("label") : ""); + return this; + } + + @Override + public Map toMap(Element item) { + HashMap dataMap = new HashMap(); + dataMap.put("label", item != null ? item.getAttribute("label") : ""); + return dataMap; + } +} diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/local/LocalFetchModel.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/local/LocalFetchModel.java new file mode 100644 index 000000000..279971632 --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/local/LocalFetchModel.java @@ -0,0 +1,27 @@ +package eu.eudat.models.data.local; + +public class LocalFetchModel { + private String name; + private String value; + + public LocalFetchModel(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/dmp-backend/web/src/main/resources/internal/fetchConfig.xml b/dmp-backend/web/src/main/resources/internal/fetchConfig.xml new file mode 100644 index 000000000..523058553 --- /dev/null +++ b/dmp-backend/web/src/main/resources/internal/fetchConfig.xml @@ -0,0 +1,13 @@ + + + + currency + xml + internal/iso-4217.xml + eu.eudat.logic.proxy.fetching.entities.CurrencyModel + currencies + currency + code + + + \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/internal/iso-4217.xml b/dmp-backend/web/src/main/resources/internal/iso-4217.xml new file mode 100644 index 000000000..5ba6f6bfb --- /dev/null +++ b/dmp-backend/web/src/main/resources/internal/iso-4217.xml @@ -0,0 +1,1949 @@ + + + + + AFGHANISTAN + Afghani + AFN + 971 + 2 + + + ÅLAND ISLANDS + Euro + EUR + 978 + 2 + + + ALBANIA + Lek + ALL + 008 + 2 + + + ALGERIA + Algerian Dinar + DZD + 012 + 2 + + + AMERICAN SAMOA + US Dollar + USD + 840 + 2 + + + ANDORRA + Euro + EUR + 978 + 2 + + + ANGOLA + Kwanza + AOA + 973 + 2 + + + ANGUILLA + East Caribbean Dollar + XCD + 951 + 2 + + + ANTARCTICA + No universal currency + + + ANTIGUA AND BARBUDA + East Caribbean Dollar + XCD + 951 + 2 + + + ARGENTINA + Argentine Peso + ARS + 032 + 2 + + + ARMENIA + Armenian Dram + AMD + 051 + 2 + + + ARUBA + Aruban Florin + AWG + 533 + 2 + + + AUSTRALIA + Australian Dollar + AUD + 036 + 2 + + + AUSTRIA + Euro + EUR + 978 + 2 + + + AZERBAIJAN + Azerbaijan Manat + AZN + 944 + 2 + + + BAHAMAS (THE) + Bahamian Dollar + BSD + 044 + 2 + + + BAHRAIN + Bahraini Dinar + BHD + 048 + 3 + + + BANGLADESH + Taka + BDT + 050 + 2 + + + BARBADOS + Barbados Dollar + BBD + 052 + 2 + + + BELARUS + Belarusian Ruble + BYN + 933 + 2 + + + BELGIUM + Euro + EUR + 978 + 2 + + + BELIZE + Belize Dollar + BZD + 084 + 2 + + + BENIN + CFA Franc BCEAO + XOF + 952 + 0 + + + BERMUDA + Bermudian Dollar + BMD + 060 + 2 + + + BHUTAN + Indian Rupee + INR + 356 + 2 + + + BHUTAN + Ngultrum + BTN + 064 + 2 + + + BOLIVIA (PLURINATIONAL STATE OF) + Boliviano + BOB + 068 + 2 + + + BOLIVIA (PLURINATIONAL STATE OF) + Mvdol + BOV + 984 + 2 + + + BONAIRE, SINT EUSTATIUS AND SABA + US Dollar + USD + 840 + 2 + + + BOSNIA AND HERZEGOVINA + Convertible Mark + BAM + 977 + 2 + + + BOTSWANA + Pula + BWP + 072 + 2 + + + BOUVET ISLAND + Norwegian Krone + NOK + 578 + 2 + + + BRAZIL + Brazilian Real + BRL + 986 + 2 + + + BRITISH INDIAN OCEAN TERRITORY (THE) + US Dollar + USD + 840 + 2 + + + BRUNEI DARUSSALAM + Brunei Dollar + BND + 096 + 2 + + + BULGARIA + Bulgarian Lev + BGN + 975 + 2 + + + BURKINA FASO + CFA Franc BCEAO + XOF + 952 + 0 + + + BURUNDI + Burundi Franc + BIF + 108 + 0 + + + CABO VERDE + Cabo Verde Escudo + CVE + 132 + 2 + + + CAMBODIA + Riel + KHR + 116 + 2 + + + CAMEROON + CFA Franc BEAC + XAF + 950 + 0 + + + CANADA + Canadian Dollar + CAD + 124 + 2 + + + CAYMAN ISLANDS (THE) + Cayman Islands Dollar + KYD + 136 + 2 + + + CENTRAL AFRICAN REPUBLIC (THE) + CFA Franc BEAC + XAF + 950 + 0 + + + CHAD + CFA Franc BEAC + XAF + 950 + 0 + + + CHILE + Chilean Peso + CLP + 152 + 0 + + + CHILE + Unidad de Fomento + CLF + 990 + 4 + + + CHINA + Yuan Renminbi + CNY + 156 + 2 + + + CHRISTMAS ISLAND + Australian Dollar + AUD + 036 + 2 + + + COCOS (KEELING) ISLANDS (THE) + Australian Dollar + AUD + 036 + 2 + + + COLOMBIA + Colombian Peso + COP + 170 + 2 + + + COLOMBIA + Unidad de Valor Real + COU + 970 + 2 + + + COMOROS (THE) + Comorian Franc + KMF + 174 + 0 + + + CONGO (THE DEMOCRATIC REPUBLIC OF THE) + Congolese Franc + CDF + 976 + 2 + + + CONGO (THE) + CFA Franc BEAC + XAF + 950 + 0 + + + COOK ISLANDS (THE) + New Zealand Dollar + NZD + 554 + 2 + + + COSTA RICA + Costa Rican Colon + CRC + 188 + 2 + + + CÔTE D'IVOIRE + CFA Franc BCEAO + XOF + 952 + 0 + + + CROATIA + Kuna + HRK + 191 + 2 + + + CUBA + Cuban Peso + CUP + 192 + 2 + + + CUBA + Peso Convertible + CUC + 931 + 2 + + + CURAÇAO + Netherlands Antillean Guilder + ANG + 532 + 2 + + + CYPRUS + Euro + EUR + 978 + 2 + + + CZECHIA + Czech Koruna + CZK + 203 + 2 + + + DENMARK + Danish Krone + DKK + 208 + 2 + + + DJIBOUTI + Djibouti Franc + DJF + 262 + 0 + + + DOMINICA + East Caribbean Dollar + XCD + 951 + 2 + + + DOMINICAN REPUBLIC (THE) + Dominican Peso + DOP + 214 + 2 + + + ECUADOR + US Dollar + USD + 840 + 2 + + + EGYPT + Egyptian Pound + EGP + 818 + 2 + + + EL SALVADOR + El Salvador Colon + SVC + 222 + 2 + + + EL SALVADOR + US Dollar + USD + 840 + 2 + + + EQUATORIAL GUINEA + CFA Franc BEAC + XAF + 950 + 0 + + + ERITREA + Nakfa + ERN + 232 + 2 + + + ESTONIA + Euro + EUR + 978 + 2 + + + ESWATINI + Lilangeni + SZL + 748 + 2 + + + ETHIOPIA + Ethiopian Birr + ETB + 230 + 2 + + + EUROPEAN UNION + Euro + EUR + 978 + 2 + + + FALKLAND ISLANDS (THE) [MALVINAS] + Falkland Islands Pound + FKP + 238 + 2 + + + FAROE ISLANDS (THE) + Danish Krone + DKK + 208 + 2 + + + FIJI + Fiji Dollar + FJD + 242 + 2 + + + FINLAND + Euro + EUR + 978 + 2 + + + FRANCE + Euro + EUR + 978 + 2 + + + FRENCH GUIANA + Euro + EUR + 978 + 2 + + + FRENCH POLYNESIA + CFP Franc + XPF + 953 + 0 + + + FRENCH SOUTHERN TERRITORIES (THE) + Euro + EUR + 978 + 2 + + + GABON + CFA Franc BEAC + XAF + 950 + 0 + + + GAMBIA (THE) + Dalasi + GMD + 270 + 2 + + + GEORGIA + Lari + GEL + 981 + 2 + + + GERMANY + Euro + EUR + 978 + 2 + + + GHANA + Ghana Cedi + GHS + 936 + 2 + + + GIBRALTAR + Gibraltar Pound + GIP + 292 + 2 + + + GREECE + Euro + EUR + 978 + 2 + + + GREENLAND + Danish Krone + DKK + 208 + 2 + + + GRENADA + East Caribbean Dollar + XCD + 951 + 2 + + + GUADELOUPE + Euro + EUR + 978 + 2 + + + GUAM + US Dollar + USD + 840 + 2 + + + GUATEMALA + Quetzal + GTQ + 320 + 2 + + + GUERNSEY + Pound Sterling + GBP + 826 + 2 + + + GUINEA + Guinean Franc + GNF + 324 + 0 + + + GUINEA-BISSAU + CFA Franc BCEAO + XOF + 952 + 0 + + + GUYANA + Guyana Dollar + GYD + 328 + 2 + + + HAITI + Gourde + HTG + 332 + 2 + + + HAITI + US Dollar + USD + 840 + 2 + + + HEARD ISLAND AND McDONALD ISLANDS + Australian Dollar + AUD + 036 + 2 + + + HOLY SEE (THE) + Euro + EUR + 978 + 2 + + + HONDURAS + Lempira + HNL + 340 + 2 + + + HONG KONG + Hong Kong Dollar + HKD + 344 + 2 + + + HUNGARY + Forint + HUF + 348 + 2 + + + ICELAND + Iceland Krona + ISK + 352 + 0 + + + INDIA + Indian Rupee + INR + 356 + 2 + + + INDONESIA + Rupiah + IDR + 360 + 2 + + + INTERNATIONAL MONETARY FUND (IMF)  + SDR (Special Drawing Right) + XDR + 960 + N.A. + + + IRAN (ISLAMIC REPUBLIC OF) + Iranian Rial + IRR + 364 + 2 + + + IRAQ + Iraqi Dinar + IQD + 368 + 3 + + + IRELAND + Euro + EUR + 978 + 2 + + + ISLE OF MAN + Pound Sterling + GBP + 826 + 2 + + + ISRAEL + New Israeli Sheqel + ILS + 376 + 2 + + + ITALY + Euro + EUR + 978 + 2 + + + JAMAICA + Jamaican Dollar + JMD + 388 + 2 + + + JAPAN + Yen + JPY + 392 + 0 + + + JERSEY + Pound Sterling + GBP + 826 + 2 + + + JORDAN + Jordanian Dinar + JOD + 400 + 3 + + + KAZAKHSTAN + Tenge + KZT + 398 + 2 + + + KENYA + Kenyan Shilling + KES + 404 + 2 + + + KIRIBATI + Australian Dollar + AUD + 036 + 2 + + + KOREA (THE DEMOCRATIC PEOPLE’S REPUBLIC OF) + North Korean Won + KPW + 408 + 2 + + + KOREA (THE REPUBLIC OF) + Won + KRW + 410 + 0 + + + KUWAIT + Kuwaiti Dinar + KWD + 414 + 3 + + + KYRGYZSTAN + Som + KGS + 417 + 2 + + + LAO PEOPLE’S DEMOCRATIC REPUBLIC (THE) + Lao Kip + LAK + 418 + 2 + + + LATVIA + Euro + EUR + 978 + 2 + + + LEBANON + Lebanese Pound + LBP + 422 + 2 + + + LESOTHO + Loti + LSL + 426 + 2 + + + LESOTHO + Rand + ZAR + 710 + 2 + + + LIBERIA + Liberian Dollar + LRD + 430 + 2 + + + LIBYA + Libyan Dinar + LYD + 434 + 3 + + + LIECHTENSTEIN + Swiss Franc + CHF + 756 + 2 + + + LITHUANIA + Euro + EUR + 978 + 2 + + + LUXEMBOURG + Euro + EUR + 978 + 2 + + + MACAO + Pataca + MOP + 446 + 2 + + + MACEDONIA (THE FORMER YUGOSLAV REPUBLIC OF) + Denar + MKD + 807 + 2 + + + MADAGASCAR + Malagasy Ariary + MGA + 969 + 2 + + + MALAWI + Malawi Kwacha + MWK + 454 + 2 + + + MALAYSIA + Malaysian Ringgit + MYR + 458 + 2 + + + MALDIVES + Rufiyaa + MVR + 462 + 2 + + + MALI + CFA Franc BCEAO + XOF + 952 + 0 + + + MALTA + Euro + EUR + 978 + 2 + + + MARSHALL ISLANDS (THE) + US Dollar + USD + 840 + 2 + + + MARTINIQUE + Euro + EUR + 978 + 2 + + + MAURITANIA + Ouguiya + MRU + 929 + 2 + + + MAURITIUS + Mauritius Rupee + MUR + 480 + 2 + + + MAYOTTE + Euro + EUR + 978 + 2 + + + MEMBER COUNTRIES OF THE AFRICAN DEVELOPMENT BANK GROUP + ADB Unit of Account + XUA + 965 + N.A. + + + MEXICO + Mexican Peso + MXN + 484 + 2 + + + MEXICO + Mexican Unidad de Inversion (UDI) + MXV + 979 + 2 + + + MICRONESIA (FEDERATED STATES OF) + US Dollar + USD + 840 + 2 + + + MOLDOVA (THE REPUBLIC OF) + Moldovan Leu + MDL + 498 + 2 + + + MONACO + Euro + EUR + 978 + 2 + + + MONGOLIA + Tugrik + MNT + 496 + 2 + + + MONTENEGRO + Euro + EUR + 978 + 2 + + + MONTSERRAT + East Caribbean Dollar + XCD + 951 + 2 + + + MOROCCO + Moroccan Dirham + MAD + 504 + 2 + + + MOZAMBIQUE + Mozambique Metical + MZN + 943 + 2 + + + MYANMAR + Kyat + MMK + 104 + 2 + + + NAMIBIA + Namibia Dollar + NAD + 516 + 2 + + + NAMIBIA + Rand + ZAR + 710 + 2 + + + NAURU + Australian Dollar + AUD + 036 + 2 + + + NEPAL + Nepalese Rupee + NPR + 524 + 2 + + + NETHERLANDS (THE) + Euro + EUR + 978 + 2 + + + NEW CALEDONIA + CFP Franc + XPF + 953 + 0 + + + NEW ZEALAND + New Zealand Dollar + NZD + 554 + 2 + + + NICARAGUA + Cordoba Oro + NIO + 558 + 2 + + + NIGER (THE) + CFA Franc BCEAO + XOF + 952 + 0 + + + NIGERIA + Naira + NGN + 566 + 2 + + + NIUE + New Zealand Dollar + NZD + 554 + 2 + + + NORFOLK ISLAND + Australian Dollar + AUD + 036 + 2 + + + NORTHERN MARIANA ISLANDS (THE) + US Dollar + USD + 840 + 2 + + + NORWAY + Norwegian Krone + NOK + 578 + 2 + + + OMAN + Rial Omani + OMR + 512 + 3 + + + PAKISTAN + Pakistan Rupee + PKR + 586 + 2 + + + PALAU + US Dollar + USD + 840 + 2 + + + PALESTINE, STATE OF + No universal currency + + + PANAMA + Balboa + PAB + 590 + 2 + + + PANAMA + US Dollar + USD + 840 + 2 + + + PAPUA NEW GUINEA + Kina + PGK + 598 + 2 + + + PARAGUAY + Guarani + PYG + 600 + 0 + + + PERU + Sol + PEN + 604 + 2 + + + PHILIPPINES (THE) + Philippine Peso + PHP + 608 + 2 + + + PITCAIRN + New Zealand Dollar + NZD + 554 + 2 + + + POLAND + Zloty + PLN + 985 + 2 + + + PORTUGAL + Euro + EUR + 978 + 2 + + + PUERTO RICO + US Dollar + USD + 840 + 2 + + + QATAR + Qatari Rial + QAR + 634 + 2 + + + RÉUNION + Euro + EUR + 978 + 2 + + + ROMANIA + Romanian Leu + RON + 946 + 2 + + + RUSSIAN FEDERATION (THE) + Russian Ruble + RUB + 643 + 2 + + + RWANDA + Rwanda Franc + RWF + 646 + 0 + + + SAINT BARTHÉLEMY + Euro + EUR + 978 + 2 + + + SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA + Saint Helena Pound + SHP + 654 + 2 + + + SAINT KITTS AND NEVIS + East Caribbean Dollar + XCD + 951 + 2 + + + SAINT LUCIA + East Caribbean Dollar + XCD + 951 + 2 + + + SAINT MARTIN (FRENCH PART) + Euro + EUR + 978 + 2 + + + SAINT PIERRE AND MIQUELON + Euro + EUR + 978 + 2 + + + SAINT VINCENT AND THE GRENADINES + East Caribbean Dollar + XCD + 951 + 2 + + + SAMOA + Tala + WST + 882 + 2 + + + SAN MARINO + Euro + EUR + 978 + 2 + + + SAO TOME AND PRINCIPE + Dobra + STN + 930 + 2 + + + SAUDI ARABIA + Saudi Riyal + SAR + 682 + 2 + + + SENEGAL + CFA Franc BCEAO + XOF + 952 + 0 + + + SERBIA + Serbian Dinar + RSD + 941 + 2 + + + SEYCHELLES + Seychelles Rupee + SCR + 690 + 2 + + + SIERRA LEONE + Leone + SLL + 694 + 2 + + + SINGAPORE + Singapore Dollar + SGD + 702 + 2 + + + SINT MAARTEN (DUTCH PART) + Netherlands Antillean Guilder + ANG + 532 + 2 + + + SISTEMA UNITARIO DE COMPENSACION REGIONAL DE PAGOS "SUCRE" + Sucre + XSU + 994 + N.A. + + + SLOVAKIA + Euro + EUR + 978 + 2 + + + SLOVENIA + Euro + EUR + 978 + 2 + + + SOLOMON ISLANDS + Solomon Islands Dollar + SBD + 090 + 2 + + + SOMALIA + Somali Shilling + SOS + 706 + 2 + + + SOUTH AFRICA + Rand + ZAR + 710 + 2 + + + SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS + No universal currency + + + SOUTH SUDAN + South Sudanese Pound + SSP + 728 + 2 + + + SPAIN + Euro + EUR + 978 + 2 + + + SRI LANKA + Sri Lanka Rupee + LKR + 144 + 2 + + + SUDAN (THE) + Sudanese Pound + SDG + 938 + 2 + + + SURINAME + Surinam Dollar + SRD + 968 + 2 + + + SVALBARD AND JAN MAYEN + Norwegian Krone + NOK + 578 + 2 + + + SWEDEN + Swedish Krona + SEK + 752 + 2 + + + SWITZERLAND + Swiss Franc + CHF + 756 + 2 + + + SWITZERLAND + WIR Euro + CHE + 947 + 2 + + + SWITZERLAND + WIR Franc + CHW + 948 + 2 + + + SYRIAN ARAB REPUBLIC + Syrian Pound + SYP + 760 + 2 + + + TAIWAN (PROVINCE OF CHINA) + New Taiwan Dollar + TWD + 901 + 2 + + + TAJIKISTAN + Somoni + TJS + 972 + 2 + + + TANZANIA, UNITED REPUBLIC OF + Tanzanian Shilling + TZS + 834 + 2 + + + THAILAND + Baht + THB + 764 + 2 + + + TIMOR-LESTE + US Dollar + USD + 840 + 2 + + + TOGO + CFA Franc BCEAO + XOF + 952 + 0 + + + TOKELAU + New Zealand Dollar + NZD + 554 + 2 + + + TONGA + Pa’anga + TOP + 776 + 2 + + + TRINIDAD AND TOBAGO + Trinidad and Tobago Dollar + TTD + 780 + 2 + + + TUNISIA + Tunisian Dinar + TND + 788 + 3 + + + TURKEY + Turkish Lira + TRY + 949 + 2 + + + TURKMENISTAN + Turkmenistan New Manat + TMT + 934 + 2 + + + TURKS AND CAICOS ISLANDS (THE) + US Dollar + USD + 840 + 2 + + + TUVALU + Australian Dollar + AUD + 036 + 2 + + + UGANDA + Uganda Shilling + UGX + 800 + 0 + + + UKRAINE + Hryvnia + UAH + 980 + 2 + + + UNITED ARAB EMIRATES (THE) + UAE Dirham + AED + 784 + 2 + + + UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND (THE) + Pound Sterling + GBP + 826 + 2 + + + UNITED STATES MINOR OUTLYING ISLANDS (THE) + US Dollar + USD + 840 + 2 + + + UNITED STATES OF AMERICA (THE) + US Dollar + USD + 840 + 2 + + + UNITED STATES OF AMERICA (THE) + US Dollar (Next day) + USN + 997 + 2 + + + URUGUAY + Peso Uruguayo + UYU + 858 + 2 + + + URUGUAY + Uruguay Peso en Unidades Indexadas (UI) + UYI + 940 + 0 + + + URUGUAY + Unidad Previsional + UYW + 927 + 4 + + + UZBEKISTAN + Uzbekistan Sum + UZS + 860 + 2 + + + VANUATU + Vatu + VUV + 548 + 0 + + + VENEZUELA (BOLIVARIAN REPUBLIC OF) + Bolívar Soberano + VES + 928 + 2 + + + VIET NAM + Dong + VND + 704 + 0 + + + VIRGIN ISLANDS (BRITISH) + US Dollar + USD + 840 + 2 + + + VIRGIN ISLANDS (U.S.) + US Dollar + USD + 840 + 2 + + + WALLIS AND FUTUNA + CFP Franc + XPF + 953 + 0 + + + WESTERN SAHARA + Moroccan Dirham + MAD + 504 + 2 + + + YEMEN + Yemeni Rial + YER + 886 + 2 + + + ZAMBIA + Zambian Kwacha + ZMW + 967 + 2 + + + ZIMBABWE + Zimbabwe Dollar + ZWL + 932 + 2 + + + ZZ01_Bond Markets Unit European_EURCO + Bond Markets Unit European Composite Unit (EURCO) + XBA + 955 + N.A. + + + ZZ02_Bond Markets Unit European_EMU-6 + Bond Markets Unit European Monetary Unit (E.M.U.-6) + XBB + 956 + N.A. + + + ZZ03_Bond Markets Unit European_EUA-9 + Bond Markets Unit European Unit of Account 9 (E.U.A.-9) + XBC + 957 + N.A. + + + ZZ04_Bond Markets Unit European_EUA-17 + Bond Markets Unit European Unit of Account 17 (E.U.A.-17) + XBD + 958 + N.A. + + + ZZ06_Testing_Code + Codes specifically reserved for testing purposes + XTS + 963 + N.A. + + + ZZ07_No_Currency + The codes assigned for transactions where no currency is involved + XXX + 999 + N.A. + + + ZZ08_Gold + Gold + XAU + 959 + N.A. + + + ZZ09_Palladium + Palladium + XPD + 964 + N.A. + + + ZZ10_Platinum + Platinum + XPT + 962 + N.A. + + + ZZ11_Silver + Silver + XAG + 961 + N.A. + + + \ No newline at end of file diff --git a/dmp-frontend/src/app/core/common/enum/dataset-profile-field-view-style.ts b/dmp-frontend/src/app/core/common/enum/dataset-profile-field-view-style.ts index 98716cbe5..c656787e3 100644 --- a/dmp-frontend/src/app/core/common/enum/dataset-profile-field-view-style.ts +++ b/dmp-frontend/src/app/core/common/enum/dataset-profile-field-view-style.ts @@ -14,5 +14,6 @@ export enum DatasetProfileFieldViewStyle { Tags = "tags", Researchers = "researchers", Organizations = "organizations", - DatasetIdentifier = "datasetIdentifier" + DatasetIdentifier = "datasetIdentifier", + Currency = "currency" } diff --git a/dmp-frontend/src/app/core/core-service.module.ts b/dmp-frontend/src/app/core/core-service.module.ts index f4b1ebf49..3082ad593 100644 --- a/dmp-frontend/src/app/core/core-service.module.ts +++ b/dmp-frontend/src/app/core/core-service.module.ts @@ -42,6 +42,7 @@ import { UserGuideService } from './services/user-guide/user-guide.service'; import { ConfigurationService } from './services/configuration/configuration.service'; import { HttpClient } from '@angular/common/http'; import { LanguageInfoService } from './services/culture/language-info-service'; +import { CurrencyService } from './services/currency/currency.service'; // // // This is shared module that provides all the services. Its imported only once on the AppModule. @@ -105,6 +106,7 @@ export class CoreServiceModule { LanguageService, LockService, UserGuideService, + CurrencyService, ConfigurationService, { provide: APP_INITIALIZER, diff --git a/dmp-frontend/src/app/core/model/dataset-profile-definition/field-data/field-data.ts b/dmp-frontend/src/app/core/model/dataset-profile-definition/field-data/field-data.ts index 2ab0b4ea1..6a953e120 100644 --- a/dmp-frontend/src/app/core/model/dataset-profile-definition/field-data/field-data.ts +++ b/dmp-frontend/src/app/core/model/dataset-profile-definition/field-data/field-data.ts @@ -100,3 +100,7 @@ export interface OrganizationsFieldData extends FieldData { export interface DatasetIdentifierFieldData extends FieldData { } + +export interface CurrencyFieldData extends FieldData { + +} diff --git a/dmp-frontend/src/app/core/model/local-fetch/local-fetch.model.ts b/dmp-frontend/src/app/core/model/local-fetch/local-fetch.model.ts new file mode 100644 index 000000000..4ca43879a --- /dev/null +++ b/dmp-frontend/src/app/core/model/local-fetch/local-fetch.model.ts @@ -0,0 +1,4 @@ +export class LocalFetchModel { + name: string; + value: string; +} diff --git a/dmp-frontend/src/app/core/services/currency/currency.service.ts b/dmp-frontend/src/app/core/services/currency/currency.service.ts new file mode 100644 index 000000000..77fcf084c --- /dev/null +++ b/dmp-frontend/src/app/core/services/currency/currency.service.ts @@ -0,0 +1,21 @@ +import { ConfigurationService } from '../configuration/configuration.service'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { LocalFetchModel } from '@app/core/model/local-fetch/local-fetch.model'; +import { BaseHttpService } from '../http/base-http.service'; + + + +@Injectable() +export class CurrencyService { + + private actionUrl: string; + constructor(private http: BaseHttpService, private configurationService: ConfigurationService) { + this.actionUrl = configurationService.server + 'currency'; + } + + get(query: string): Observable { + return this.http.get(`${this.actionUrl}?query=${query}`); + } + +} diff --git a/dmp-frontend/src/app/core/services/external-sources/currency/currency.service.ts b/dmp-frontend/src/app/core/services/external-sources/currency/currency.service.ts new file mode 100644 index 000000000..3ab66a2ec --- /dev/null +++ b/dmp-frontend/src/app/core/services/external-sources/currency/currency.service.ts @@ -0,0 +1,19 @@ +import { ConfigurationService } from '../../configuration/configuration.service'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { LocalFetchModel } from '@app/core/model/local-fetch/local-fetch.model'; +import { BaseHttpService } from '../../http/base-http.service'; + +@Injectable() +export class CurrencyService { + + private actionUrl: string; + constructor(private http: BaseHttpService, private configurationService: ConfigurationService) { + this.actionUrl = configurationService.server + 'currency'; + } + + get(): Observable { + return this.http.get(this.actionUrl); + } + +} diff --git a/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts b/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts index d1e9c91e7..0697372e7 100644 --- a/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts +++ b/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts @@ -83,6 +83,7 @@ export class EnumUtils { case DatasetProfileFieldViewStyle.Researchers: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.RESEARCHERS'); case DatasetProfileFieldViewStyle.Organizations: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.ORGANIZATIONS'); case DatasetProfileFieldViewStyle.DatasetIdentifier: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.DATASET-IDENTIFIER'); + case DatasetProfileFieldViewStyle.Currency: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.CURRENCY'); } } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/currency-data-editor-models.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/currency-data-editor-models.ts new file mode 100644 index 000000000..07b1c67c0 --- /dev/null +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/currency-data-editor-models.ts @@ -0,0 +1,19 @@ +import { FormGroup } from '@angular/forms'; +import { FieldDataEditorModel } from './field-data-editor-model'; +import { CurrencyFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; + +export class CurrencyDataEditorModel extends FieldDataEditorModel { + public label: string; + + buildForm(disabled: boolean = false, skipDisable: Array = []): FormGroup { + const formGroup = this.formBuilder.group({ + label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('CurrencyDataEditorModel.label')) }] + }); + return formGroup; + } + + fromModel(item: CurrencyFieldData): CurrencyDataEditorModel { + this.label = item.label; + return this; + } +} diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-editor-model.ts index 08b0eb514..fcaf00324 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-editor-model.ts @@ -26,6 +26,7 @@ import { TagsDataEditorModel } from './field-data/tags-data-editor-models'; import { ResearchersDataEditorModel } from './field-data/researchers-data-editor-models'; import { OrganizationsDataEditorModel } from './field-data/organizations-data-editor-models'; import { DatasetIdentifierDataEditorModel } from './field-data/dataset-identifier-data-editor-models'; +import { CurrencyDataEditorModel } from './field-data/currency-data-editor-models'; export class FieldEditorModel extends BaseFormModel { @@ -73,6 +74,7 @@ export class FieldEditorModel extends BaseFormModel { if (this.viewStyle.renderStyle === 'researchers') { this.data = new ResearchersDataEditorModel().fromModel(item.data); } if (this.viewStyle.renderStyle === 'organizations') { this.data = new OrganizationsDataEditorModel().fromModel(item.data); } if (this.viewStyle.renderStyle === 'datasetIdentifier') { this.data = new DatasetIdentifierDataEditorModel().fromModel(item.data); } + if (this.viewStyle.renderStyle === 'currency') { this.data = new CurrencyDataEditorModel().fromModel(item.data); } } } return this; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/dataset-profile.module.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/dataset-profile.module.ts index 20626451c..538f26e0b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/dataset-profile.module.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/dataset-profile.module.ts @@ -36,6 +36,7 @@ import { DatasetProfileEditorTagsFieldComponent } from './editor/components/fiel import { DatasetProfileEditorResearchersFieldComponent } from './editor/components/field-type/researchers/dataset-profile-editor-researchers-field.component'; import { DatasetProfileEditorOrganizationsFieldComponent } from './editor/components/field-type/organizations/dataset-profile-editor-organizations-field.component'; import { DatasetProfileEditorDatasetIdentifierFieldComponent } from './editor/components/field-type/dataset-identifier/dataset-profile-editor-dataset-identifier-field.component'; +import { DatasetProfileEditorCurrencyFieldComponent } from './editor/components/field-type/currency/dataset-profile-editor-currency-field.component'; @NgModule({ imports: [ @@ -77,7 +78,8 @@ import { DatasetProfileEditorDatasetIdentifierFieldComponent } from './editor/co DatasetProfileEditorTagsFieldComponent, DatasetProfileEditorResearchersFieldComponent, DatasetProfileEditorOrganizationsFieldComponent, - DatasetProfileEditorDatasetIdentifierFieldComponent + DatasetProfileEditorDatasetIdentifierFieldComponent, + DatasetProfileEditorCurrencyFieldComponent ], entryComponents: [ DialodConfirmationUploadDatasetProfiles diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.html new file mode 100644 index 000000000..aeb72f4ed --- /dev/null +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.html @@ -0,0 +1,9 @@ +
+
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-DATE-PICKER-TITLE' + | translate}}
+ + + +
\ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.scss b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.scss new file mode 100644 index 000000000..3db0dee74 --- /dev/null +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.scss @@ -0,0 +1,3 @@ +.full-width { + width: 100%; +} diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.ts new file mode 100644 index 000000000..899757bdf --- /dev/null +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/currency/dataset-profile-editor-currency-field.component.ts @@ -0,0 +1,18 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { FormGroup } from '@angular/forms'; +import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models'; + +@Component({ + selector: 'app-dataset-profile-editor-currency-field-component', + styleUrls: ['./dataset-profile-editor-currency-field.component.scss'], + templateUrl: './dataset-profile-editor-currency-field.component.html' +}) +export class DatasetProfileEditorCurrencyFieldComponent implements OnInit { + + @Input() form: FormGroup; + private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel(); + + ngOnInit() { + if (!this.form.get('data')) { this.form.addControl('data', this.data.buildForm()); } + } +} diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.html index 0151c79a6..820ba4dd6 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.html @@ -25,6 +25,7 @@ {{enumUtils.toDatasetProfileFieldViewStyleString(viewStyleEnum.Researchers)}} {{enumUtils.toDatasetProfileFieldViewStyleString(viewStyleEnum.Organizations)}} {{enumUtils.toDatasetProfileFieldViewStyleString(viewStyleEnum.DatasetIdentifier)}} + {{enumUtils.toDatasetProfileFieldViewStyleString(viewStyleEnum.Currency)}}
{{'GENERAL.VALIDATION.REQUIRED' | translate}}
@@ -80,6 +81,7 @@ +

{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.RULES-TITLE' | translate}} diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts index f32b09f49..c2added6f 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts @@ -25,6 +25,7 @@ import { ResearchersDataEditorModel } from '../../../admin/field-data/researcher import { OrganizationsDataEditorModel } from '../../../admin/field-data/organizations-data-editor-models'; import { DatasetIdentifierDataEditorModel } from '../../../admin/field-data/dataset-identifier-data-editor-models'; import { ExternalDatasetsDataEditorModel } from '../../../admin/field-data/external-datasets-data-editor-models'; +import { CurrencyDataEditorModel } from '../../../admin/field-data/currency-data-editor-models'; @Component({ selector: 'app-dataset-profile-editor-field-component', @@ -109,6 +110,9 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements case DatasetProfileFieldViewStyle.DatasetIdentifier: this.form.addControl('data', new DatasetIdentifierDataEditorModel().buildForm()); break; + case DatasetProfileFieldViewStyle.Currency: + this.form.addControl('data', new CurrencyDataEditorModel().buildForm()); + break; } } }); @@ -133,6 +137,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements case DatasetProfileFieldViewStyle.Registries: case DatasetProfileFieldViewStyle.Organizations: case DatasetProfileFieldViewStyle.DatasetIdentifier: + case DatasetProfileFieldViewStyle.Currency: return false; default: return false; diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html index 0e064a31e..d811889f2 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html @@ -244,4 +244,16 @@

+ +
+
+ + + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + + +
+
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts index 20fbfec3f..1327691d5 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.ts @@ -32,6 +32,8 @@ import { ExternalTagEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-w import { MatChipInputEvent } from '@angular/material'; import { ENTER, COMMA } from '@angular/cdk/keycodes'; import { DatasetIdModel } from '@app/core/model/dataset/dataset-id.model'; +import { LocalFetchModel } from '@app/core/model/local-fetch/local-fetch.model'; +import { CurrencyService } from '@app/core/services/currency/currency.service'; @Component({ selector: 'app-form-field', @@ -60,6 +62,7 @@ export class FormFieldComponent extends BaseComponent implements OnInit { tagsAutoCompleteConfiguration: SingleAutoCompleteConfiguration; researchersAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; organisationsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; + currencyAutoCompleteConfiguration: SingleAutoCompleteConfiguration; readonly separatorKeysCodes: number[] = [ENTER, COMMA]; @@ -81,7 +84,8 @@ export class FormFieldComponent extends BaseComponent implements OnInit { private externalSourcesService: ExternalSourcesService, private language: TranslateService, private datasetService: DatasetService, - private dmpService: DmpService + private dmpService: DmpService, + private currencyService: CurrencyService ) { super(); } ngOnInit() { @@ -183,6 +187,15 @@ export class FormFieldComponent extends BaseComponent implements OnInit { this.form.addControl('value', new DatasetIdModel(value).buildForm()); this.datasetIdInitialized = true; break; + case DatasetProfileFieldViewStyle.Currency: + this.currencyAutoCompleteConfiguration = { + filterFn: this.searchCurrency.bind(this), + initialItems: () => this.searchCurrency(''), + displayFn: (item) => typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name, + titleFn: (item) => typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name, + valueAssign: (item) => typeof (item) == 'string' ? item : JSON.stringify(item) + }; + break; } if (this.form.get('viewStyle').value.renderStyle === DatasetProfileFieldViewStyle.InternalDmpEntities) { @@ -347,4 +360,8 @@ export class FormFieldComponent extends BaseComponent implements OnInit { getDatasetIdControl(name: string): FormControl { return this.form.get('value').get(name) as FormControl; } + + searchCurrency(query: string): Observable { + return this.currencyService.get(query); + } } diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index e73477672..f408a394a 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -942,7 +942,8 @@ "TAGS": "Tags", "RESEARCHERS": "Researchers", "ORGANIZATIONS": "Organizations", - "DATASET-IDENTIFIER": "Dataset Identifier" + "DATASET-IDENTIFIER": "Dataset Identifier", + "CURRENCY": "Currency" }, "DATASET-PROFILE-COMBO-BOX-TYPE": { "WORD-LIST": "Word List", diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index eb1574916..2e1d8c0f1 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -942,7 +942,8 @@ "TAGS": "Tags", "RESEARCHERS": "Researchers", "ORGANIZATIONS": "Organizations", - "DATASET-IDENTIFIER": "Dataset Identifier" + "DATASET-IDENTIFIER": "Dataset Identifier", + "CURRENCY": "Currency" }, "DATASET-PROFILE-COMBO-BOX-TYPE": { "WORD-LIST": "Lista de palabras", diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 6e1877f71..80c841ff7 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -62,7 +62,7 @@ "DELETE": "Διαγραφή", "REMOVE": "Αφαίρεση", "CANCEL": "Ακύρωση", - "LEAVE": "Αναχώρηση", + "LEAVE": "Αποχώρηση", "POLICY-AGREE": "Κάντε τα ονόματα ορατά στο κοινό.", "REQUIRED": "Απαιτείται να κάνετε κλικ στο πλαίσιο ελέγχου." } @@ -942,7 +942,8 @@ "TAGS": "Tags", "RESEARCHERS": "Researchers", "ORGANIZATIONS": "Organizations", - "DATASET-IDENTIFIER": "Dataset Identifier" + "DATASET-IDENTIFIER": "Dataset Identifier", + "CURRENCY": "Currency" }, "DATASET-PROFILE-COMBO-BOX-TYPE": { "WORD-LIST": "Λίστα Λέξεων", From 55d3feb4e32b141ae4eb21c8fc42ee9e2a7ba69d Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Thu, 25 Jun 2020 13:30:47 +0300 Subject: [PATCH 09/26] Fixed minor issues with RDA Mapping --- .../managers/DataManagementPlanManager.java | 4 ++- .../eu/eudat/logic/managers/RDAManager.java | 28 +++---------------- .../eudat/logic/mapper/elastic/DmpMapper.java | 2 +- .../models/rda/mapper/DatasetRDAMapper.java | 28 ++++++++++--------- .../eudat/models/rda/mapper/DmpRDAMapper.java | 4 ++- 5 files changed, 26 insertions(+), 40 deletions(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java index f9a8499ca..acb51508e 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java @@ -1404,7 +1404,9 @@ public class DataManagementPlanManager { } databaseRepository.getDmpDao().createOrUpdate(dmp); assignUser(dmp, me); - this.updateIndex(dmp); + if (this.apiContext.getOperationsContext().getElasticRepository().getDmpRepository().getClient() != null) { + this.updateIndex(dmp); + } dmp.getDataset().forEach(dataset -> { dataset.setStatus(Dataset.Status.SAVED.getValue()); dataset.setCreated(new Date()); diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/RDAManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/RDAManager.java index 4145a094f..242a365c9 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/RDAManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/RDAManager.java @@ -34,8 +34,9 @@ public class RDAManager { ObjectMapper mapper = new ObjectMapper(); mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'")); - DMPWrap wrap = new DMPWrap(rdaDmp); - result = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(wrap); + RDAModel model = new RDAModel(); + model.setDmp(rdaDmp); + result = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(model); return result; } @@ -44,28 +45,7 @@ public class RDAManager { ObjectMapper mapper = new ObjectMapper(); mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'")); - - Dmp rda = mapper.readValue(json, DMPWrap.class).getDmp(); + Dmp rda = mapper.readValue(json, RDAModel.class).getDmp(); return dmpRDAMapper.toEntity(rda, profiles); } - - public static class DMPWrap implements Serializable { - @JsonProperty("dmp") - private Dmp dmp; - - public DMPWrap() { - } - - public DMPWrap(Dmp dmp) { - this.dmp = dmp; - } - - public Dmp getDmp() { - return dmp; - } - - public void setDmp(Dmp dmp) { - this.dmp = dmp; - } - } } diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/mapper/elastic/DmpMapper.java b/dmp-backend/web/src/main/java/eu/eudat/logic/mapper/elastic/DmpMapper.java index 5a25990f1..956af3b5b 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/mapper/elastic/DmpMapper.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/mapper/elastic/DmpMapper.java @@ -58,7 +58,7 @@ public class DmpMapper { } if (dmp.getDataset() != null) { - elastic.setDatasets(dmp.getDataset().stream().map(dataset -> { + elastic.setDatasets(dmp.getDataset().stream().filter(dataset -> dataset.getId() != null).map(dataset -> { List tags = null; try { Dataset dataset1 = apiContext.getOperationsContext().getElasticRepository().getDatasetRepository().findDocument(dataset.getId().toString()); diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DatasetRDAMapper.java b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DatasetRDAMapper.java index e235de3ba..082a67fbe 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DatasetRDAMapper.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DatasetRDAMapper.java @@ -217,20 +217,22 @@ public class DatasetRDAMapper { properties.putAll(DistributionRDAMapper.toProperties(rda.getDistribution().get(0), datasetDescriptionObj)); } - List keywordIds = rda.getAdditionalProperties().entrySet().stream().filter(entry -> entry.getKey().startsWith("keyword")).map(entry -> entry.getValue().toString()).collect(Collectors.toList()); - boolean takeAll = false; - if (keywordIds.size() < rda.getKeyword().size()) { - takeAll = true; - } - for (int i = 0; i < keywordIds.size(); i++) { - if (takeAll) { - List tags = new ArrayList<>(); - for (String keyword: rda.getKeyword()) { - tags.add(mapper.writeValueAsString(toTagEntity(keyword))); + if (rda.getKeyword() != null) { + List keywordIds = rda.getAdditionalProperties().entrySet().stream().filter(entry -> entry.getKey().startsWith("keyword")).map(entry -> entry.getValue().toString()).collect(Collectors.toList()); + boolean takeAll = false; + if (keywordIds.size() < rda.getKeyword().size()) { + takeAll = true; + } + for (int i = 0; i < keywordIds.size(); i++) { + if (takeAll) { + List tags = new ArrayList<>(); + for (String keyword : rda.getKeyword()) { + tags.add(mapper.writeValueAsString(toTagEntity(keyword))); + } + properties.put(keywordIds.get(i), tags); + } else { + properties.put(keywordIds.get(i), mapper.writeValueAsString(toTagEntity(rda.getKeyword().get(i)))); } - properties.put(keywordIds.get(i), tags); - } else { - properties.put(keywordIds.get(i), mapper.writeValueAsString(toTagEntity(rda.getKeyword().get(i)))); } } diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DmpRDAMapper.java b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DmpRDAMapper.java index a4350b53a..a64649c86 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DmpRDAMapper.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DmpRDAMapper.java @@ -42,7 +42,9 @@ public class DmpRDAMapper { rda.setTitle(dmp.getLabel()); Map extraProperties = new org.json.JSONObject(dmp.getExtraProperties()).toMap(); - rda.setLanguage(LanguageRDAMapper.mapLanguageIsoToRDAIso(extraProperties.get("language").toString())); + if (!extraProperties.isEmpty()) { + rda.setLanguage(LanguageRDAMapper.mapLanguageIsoToRDAIso(extraProperties.get("language").toString())); + } UserInfo creator; if (dmp.getCreator() != null) { From 92fe11b18b839881629feaafddfab758e783e4e9 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Thu, 25 Jun 2020 13:35:17 +0300 Subject: [PATCH 10/26] When logging in remove the cookie consent popup --- dmp-frontend/src/app/core/services/auth/auth.service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dmp-frontend/src/app/core/services/auth/auth.service.ts b/dmp-frontend/src/app/core/services/auth/auth.service.ts index 9b61514c4..af4604994 100644 --- a/dmp-frontend/src/app/core/services/auth/auth.service.ts +++ b/dmp-frontend/src/app/core/services/auth/auth.service.ts @@ -14,6 +14,7 @@ import { environment } from 'environments/environment'; import { Observable, of as observableOf, throwError as observableThrowError } from 'rxjs'; import { catchError, map, takeUntil } from 'rxjs/operators'; import { ConfigurationService } from '../configuration/configuration.service'; +import { CookieService } from 'ngx-cookie-service'; @Injectable() export class AuthService extends BaseService { @@ -26,7 +27,8 @@ export class AuthService extends BaseService { private language: TranslateService, private router: Router, private uiNotificationService: UiNotificationService, - private configurationService: ConfigurationService + private configurationService: ConfigurationService, + private cookieService: CookieService ) { super(); @@ -73,6 +75,7 @@ export class AuthService extends BaseService { return this.http.post(url, loginInfo, { headers: this.headers }).pipe( map((res: any) => { const principal = this.current(res.payload); + this.cookieService.set('cookiesConsent', 'true', 356); //this.loginContextSubject.next(true); return principal; }), @@ -89,6 +92,7 @@ export class AuthService extends BaseService { return this.http.post(url, credentials, { headers: this.headers }).pipe( map((res: any) => { const principal = this.current(res.payload); + this.cookieService.set('cookiesConsent', 'true', 356); //this.loginContextSubject.next(true); return principal; }), From 2e5faf5c0580b2d5944167b39f2722889582790d Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Thu, 25 Jun 2020 14:05:19 +0300 Subject: [PATCH 11/26] Hide Uri field on Dataset Editor (ref #275) --- .../dataset-wizard/dataset-editor/dataset-editor.component.html | 2 +- .../dataset-wizard/dataset-editor/dataset-editor.component.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.html b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.html index 299133f87..b698833ae 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.html +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.html @@ -8,7 +8,7 @@ {{'GENERAL.VALIDATION.REQUIRED' | translate}} -
+
{{formGroup.get('uri').getError('backendError').message}} diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts index d2cad6024..725fda5c7 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts @@ -11,6 +11,7 @@ import { BaseComponent } from '@common/base/base.component'; export class DatasetEditorComponent extends BaseComponent { @Input() formGroup: FormGroup = null; + showUri: boolean = false; constructor( private router: Router, From 423271713f90a22298f8f98df192ac345d795ae5 Mon Sep 17 00:00:00 2001 From: dtziotzios Date: Thu, 25 Jun 2020 17:52:00 +0300 Subject: [PATCH 12/26] splash screen changes --- dmp-frontend/src/app/app-routing.module.ts | 10 +- dmp-frontend/src/app/app.component.ts | 2 +- dmp-frontend/src/app/app.module.ts | 2 +- .../cookies-policy.component.html | 34 + .../cookies-policy.component.scss | 12 + .../cookies-policy.component.ts | 15 + .../cookies-policy/cookies-policy.module.ts | 15 + .../cookies-policy/cookies-policy.routing.ts | 16 + .../sidebar-footer.component.html | 2 +- .../sidebar-footer/terms/terms.component.html | 26 +- .../app/ui/user-guide/user-guide.routing.ts | 9 +- dmp-frontend/src/assets/i18n/en.json | 9 +- .../src/assets/splash/about/faqs.html | 121 +- .../src/assets/splash/about/how-it-works.html | 69 +- .../splash/assets/img/template-preview-1.svg | 61 +- .../splash/assets/img/template-preview-2.svg | 67 +- .../splash/assets/media-kit/Factsheet.pdf | 45181 ++++++++++++++++ .../assets/media-kit/argos-logo-white.png | Bin 0 -> 19856 bytes .../assets/media-kit/argos-logo-white.svg | 1 + .../splash/assets/media-kit/argos-logo.png | Bin 0 -> 20723 bytes .../splash/assets/media-kit/argos-logo.svg | 1 + .../assets/splash/assets/media-kit/back.svg | 1 + .../assets/splash/assets/media-kit/front.svg | 1 + .../splash/assets/media-kit/moo-card-png.zip | Bin 0 -> 115475 bytes .../splash/assets/media-kit/moo-card-svg.zip | Bin 0 -> 18086 bytes .../splash/assets/presentations/argos.pdf | Bin 0 -> 17244414 bytes dmp-frontend/src/assets/splash/contact.html | 258 +- dmp-frontend/src/assets/splash/index.html | 688 +- .../assets/splash/resources/co-branding.html | 75 +- .../assets/splash/resources/media-kit.html | 96 +- .../assets/splash/resources/user-guide.html | 229 +- 31 files changed, 46254 insertions(+), 747 deletions(-) create mode 100644 dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.component.html create mode 100644 dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.component.scss create mode 100644 dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.component.ts create mode 100644 dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.module.ts create mode 100644 dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.routing.ts create mode 100644 dmp-frontend/src/assets/splash/assets/media-kit/Factsheet.pdf create mode 100644 dmp-frontend/src/assets/splash/assets/media-kit/argos-logo-white.png create mode 100644 dmp-frontend/src/assets/splash/assets/media-kit/argos-logo-white.svg create mode 100644 dmp-frontend/src/assets/splash/assets/media-kit/argos-logo.png create mode 100644 dmp-frontend/src/assets/splash/assets/media-kit/argos-logo.svg create mode 100644 dmp-frontend/src/assets/splash/assets/media-kit/back.svg create mode 100644 dmp-frontend/src/assets/splash/assets/media-kit/front.svg create mode 100644 dmp-frontend/src/assets/splash/assets/media-kit/moo-card-png.zip create mode 100644 dmp-frontend/src/assets/splash/assets/media-kit/moo-card-svg.zip create mode 100644 dmp-frontend/src/assets/splash/assets/presentations/argos.pdf diff --git a/dmp-frontend/src/app/app-routing.module.ts b/dmp-frontend/src/app/app-routing.module.ts index 8ceeea0a5..3c4516697 100644 --- a/dmp-frontend/src/app/app-routing.module.ts +++ b/dmp-frontend/src/app/app-routing.module.ts @@ -140,13 +140,21 @@ const appRoutes: Routes = [ } }, { - path: 'terms-of-service', + path: 'terms-and-conditions', loadChildren: () => import('./ui/sidebar/sidebar-footer/terms/terms.module').then(m => m.TermsModule), data: { breadcrumb: true, title: 'GENERAL.TITLES.TERMS' } }, + { + path: 'cookies-policy', + loadChildren: () => import('./ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.module').then(m => m.CookiesPolicyModule), + data: { + breadcrumb: true, + title: 'GENERAL.TITLES.COOKIES-POLICY' + } + }, { path: 'home', loadChildren: () => import('./ui/dashboard/dashboard.module').then(m => m.DashboardModule), diff --git a/dmp-frontend/src/app/app.component.ts b/dmp-frontend/src/app/app.component.ts index 5b777bc75..76cdbae4e 100644 --- a/dmp-frontend/src/app/app.component.ts +++ b/dmp-frontend/src/app/app.component.ts @@ -119,7 +119,7 @@ export class AppComponent implements OnInit { } }); - this.ccService.getConfig().content.href = this.configurationService.app + "terms-of-service"; + this.ccService.getConfig().content.href = this.configurationService.app + "cookies-policy"; this.ccService.getConfig().cookie.domain = this.configurationService.app; this.translate .get(['COOKIE.MESSAGE', 'COOKIE.DISMISS', 'COOKIE.DENY', 'COOKIE.LINK', 'COOKIE.POLICY']) diff --git a/dmp-frontend/src/app/app.module.ts b/dmp-frontend/src/app/app.module.ts index 556d685a1..8523db47b 100644 --- a/dmp-frontend/src/app/app.module.ts +++ b/dmp-frontend/src/app/app.module.ts @@ -62,7 +62,7 @@ const cookieConfig: NgcCookieConsentConfig = { deny: "Refuse cookies", link: "Learn more", href: "",//environment.App + "terms-of-service", - policy: "Cookie Policy" + policy: "Cookies Policy" }, position: "bottom-right", theme: 'edgeless', diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.component.html b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.component.html new file mode 100644 index 000000000..c88a3108f --- /dev/null +++ b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.component.html @@ -0,0 +1,34 @@ +
+
+
+

{{ 'COOKIES-POLICY.TITLE' | translate}}

+
+
+
+
+

ARGOS ("us", "we", "our") uses cookies. By using ARGOS, you consent to the use of cookies.

+

Our Cookies Policy explains what cookies are, how we use cookies, how third-parties we may partner with may use cookies on ARGOS, your choices regarding cookies and further information about cookies.

+

+
+

What are cookies

+

Cookies are small pieces of text sent by your web browser by a website you visit. A cookie file is stored in your web browser and allows ARGOS or a third-party to recognize you and make your next visit easier and ARGOS more useful to you.

+

Cookies can be "persistent" or "session" cookies.

+
+

How Argos uses cookies

+

When you use and access ARGOS, we may place cookies files in your web browser.

+

We use cookies for the following purposes: to enable certain functions of ARGOS and to provide analytics.

+

We use both session and persistent cookies on ARGOS and we use different types of cookies to run the Service:

+

1. Essential cookies. We may use essential cookies to authenticate users and prevent fraudulent use of user accounts.

+

2. Performance cookies. We use performance cookies to count visits and traffic sources, so we can measure and improve the performance of Argos, for example by analysing patterns of user behaviour in order to enhance user experience or by identifying areas of the website which may require maintenance. All information these cookies collect is anonymous.

+

 3. Third-party cookies. Apart from our own cookies, we may use cookies from sources that Argos and OpenAIRE (Argos provider) makes use of for Argos to properly function and validate input and output. Third-party cookies are also used to report usage statistics of Argos.

+

+
+

What are your choices regarding cookies

+

If you'd like to delete cookies or instruct your web browser to delete or refuse cookies, please visit the help pages of your web browser.

+

Please note, however, that if you delete cookies or refuse to accept them, you might not be able to use all of the features we offer, you may not be able to store your preferences, and some of our pages might not display properly.

+

Please contact OpenAIRE’s Data Protection Officer for further information on the cookies that we use and their purposes: dpo@openaire.eu 

+

+

Last updated: 16/06/2020

+
+
+
\ No newline at end of file diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.component.scss b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.component.scss new file mode 100644 index 000000000..c2738b53a --- /dev/null +++ b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.component.scss @@ -0,0 +1,12 @@ +h1 { + text-align: center; +} + +img { + height: 150px; + width: 100%; +} + +.cookies-policy-component { + margin-top: 80px; +} diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.component.ts b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.component.ts new file mode 100644 index 000000000..800f08083 --- /dev/null +++ b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-cookies-policy', + templateUrl: './cookies-policy.component.html', + styleUrls: ['./cookies-policy.component.scss'] +}) +export class CookiesPolicyComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.module.ts b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.module.ts new file mode 100644 index 000000000..4768b08c0 --- /dev/null +++ b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.module.ts @@ -0,0 +1,15 @@ +import { NgModule } from '@angular/core'; +import { CookiesPolicyComponent } from '@app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.component'; +import { CookiesPolicyRoutingModule } from '@app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.routing'; +import { CommonUiModule } from '@common/ui/common-ui.module'; + +@NgModule({ + imports: [ + CommonUiModule, + CookiesPolicyRoutingModule + ], + declarations: [ + CookiesPolicyComponent + ], +}) +export class CookiesPolicyModule { } diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.routing.ts b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.routing.ts new file mode 100644 index 000000000..27f7f9360 --- /dev/null +++ b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/cookies-policy/cookies-policy.routing.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { CookiesPolicyComponent } from './cookies-policy.component'; + +const routes: Routes = [ + { + path: '', + component: CookiesPolicyComponent, + }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class CookiesPolicyRoutingModule { } diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.html b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.html index 5c35b14c0..d9c068baa 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.html +++ b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.html @@ -33,7 +33,7 @@ {{'FOOTER.CONTACT-SUPPORT' | translate}}

diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/terms/terms.component.html b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/terms/terms.component.html index e469ae59b..e8f39d395 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/terms/terms.component.html +++ b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/terms/terms.component.html @@ -6,7 +6,29 @@
-

{{ 'TERMS-OF-SERVICE.MAIN-CONTENT' | translate}}

+

The OpenDMP service was developed to provide a more flexible, collaborative environment with machine actionable solutions in writing, sharing and publishing Data Management Plans (DMPs). It is a product of cooperation between OpenAIRE AMKE and EUDAT CDI and is offered both as a software “OpenDMP '' and as an online service under the name “ARGOS”.

+

+
    +
  1. OpenDMP software is offered under the Free Open Source Software license  Apache 2.0, for further development and use by institutions and interested parties.
  2. +
  3. ARGOS service is offered by OpenAIRE as part of its mission to support Open Science in the European Research Area, focusing on information linking and contextualisation that enriches its Research Graph. Use of ARGOS denotes agreement with the following terms: +
      +
    1. ARGOS is a software interface and a database with no storage capacity to store or preserve research data. The DMPs created are hosted in the OpenAIRE production environment for the sole purpose of exposing the DMP records once finalised (“published”). If assigned a DOI, the DMP records are linked to and preserved in Zenodo, the OpenAIRE’s repository service. The ARGOS service is made available for use free-of-charge for research, educational and informational purposes.
    2. +
    3. Login to ARGOS is possible through a variety of external providers, among which Google, Facebook, Twitter, B2Access and OpenAIRE Login, that share information of their user profiles with ARGOS, according to the rights that have been granted to the given provider by the user. External email addresses that are used in invitations for collaborations are held in ARGOS database that stores information about only the name, surname and email address of the DMP creator and collaborator.  Personal data is collected via the login option and via email invitations sent to external DMP contributors. This personal information as well as the activity of ARGOS users is used only for deriving usage metrics and assessing the service quality. They are stored in ARGOS database for as long as the account is active and they are accessible only from people in the team in charge of quality and risk assessment. They will not be used for other purposes other than the ones stated in this document and they can be deleted at any time should the user claim a relevant request. The aforementioned processes are also facilitated by the use of cookies (see below the “Cookie policy”).
    4. +
    5. Data concerning DMP information will be used by OpenAIRE for research and development purposes, such as identifying DMP models, and for ensuring compliance with policy requirements and monitoring of DMPs uptake linked to OpenAIRE’s Monitoring Dashboards and the Open Science Observatory.
    6. +
    7. The DMP Manager, i.e. the person who creates and manages a DMP, and/ or the contributor, i.e. the person who is invited to collaborate on a DMP, shall ensure that content is accurate and presented in a way that adheres to these Terms of Service and applicable laws, including, but not limited to, privacy, data protection and intellectual property rights.
    8. +
    9. ARGOS service is provided by OpenAIRE “as is”. Although OpenAIRE and its partners take measures for the availability, dependability, and accuracy of the service, access to ARGOS, utilisation of its features and preservation of the data deposited or produced by the service are not guaranteed. OpenAIRE cannot be held responsible for any data loss regarding DMPs, ethical or financial damage or any other direct or indirect impact that any failure of ARGOS service may have on its users.  
    10. +
    11. ARGOS users are exclusively responsible for their use of content, and shall hold OpenAIRE free and harmless in connection with their download and/or use.
    12. +
    13. OpenAIRE may not be held responsible for the content provided or statements made in Data Management Plans created and managed by its users.
    14. +
    15. All content is provided “as-is”. Users of content (“Users”) shall respect applicable license conditions. Download and use of content from ARGOS does not transfer any intellectual property rights in the content to the User.
    16. +
    17. In the case any content is reported as violating third party rights or other legal provisions, ARGOS reserves the right to remove the content from the service until the dispute is legally settled. Any such incidents should be reported at noticeandtakedown@openaire.eu 
    18. +
    19. ARGOS users are held responsible for the data and information they provide in the service. Users may not add information, data or any other type of artifact that may be malicious, intentionally erroneous and potentially harmful for other ARGOS users, IPR owners and/or the general public.
    20. +
    21. In case a user of ARGOS identifies a potential infringement of copyright, harmful or malicious operation, function, code, information or data, shall inform OpenAIRE providing sufficient evidence for the identification of the case and the information and/or data challenged.
    22. +
    23. OpenAIRE reserves the right, without notice, at its sole discretion and without liability, (i) to alter or delete inappropriate content, and (ii) to restrict or remove User access where it considers that use of ARGOS interferes with its operations or violates these Terms of Service or applicable laws.
    24. +
    25. These Terms of Service are subject to change by OpenAIRE at any time and without notice, other than through posting the updated Terms of Service on the OpenAIRE website and indicating the version and date of last update.
    26. +
    +
  4. +
+

For any questions or comments you may have about the current Terms of Service, please contact us: argos@openaire.eu 

- + \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/user-guide/user-guide.routing.ts b/dmp-frontend/src/app/ui/user-guide/user-guide.routing.ts index b2a0a48d8..40b7bcfd8 100644 --- a/dmp-frontend/src/app/ui/user-guide/user-guide.routing.ts +++ b/dmp-frontend/src/app/ui/user-guide/user-guide.routing.ts @@ -1,18 +1,17 @@ import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { RouterModule, Routes } from '@angular/router'; import { UserGuideContentComponent } from './user-guide-content/user-guide-content.component'; -import { UserGuideDialogComponent } from './dialog/user-guide-dialog.component'; const routes: Routes = [ { path: '', - component: UserGuideDialogComponent, + component: UserGuideContentComponent, }, ]; @NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] }) export class UserGuideRoutingModule { } diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index e73477672..0765bdde4 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -89,6 +89,7 @@ "ABOUT": "About", "PRIVACY": "Privacy Policy", "TERMS": "Terms Of Service", + "COOKIES-POLICY": "Cookies Policy", "PLANS": "My DMPs", "EXPLORE-PLANS": "Published DMPs", "QUICK-WIZARD": "New DMP (Wizard)", @@ -142,7 +143,7 @@ "DISMISS": "Accept", "DENY": "Refuse cookies", "LINK": "Learn more", - "POLICY": "Cookie Policy" + "POLICY": "Cookies Policy" }, "EMAIL-CONFIRMATION": { "EXPIRED-EMAIL": "Mail invitation expired", @@ -1041,6 +1042,7 @@ "GUIDE": "User Guide", "GLOSSARY": "Glossary", "TERMS-OF-SERVICE": "Terms Of Service", + "COOKIES-POLICY": "Cookies Policy", "PRIVACY-POLICY": "Privacy Policy" }, "GLOSSARY": { @@ -1063,9 +1065,12 @@ "MAIN-CONTENT": "" }, "TERMS-OF-SERVICE": { - "TITLE": "-Terms Of Service-", + "TITLE": "Terms of Service", "MAIN-CONTENT": "" }, + "COOKIES-POLICY": { + "TITLE": "Cookies Policy" + }, "CONTACT": { "SUPPORT": { "TITLE": "Contact Support", diff --git a/dmp-frontend/src/assets/splash/about/faqs.html b/dmp-frontend/src/assets/splash/about/faqs.html index f6370ce90..6b5027a8e 100644 --- a/dmp-frontend/src/assets/splash/about/faqs.html +++ b/dmp-frontend/src/assets/splash/about/faqs.html @@ -9,17 +9,14 @@ - + - + @@ -28,13 +25,11 @@ + +
+
+
+
+

Plan and follow your data

+
-

Argos

 

experience

+

Create

 
machine actionable DMPs.
-
-
-

1

 

Select Templates

-
-
-

2

 

Fill the information

-
-
-

3

 

Share DMP

-
+
+

Configure

 
to best fit your dicsipline.
+
+
+

Link

 
to EOSC components out of the box.
+
+
+

Share

 
easily in your repository.
-
- +
+

Bring your Data Management Plans closer to where data are generated, + analysed and stored.

+ +
+
+
+
+
+ +
+
+
+
+

Start your

+
+

Argos

 

experience

+
+
+
+

1

 

Select Templates

+
+
+

2

 

Fill the information

+
+
+

3

 

Share DMP

+
+
+
+
+ +
-
- -
-
-
Features
-
-
-
-
-
-
-
Produce DMP outputs
-
-
-
- Close the data management planning lifecycle by publishing your DMPs in a FAIR manner. Assign licenses, PIDs and publish DMPs in a repository of your choice. -
-
+
+
+
+ +
+
+
Features
+
+
+
+
-
-
- -
-
-
Update DMPs
-
-
-
- Treat DMPs as living documents. Secure their provenance and continue work in new versions (new DOIs assigned). -
+
+
Produce DMP outputs
+
+
+
+ Close the data management planning lifecycle by publishing your DMPs in a FAIR manner. + Assign licenses, PIDs and publish DMPs in a repository of your choice.
-
-
-
- -
-
-
Re-use datasets & templates
-
-
-
- Identify datasets to be re-used in your DMP. Copy or clone dataset descriptions to other DMPs. -
-
+
+
+
-
-
- -
-
-
Import and Export DMPs
-
-
-
- Import a .json file of your DMP and continue work in ARGOS. Export DMPs in machine readable (.xml) and machine-actionable (.json) formats. -
-
+
+
Update DMPs
-
-
-
-
- -
-
-
Customise dataset descriptions
-
-
-
- Differentiate DMPs from dataset descriptions. Describe your datasets with more than one template and tailor its content to your specific needs. -
-
-
-
-
- -
-
-
Connect with OpenAIRE & EOSC
-
-
-
- Use OpenAIRE and EOSC underlying services, sources and semantics to ease completion of DMPs and trace the quality of your research. -
+
+
+ Treat DMPs as living documents. Secure their provenance and continue work in new versions + (new DOIs assigned).
-
- -
-
-
-
-
- Who Benefits +
+
+
+
-
-
+
+
Re-use datasets & templates
+
+
+
+ Identify datasets to be re-used in your DMP. Copy or clone dataset descriptions to other + DMPs. +
+
+
+
+
+ +
+
+
Import and Export DMPs
+
+
+
+ Import a .json file of your DMP and continue work in ARGOS. Export DMPs in machine readable + (.xml) and machine-actionable (.json) formats. +
+
+
+
+
+
+
+ +
+
+
Customise dataset descriptions
+
+
+
+ Differentiate DMPs from dataset descriptions. Describe your datasets with more than one + template and tailor its content to your specific needs. +
+
+
+
+
+ +
+
+
Connect with OpenAIRE & EOSC
+
+
+
+ Use OpenAIRE and EOSC underlying services, sources and semantics to ease completion of DMPs + and trace the quality of your research. +
+
+
+
+
+
+ +
+
+
+
+
+ Who Benefits +
+
+
+
-
-
-
-
-
-
-
-
- Funders -
-
- Include DMPs in data management policies. -
-
-
- - Add, update and modify DMP templates -
-
- - Enrich your organisations’ research graph -
-
- - Link argos to your  - Monitoring Dashboard -
-
-
-
-
-
- Researchers -
-
- Become Research Data Management literate and lead Open Science cultural change/ practices. -
-
-
- - Comply with DMP requirements -
-
- - Learn and apply best practices for DMPs -
-
- - Co-edit DMPs and manage workload -
-
-
-
-
-
- Institutions -
-
- Support Open and FAIR Data Management Planning. -
-
-
- - Add, update and modify DMP templates -
-
- - Connect your organisations’ services -
-
- - Ensure research integrity and excellence -
- -
- -
-
-
-
- +
+
+
+
+ Funders +
+
+ Include DMPs in data management policies. +
+
+
+ + Add, update and modify DMP templates +
+
+ + Enrich your organisations’ research graph +
+
+ + Link argos to your  + Monitoring + Dashboard +
-
-
- - co-branding +
+
+
+
+ Researchers
-
- - ARGOS is based on OpenDMP, an open source software that can be deployed by third parties. ARGOS development team welcomes contributions by the international community to strengthen functionalities and further align with global fora. - +
+ Become Research Data Management literate and lead Open + Science cultural change/ practices.
-
-
+
+
+ + Comply with DMP requirements +
+
+ + Learn and apply best practices for DMPs +
+
+ + Co-edit DMPs and manage workload +
+
+
+
+
+
+ Institutions +
+
+ Support Open and FAIR Data Management Planning. +
+
+
+ + Add, update and modify DMP templates +
+
+ + Connect your organisations’ services +
+
+ + Ensure research integrity and excellence +
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+ + co-branding +
+
+ + ARGOS is based on OpenDMP, an open source software that can be deployed by third parties. + ARGOS development team welcomes contributions by the international community to strengthen + functionalities and further align with global fora. + +
+
- -
- -
-
-
-
- -
-
- -
-
+
+
+ + +
+
+
+
+ +
+
+ +
+
+ -
-
-
-
- - - - -
-
-
- -
-
-
-
Unless otherwise indicated, all materials created by OpenAIRE are licenced under
  -
ATTRIBUTION 4.0 INTERNATIONAL LICENSE.
+
-
- - - - - - - - +
+
+ + + + +
+
+
+ +
+
+
+
Unless otherwise indicated, all materials created by OpenAIRE are licenced under +
  + +
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/dmp-frontend/src/assets/splash/resources/co-branding.html b/dmp-frontend/src/assets/splash/resources/co-branding.html index ceba58a30..a8b7e9c69 100644 --- a/dmp-frontend/src/assets/splash/resources/co-branding.html +++ b/dmp-frontend/src/assets/splash/resources/co-branding.html @@ -9,17 +9,14 @@ - + - + @@ -27,9 +24,7 @@