Compare commits

...

7 Commits

Author SHA1 Message Date
argirok 3aa1c1ae59 fix issue with pub api #7326#note-5 the value was a number instaed of search 2022-02-18 17:41:33 +02:00
argirok cc926970ca Merge branch 'Development' of code-repo.d4science.org:MaDgiK-CITE/argos into Development
 Conflicts:
	dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts
2022-02-18 17:09:34 +02:00
argirok 93cb1fd1a7 Merge branch 'Development' of code-repo.d4science.org:MaDgiK-CITE/argos into Development 2022-02-04 15:33:31 +02:00
argirok 938f98100f Merge branch 'Development' of code-repo.d4science.org:MaDgiK-CITE/argos into Development 2022-02-04 10:05:32 +02:00
argirok 90b49194ac Merge branch 'Development' of code-repo.d4science.org:MaDgiK-CITE/argos into Development 2022-01-24 12:11:39 +02:00
argirok a3c4b3c143 Merge branch 'Development' of code-repo.d4science.org:MaDgiK-CITE/argos into Development
 Conflicts:
	dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/RemoteFetcherUtils.java
2022-01-24 11:12:56 +02:00
argirok 858fa3ee71 #7326 - static APIs
1. Rename of "Registries" to "Metadata"
2. add apis for taxonomy, licenses, publications
3. change data repositories: from querying all registered to all of type data repository
4. add separate APIs for journals and pub repositories
2022-01-21 15:44:51 +02:00
69 changed files with 2007 additions and 19 deletions

View File

@ -32,6 +32,10 @@ public class ResponsesCache {
SimpleCacheManager simpleCacheManager = new SimpleCacheManager();
List<CaffeineCache> caches = new ArrayList<CaffeineCache>();
caches.add(new CaffeineCache("repositories", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
caches.add(new CaffeineCache("pubrepos", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
caches.add(new CaffeineCache("journals", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
caches.add(new CaffeineCache("taxonomies", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
caches.add(new CaffeineCache("publications", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
caches.add(new CaffeineCache("grants", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
caches.add(new CaffeineCache("projects", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
caches.add(new CaffeineCache("funders", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));

View File

@ -0,0 +1,45 @@
package eu.eudat.controllers;
import eu.eudat.data.entities.DataRepository;
import eu.eudat.logic.managers.DataRepositoryManager;
import eu.eudat.logic.proxy.config.exceptions.HugeResultSet;
import eu.eudat.logic.proxy.config.exceptions.NoURLFound;
import eu.eudat.logic.services.ApiContext;
import eu.eudat.models.data.datarepository.DataRepositoryModel;
import eu.eudat.models.data.helpers.responses.ResponseItem;
import eu.eudat.models.data.security.Principal;
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.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@CrossOrigin
@RequestMapping(value = {"/api/external/journals"})
public class JournalsController extends BaseController {
private DataRepositoryManager dataRepositoryManager;
@Autowired
public JournalsController(ApiContext apiContext, DataRepositoryManager dataRepositoryManager) {
super(apiContext);
this.dataRepositoryManager = dataRepositoryManager;
}
@RequestMapping(method = RequestMethod.GET, produces = "application/json")
public @ResponseBody
ResponseEntity<ResponseItem<List<DataRepositoryModel>>> listExternalDataRepositories(
@RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type, Principal principal
) throws HugeResultSet, NoURLFound {
List<DataRepositoryModel> dataRepositoryModels = this.dataRepositoryManager.getJournals(query, type, principal);
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<DataRepositoryModel>>().status(ApiMessageCode.NO_MESSAGE).payload(dataRepositoryModels));
}
}

View File

@ -0,0 +1,43 @@
package eu.eudat.controllers;
import eu.eudat.logic.managers.DataRepositoryManager;
import eu.eudat.logic.proxy.config.exceptions.HugeResultSet;
import eu.eudat.logic.proxy.config.exceptions.NoURLFound;
import eu.eudat.logic.services.ApiContext;
import eu.eudat.models.data.datarepository.DataRepositoryModel;
import eu.eudat.models.data.helpers.responses.ResponseItem;
import eu.eudat.models.data.security.Principal;
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/external/pubrepos"})
public class PubRepositoriesController extends BaseController {
private DataRepositoryManager dataRepositoryManager;
@Autowired
public PubRepositoriesController(ApiContext apiContext, DataRepositoryManager dataRepositoryManager) {
super(apiContext);
this.dataRepositoryManager = dataRepositoryManager;
}
@RequestMapping(method = RequestMethod.GET, produces = "application/json")
public @ResponseBody
ResponseEntity<ResponseItem<List<DataRepositoryModel>>> listExternalDataRepositories(
@RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type, Principal principal
) throws HugeResultSet, NoURLFound {
List<DataRepositoryModel> dataRepositoryModels = this.dataRepositoryManager.getPubRepositories(query, type, principal);
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<DataRepositoryModel>>().status(ApiMessageCode.NO_MESSAGE).payload(dataRepositoryModels));
}
}

View File

@ -0,0 +1,41 @@
package eu.eudat.controllers;
import eu.eudat.logic.managers.PublicationManager;
import eu.eudat.logic.proxy.config.exceptions.HugeResultSet;
import eu.eudat.logic.proxy.config.exceptions.NoURLFound;
import eu.eudat.logic.services.ApiContext;
import eu.eudat.models.data.helpers.responses.ResponseItem;
import eu.eudat.models.data.publication.PublicationModel;
import eu.eudat.models.data.security.Principal;
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/external/publications"})
public class PublicationsController extends BaseController {
private PublicationManager publicationManager;
@Autowired
public PublicationsController(ApiContext apiContext, PublicationManager publicationManager) {
super(apiContext);
this.publicationManager = publicationManager;
}
@RequestMapping(method = RequestMethod.GET, produces = "application/json")
public @ResponseBody
ResponseEntity<ResponseItem<List<PublicationModel>>> listExternalPublications(
@RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type, Principal principal
) throws HugeResultSet, NoURLFound {
List<PublicationModel> publicationModels = this.publicationManager.getPublications(query, type);
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<PublicationModel>>().status(ApiMessageCode.NO_MESSAGE).payload(publicationModels));
}
}

View File

@ -0,0 +1,41 @@
package eu.eudat.controllers;
import eu.eudat.logic.managers.TaxonomyManager;
import eu.eudat.logic.proxy.config.exceptions.HugeResultSet;
import eu.eudat.logic.proxy.config.exceptions.NoURLFound;
import eu.eudat.logic.services.ApiContext;
import eu.eudat.models.data.helpers.responses.ResponseItem;
import eu.eudat.models.data.security.Principal;
import eu.eudat.models.data.taxonomy.TaxonomyModel;
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/external/taxonomies"})
public class TaxonomiesController extends BaseController {
private TaxonomyManager taxonomyManager;
@Autowired
public TaxonomiesController(ApiContext apiContext, TaxonomyManager taxonomyManager) {
super(apiContext);
this.taxonomyManager = taxonomyManager;
}
@RequestMapping(method = RequestMethod.GET, produces = "application/json")
public @ResponseBody
ResponseEntity<ResponseItem<List<TaxonomyModel>>> listExternalPublications(
@RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type, Principal principal
) throws HugeResultSet, NoURLFound {
List<TaxonomyModel> taxonomyModels = this.taxonomyManager.getTaxonomies(query, type);
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<TaxonomyModel>>().status(ApiMessageCode.NO_MESSAGE).payload(taxonomyModels));
}
}

View File

@ -53,6 +53,44 @@ public class DataRepositoryManager {
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
dataRepositoryModels.addAll(remoteRepos.stream().map(item -> mapper.convertValue(item, DataRepositoryModel.class)).collect(Collectors.toList()));
return dataRepositoryModels;
}
public List<DataRepositoryModel> getPubRepositories(String query, String type, Principal principal) throws HugeResultSet, NoURLFound {
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
List<Map<String, String>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getPubRepositories(externalUrlCriteria, type);
DataRepositoryCriteria criteria = new DataRepositoryCriteria();
if (!query.isEmpty()) criteria.setLike(query);
criteria.setCreationUserId(principal.getId());
List<DataRepositoryModel> dataRepositoryModels = new LinkedList<>();
if (type.equals("")) {
List<DataRepository> dataRepositoryList = (this.apiContext.getOperationsContext().getDatabaseRepository().getDataRepositoryDao().getWithCriteria(criteria)).toList();
dataRepositoryModels = dataRepositoryList.stream().map(item -> new DataRepositoryModel().fromDataModel(item)).collect(Collectors.toList());
}
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
dataRepositoryModels.addAll(remoteRepos.stream().map(item -> mapper.convertValue(item, DataRepositoryModel.class)).collect(Collectors.toList()));
return dataRepositoryModels;
}
public List<DataRepositoryModel> getJournals(String query, String type, Principal principal) throws HugeResultSet, NoURLFound {
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
List<Map<String, String>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getJournals(externalUrlCriteria, type);
DataRepositoryCriteria criteria = new DataRepositoryCriteria();
if (!query.isEmpty()) criteria.setLike(query);
criteria.setCreationUserId(principal.getId());
List<DataRepositoryModel> dataRepositoryModels = new LinkedList<>();
if (type.equals("")) {
List<DataRepository> dataRepositoryList = (this.apiContext.getOperationsContext().getDatabaseRepository().getDataRepositoryDao().getWithCriteria(criteria)).toList();
dataRepositoryModels = dataRepositoryList.stream().map(item -> new DataRepositoryModel().fromDataModel(item)).collect(Collectors.toList());
}
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
dataRepositoryModels.addAll(remoteRepos.stream().map(item -> mapper.convertValue(item, DataRepositoryModel.class)).collect(Collectors.toList()));
return dataRepositoryModels;
}
}

View File

@ -210,7 +210,7 @@ public class DatasetProfileManager {
return parseItem(listedItems.get(0));
}
if (item instanceof Map) {
return (String) ((Map)item).get("$");
return String.valueOf(((Map)item).get("$"));
}
return item != null ? item.toString() : null;
}

View File

@ -0,0 +1,42 @@
package eu.eudat.logic.managers;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.data.dao.criteria.DataRepositoryCriteria;
import eu.eudat.logic.proxy.config.ExternalUrlCriteria;
import eu.eudat.logic.proxy.config.exceptions.HugeResultSet;
import eu.eudat.logic.proxy.config.exceptions.NoURLFound;
import eu.eudat.logic.services.ApiContext;
import eu.eudat.models.data.publication.PublicationModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Component
public class PublicationManager {
private ApiContext apiContext;
@Autowired
public PublicationManager(ApiContext apiContext) {
this.apiContext = apiContext;
}
public List<PublicationModel> getPublications(String query, String type) throws HugeResultSet, NoURLFound {
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
List<Map<String, String>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getPublications(externalUrlCriteria, type);
DataRepositoryCriteria criteria = new DataRepositoryCriteria();
if (!query.isEmpty()) criteria.setLike(query);
List<PublicationModel> publicationModels = new LinkedList<>();
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
publicationModels.addAll(remoteRepos.stream().map(item -> mapper.convertValue(item, PublicationModel.class)).collect(Collectors.toList()));
// publicationModels = publicationModels.stream().filter(publicationModel -> publicationModel.getName().toLowerCase().contains(query.toLowerCase())).collect(Collectors.toList());
return publicationModels;
}
}

View File

@ -0,0 +1,43 @@
package eu.eudat.logic.managers;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.data.dao.criteria.DataRepositoryCriteria;
import eu.eudat.logic.proxy.config.ExternalUrlCriteria;
import eu.eudat.logic.proxy.config.exceptions.HugeResultSet;
import eu.eudat.logic.proxy.config.exceptions.NoURLFound;
import eu.eudat.logic.services.ApiContext;
import eu.eudat.models.data.taxonomy.TaxonomyModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Component
public class TaxonomyManager {
private ApiContext apiContext;
@Autowired
public TaxonomyManager(ApiContext apiContext) {
this.apiContext = apiContext;
}
public List<TaxonomyModel> getTaxonomies(String query, String type) throws HugeResultSet, NoURLFound {
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
List<Map<String, String>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getTaxonomies(externalUrlCriteria, type);
DataRepositoryCriteria criteria = new DataRepositoryCriteria();
if (!query.isEmpty()) criteria.setLike(query);
List<TaxonomyModel> taxonomyModels = new LinkedList<>();
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
taxonomyModels.addAll(remoteRepos.stream().map(item -> mapper.convertValue(item, TaxonomyModel.class)).collect(Collectors.toList()));
taxonomyModels = taxonomyModels.stream().filter(licenseModel -> licenseModel.getName().toLowerCase().contains(query.toLowerCase())).collect(Collectors.toList());
return taxonomyModels;
}
}

View File

@ -5,7 +5,6 @@ import eu.eudat.logic.proxy.config.entities.*;
import eu.eudat.logic.proxy.config.prefilling.PrefillingConfigMapAdapter;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.io.Serializable;
@ -22,6 +21,10 @@ public class ExternalUrls implements Serializable {
ProjectUrls projects;
RegistryUrls registries;
RepositoryUrls repositories;
PubRepositoryUrls pubRepositories;
JournalUrls journals;
TaxonomiesUrls taxonomies;
PublicationsUrls publications;
ServiceUrls services;
ResearcherUrls researchers;
OrganisationUrls organisations;
@ -52,6 +55,45 @@ public class ExternalUrls implements Serializable {
this.repositories = repositories;
}
public PubRepositoryUrls getPubRepositories() {
return pubRepositories;
}
public void setPubRepositories(PubRepositoryUrls pubRepositories) {
this.pubRepositories = pubRepositories;
}
public void setJournals(JournalUrls journals) {
this.journals = journals;
}
public JournalUrls getJournals() {
return journals;
}
public JournalUrls getJournal() {
return journals;
}
@XmlElement(name = "journals")
public void setJournal(JournalUrls journal) {
this.journals = journal;
}
public TaxonomiesUrls getTaxonomies() {
return taxonomies;
}
@XmlElement(name = "taxonomies")
public void setTaxonomies(TaxonomiesUrls taxonomies) {
this.taxonomies = taxonomies;
}
public PublicationsUrls getPublications() {
return publications;
}
public void setPublications(PublicationsUrls publications) {
this.publications = publications;
}
public ServiceUrls getServices() {
return services;

View File

@ -0,0 +1,34 @@
package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import java.util.List;
public class JournalUrls extends GenericUrls{
List<UrlConfiguration> urls;
FetchStrategy fetchMode;
public List<UrlConfiguration> getUrls() {
return urls;
}
@XmlElementWrapper
@XmlElement(name = "urlConfig")
public void setUrls(List<UrlConfiguration> urls) {
this.urls = urls;
}
public FetchStrategy getFetchMode() {
return fetchMode;
}
@XmlElement(name = "fetchMode")
public void setFetchMode(FetchStrategy fetchMode) {
this.fetchMode = fetchMode;
}
}

View File

@ -0,0 +1,34 @@
package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import java.util.List;
public class PubRepositoryUrls extends GenericUrls{
List<UrlConfiguration> urls;
FetchStrategy fetchMode;
public List<UrlConfiguration> getUrls() {
return urls;
}
@XmlElementWrapper
@XmlElement(name = "urlConfig")
public void setUrls(List<UrlConfiguration> urls) {
this.urls = urls;
}
public FetchStrategy getFetchMode() {
return fetchMode;
}
@XmlElement(name = "fetchMode")
public void setFetchMode(FetchStrategy fetchMode) {
this.fetchMode = fetchMode;
}
}

View File

@ -0,0 +1,34 @@
package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import java.util.List;
public class PublicationsUrls extends GenericUrls{
List<UrlConfiguration> urls;
FetchStrategy fetchMode;
public List<UrlConfiguration> getUrls() {
return urls;
}
@XmlElementWrapper
@XmlElement(name = "urlConfig")
public void setUrls(List<UrlConfiguration> urls) {
this.urls = urls;
}
public FetchStrategy getFetchMode() {
return fetchMode;
}
@XmlElement(name = "fetchMode")
public void setFetchMode(FetchStrategy fetchMode) {
this.fetchMode = fetchMode;
}
}

View File

@ -0,0 +1,34 @@
package eu.eudat.logic.proxy.config.entities;
import eu.eudat.logic.proxy.config.FetchStrategy;
import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import java.util.List;
public class TaxonomiesUrls extends GenericUrls{
List<UrlConfiguration> urls;
FetchStrategy fetchMode;
public List<UrlConfiguration> getUrls() {
return urls;
}
@XmlElementWrapper
@XmlElement(name = "urlConfig")
public void setUrls(List<UrlConfiguration> urls) {
this.urls = urls;
}
public FetchStrategy getFetchMode() {
return fetchMode;
}
@XmlElement(name = "fetchMode")
public void setFetchMode(FetchStrategy fetchMode) {
this.fetchMode = fetchMode;
}
}

View File

@ -50,6 +50,38 @@ public class RemoteFetcher {
FetchStrategy fetchStrategy = configLoader.getExternalUrls().getRepositories().getFetchMode();
return getAll(urlConfigs, fetchStrategy, externalUrlCriteria);
}
@Cacheable(value = "pubrepos", keyGenerator = "externalUrlsKeyGenerator")
public List<Map<String, String>> getPubRepositories(ExternalUrlCriteria externalUrlCriteria, String key) throws NoURLFound, HugeResultSet {
List<UrlConfiguration> urlConfigs =
key != null && !key.isEmpty() ? configLoader.getExternalUrls().getPubRepositories().getUrls().stream().filter(item -> item.getKey().equals(key)).collect(Collectors.toList())
: configLoader.getExternalUrls().getPubRepositories().getUrls();
FetchStrategy fetchStrategy = configLoader.getExternalUrls().getPubRepositories().getFetchMode();
return getAll(urlConfigs, fetchStrategy, externalUrlCriteria);
}
@Cacheable(value = "journals", keyGenerator = "externalUrlsKeyGenerator")
public List<Map<String, String>> getJournals(ExternalUrlCriteria externalUrlCriteria, String key) throws NoURLFound, HugeResultSet {
List<UrlConfiguration> urlConfigs =
key != null && !key.isEmpty() ? configLoader.getExternalUrls().getJournals().getUrls().stream().filter(item -> item.getKey().equals(key)).collect(Collectors.toList())
: configLoader.getExternalUrls().getJournals().getUrls();
FetchStrategy fetchStrategy = configLoader.getExternalUrls().getJournals().getFetchMode();
return getAll(urlConfigs, fetchStrategy, externalUrlCriteria);
}
@Cacheable(value = "taxonomies", keyGenerator = "externalUrlsKeyGenerator")
public List<Map<String, String>> getTaxonomies(ExternalUrlCriteria externalUrlCriteria, String key) throws NoURLFound, HugeResultSet {
List<UrlConfiguration> urlConfigs =
key != null && !key.isEmpty() ? configLoader.getExternalUrls().getTaxonomies().getUrls().stream().filter(item -> item.getKey().equals(key)).collect(Collectors.toList())
: configLoader.getExternalUrls().getTaxonomies().getUrls();
FetchStrategy fetchStrategy = configLoader.getExternalUrls().getTaxonomies().getFetchMode();
return getAll(urlConfigs, fetchStrategy, externalUrlCriteria);
}
@Cacheable(value = "publications", keyGenerator = "externalUrlsKeyGenerator")
public List<Map<String, String>> getPublications(ExternalUrlCriteria externalUrlCriteria, String key) throws NoURLFound, HugeResultSet {
List<UrlConfiguration> urlConfigs =
key != null && !key.isEmpty() ? configLoader.getExternalUrls().getPublications().getUrls().stream().filter(item -> item.getKey().equals(key)).collect(Collectors.toList())
: configLoader.getExternalUrls().getPublications().getUrls();
FetchStrategy fetchStrategy = configLoader.getExternalUrls().getPublications().getFetchMode();
return getAll(urlConfigs, fetchStrategy, externalUrlCriteria);
}
@Cacheable(value = "grants", keyGenerator = "externalUrlsKeyGenerator")
public List<Map<String, String>> getGrants(ExternalUrlCriteria externalUrlCriteria) throws NoURLFound, HugeResultSet {

View File

@ -88,6 +88,11 @@ public class ModelBuilder {
if (type.equals("datePicker")) return (FieldData<U>) new DatePickerData().fromData(data);
if (type.equals("externalDatasets")) return (FieldData<U>) new ExternalDatasetsData().fromData(data);
if (type.equals("dataRepositories")) return (FieldData<U>) new DataRepositoriesData().fromData(data);
if (type.equals("pubRepositories")) return (FieldData<U>) new DataRepositoriesData().fromData(data);
if (type.equals("journalRepositories")) return (FieldData<U>) new DataRepositoriesData().fromData(data);
if (type.equals("taxonomies")) return (FieldData<U>) new TaxonomiesData().fromData(data);
if (type.equals("licenses")) return (FieldData<U>) new LicensesData().fromData(data);
if (type.equals("publications")) return (FieldData<U>) new PublicationsData().fromData(data);
if (type.equals("registries")) return (FieldData<U>) new RegistriesData().fromData(data);
if (type.equals("services")) return (FieldData<U>) new ServicesData().fromData(data);
if (type.equals("tags")) return (FieldData<U>) new TagsData().fromData(data);
@ -128,6 +133,11 @@ public class ModelBuilder {
if (type.equals("datePicker")) return (FieldData<U>) new DatePickerData().fromData(data);
if (type.equals("externalDatasets")) return (FieldData<U>) new ExternalDatasetsData().fromData(data);
if (type.equals("dataRepositories")) return (FieldData<U>) new DataRepositoriesData().fromData(data);
if (type.equals("pubRepositories")) return (FieldData<U>) new DataRepositoriesData().fromData(data);
if (type.equals("journalRepositories")) return (FieldData<U>) new DataRepositoriesData().fromData(data);
if (type.equals("taxonomies")) return (FieldData<U>) new TaxonomiesData().fromData(data);
if (type.equals("licenses")) return (FieldData<U>) new LicensesData().fromData(data);
if (type.equals("publications")) return (FieldData<U>) new PublicationsData().fromData(data);
if (type.equals("registries")) return (FieldData<U>) new RegistriesData().fromData(data);
if (type.equals("services")) return (FieldData<U>) new ServicesData().fromData(data);
if (type.equals("tags")) return (FieldData<U>) new TagsData().fromData(data);

View File

@ -328,6 +328,11 @@ public class WordBuilder {
case "organizations":
case "externalDatasets":
case "dataRepositories":
case "pubRepositories":
case "journalRepositories":
case "taxonomies":
case "licenses":
case "publications":
case "registries":
case "services":
case "tags":

View File

@ -300,10 +300,27 @@ public class ExportXmlBuilderDatasetProfile {
dataOut.setAttribute("type", externalDatasetsData.getType());
break;
case DATA_REPOSITORIES:
case JOURNAL_REPOSITORIES:
case PUB_REPOSITORIES:
DataRepositoriesData dataRepositoriesData = (DataRepositoriesData) field.getData();
dataOut.setAttribute("label", dataRepositoriesData.getLabel());
dataOut.setAttribute("multiAutocomplete", dataRepositoriesData.getMultiAutoComplete().toString());
break;
case TAXONOMIES:
TaxonomiesData taxonomiesData = (TaxonomiesData) field.getData();
dataOut.setAttribute("label", taxonomiesData.getLabel());
dataOut.setAttribute("multiAutocomplete", taxonomiesData.getMultiAutoComplete().toString());
break;
case LICENSES:
LicensesData licensesData = (LicensesData) field.getData();
dataOut.setAttribute("label", licensesData.getLabel());
dataOut.setAttribute("multiAutocomplete", licensesData.getMultiAutoComplete().toString());
break;
case PUBLICATIONS:
PublicationsData publicationsData = (PublicationsData) field.getData();
dataOut.setAttribute("label", publicationsData.getLabel());
dataOut.setAttribute("multiAutocomplete", publicationsData.getMultiAutoComplete().toString());
break;
case ORGANIZATIONS:
OrganizationsData organizationsData = (OrganizationsData) field.getData();
dataOut.setAttribute("label", organizationsData.getLabel());

View File

@ -32,6 +32,11 @@ public class ViewStyle {
DATE_PICKER("datePicker"),
EXTERNAL_DATASETS("externalDatasets"),
DATA_REPOSITORIES("dataRepositories"),
JOURNAL_REPOSITORIES("journalRepositories"),
PUB_REPOSITORIES("pubRepositories"),
LICENSES("licenses"),
TAXONOMIES("taxonomies"),
PUBLICATIONS("publications"),
REGISTRIES("registries"),
SERVICES("services"),
TAGS("tags"),

View File

@ -0,0 +1,58 @@
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 LicensesData extends FieldData<LicensesData> {
private Boolean multiAutoComplete;
public Boolean getMultiAutoComplete() {
return multiAutoComplete;
}
public void setMultiAutoComplete(Boolean multiAutoComplete) {
this.multiAutoComplete = multiAutoComplete;
}
@Override
public LicensesData fromData(Object data) {
if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null && !((Map<String, Object>) data).get("multiAutoComplete").toString().isEmpty()? Boolean.parseBoolean(((Map<String, Object>) data).get("multiAutoComplete").toString()) : false);
}
return this;
}
@Override
public Object toData() {
return null;
}
@Override
public Element toXml(Document doc) {
Element root = doc.createElement("data");
root.setAttribute("label", this.getLabel());
if (this.getMultiAutoComplete() != null) {
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
}
return root;
}
@Override
public LicensesData fromXml(Element item) {
this.setLabel(item != null ? item.getAttribute("label") : "");
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
return this;
}
@Override
public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap();
dataMap.put("label", item != null && item.getAttributes().getLength() > 0? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0 ? item.getAttribute("multiAutocomplete") : false);
return dataMap;
}
}

View File

@ -0,0 +1,58 @@
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 PublicationsData extends FieldData<PublicationsData> {
private Boolean multiAutoComplete;
public Boolean getMultiAutoComplete() {
return multiAutoComplete;
}
public void setMultiAutoComplete(Boolean multiAutoComplete) {
this.multiAutoComplete = multiAutoComplete;
}
@Override
public PublicationsData fromData(Object data) {
if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null && !((Map<String, Object>) data).get("multiAutoComplete").toString().isEmpty()? Boolean.parseBoolean(((Map<String, Object>) data).get("multiAutoComplete").toString()) : false);
}
return this;
}
@Override
public Object toData() {
return null;
}
@Override
public Element toXml(Document doc) {
Element root = doc.createElement("data");
root.setAttribute("label", this.getLabel());
if (this.getMultiAutoComplete() != null) {
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
}
return root;
}
@Override
public PublicationsData fromXml(Element item) {
this.setLabel(item != null ? item.getAttribute("label") : "");
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
return this;
}
@Override
public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap();
dataMap.put("label", item != null && item.getAttributes().getLength() > 0? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0 ? item.getAttribute("multiAutocomplete") : false);
return dataMap;
}
}

View File

@ -0,0 +1,58 @@
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 TaxonomiesData extends FieldData<TaxonomiesData> {
private Boolean multiAutoComplete;
public Boolean getMultiAutoComplete() {
return multiAutoComplete;
}
public void setMultiAutoComplete(Boolean multiAutoComplete) {
this.multiAutoComplete = multiAutoComplete;
}
@Override
public TaxonomiesData fromData(Object data) {
if (data != null) {
this.setLabel((String) ((Map<String, Object>) data).get("label"));
this.setMultiAutoComplete(((Map<String, Object>) data).get("multiAutoComplete") != null && !((Map<String, Object>) data).get("multiAutoComplete").toString().isEmpty()? Boolean.parseBoolean(((Map<String, Object>) data).get("multiAutoComplete").toString()) : false);
}
return this;
}
@Override
public Object toData() {
return null;
}
@Override
public Element toXml(Document doc) {
Element root = doc.createElement("data");
root.setAttribute("label", this.getLabel());
if (this.getMultiAutoComplete() != null) {
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
}
return root;
}
@Override
public TaxonomiesData fromXml(Element item) {
this.setLabel(item != null ? item.getAttribute("label") : "");
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
return this;
}
@Override
public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap();
dataMap.put("label", item != null && item.getAttributes().getLength() > 0? item.getAttribute("label") : "");
dataMap.put("multiAutoComplete", item != null && item.getAttributes().getLength() > 0 ? item.getAttribute("multiAutocomplete") : false);
return dataMap;
}
}

View File

@ -0,0 +1,157 @@
package eu.eudat.models.data.publication;
import eu.eudat.data.entities.DataRepository;
import eu.eudat.data.entities.UserInfo;
import eu.eudat.models.DataModel;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
public class PublicationModel implements DataModel<DataRepository, PublicationModel> {
private UUID id;
private List<String> titles;
private List<String> ids;
private String name;
private String pid;
private String abbreviation;
private String uri;
private Date created;
private Date modified;
private String tag; // Api fetching the data
private String source; // Actual harvested source
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public List<String> getTitles() {
return titles;
}
public void setTitles(List<String> titles) {
this.titles = titles;
}
public List<String> getIds() {
return ids;
}
public void setIds(List<String> ids) {
this.ids = ids;
}
public String getAbbreviation() {
return abbreviation;
}
public void setAbbreviation(String abbreviation) {
this.abbreviation = abbreviation;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public PublicationModel fromDataModel(DataRepository entity) {
this.setAbbreviation(entity.getAbbreviation());
this.setName(entity.getLabel());
this.setTitles(new ArrayList<>());
this.getTitles().add(entity.getLabel());
this.setUri(entity.getUri());
this.setId(entity.getId());
this.setPid(entity.getReference());
String source1 = entity.getReference().substring(0, entity.getReference().indexOf(":"));
if (source1.equals("dmp")) {
this.source = "Internal";
} else {
this.source = source1;
}
return this;
}
@Override
public DataRepository toDataModel() throws Exception {
DataRepository dataRepository = new DataRepository();
dataRepository.setId(this.id != null ? this.id : UUID.randomUUID());
dataRepository.setAbbreviation(this.abbreviation);
dataRepository.setCreated(this.created != null ? this.created : new Date());
dataRepository.setModified(new Date());
dataRepository.setLabel(this.name);
if (this.source != null) {
if (this.source.equals("Internal") || this.source.equals(this.id.toString().substring(0, this.source.length()))) {
dataRepository.setReference(this.id.toString());
} else {
dataRepository.setReference(this.source + ":" + dataRepository.getId());
}
} else {
dataRepository.setReference("dmp:" + dataRepository.getId());
}
dataRepository.setUri(this.uri);
dataRepository.setStatus((short) 0);
dataRepository.setCreationUser(new UserInfo());
return dataRepository;
}
@Override
public String getHint() {
return null;
}
}

View File

@ -0,0 +1,134 @@
package eu.eudat.models.data.taxonomy;
import eu.eudat.data.entities.DataRepository;
import eu.eudat.data.entities.UserInfo;
import eu.eudat.models.DataModel;
import java.util.Date;
import java.util.UUID;
public class TaxonomyModel implements DataModel<DataRepository, TaxonomyModel> {
private UUID id;
private String name;
private String pid;
private String abbreviation;
private String uri;
private Date created;
private Date modified;
private String tag; // Api fetching the data
private String source; // Actual harvested source
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAbbreviation() {
return abbreviation;
}
public void setAbbreviation(String abbreviation) {
this.abbreviation = abbreviation;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
@Override
public TaxonomyModel fromDataModel(DataRepository entity) {
this.setAbbreviation(entity.getAbbreviation());
this.setName(entity.getLabel());
this.setUri(entity.getUri());
this.setId(entity.getId());
this.setPid(entity.getReference());
String source1 = entity.getReference().substring(0, entity.getReference().indexOf(":"));
if (source1.equals("dmp")) {
this.source = "Internal";
} else {
this.source = source1;
}
return this;
}
@Override
public DataRepository toDataModel() throws Exception {
DataRepository dataRepository = new DataRepository();
dataRepository.setId(this.id != null ? this.id : UUID.randomUUID());
dataRepository.setAbbreviation(this.abbreviation);
dataRepository.setCreated(this.created != null ? this.created : new Date());
dataRepository.setModified(new Date());
dataRepository.setLabel(this.name);
if (this.source != null) {
if (this.source.equals("Internal") || this.source.equals(this.id.toString().substring(0, this.source.length()))) {
dataRepository.setReference(this.id.toString());
} else {
dataRepository.setReference(this.source + ":" + dataRepository.getId());
}
} else {
dataRepository.setReference("dmp:" + dataRepository.getId());
}
dataRepository.setUri(this.uri);
dataRepository.setStatus((short) 0);
dataRepository.setCreationUser(new UserInfo());
return dataRepository;
}
@Override
public String getHint() {
return null;
}
}

View File

@ -496,12 +496,14 @@
<repositories>
<urls>
<urlConfig>
<!-- <urlConfig>
<key>openaire</key>
<label>OpenAIRE</label>
<ordinal>1</ordinal>
<type>External</type>
<url>https://services.openaire.eu/search/v2/api/datasources?q={like}&amp;fq=datasourcetypeuiname exact "Data Repository"&amp;page={page}&amp;size={pageSize}&amp;format=json</url>
&lt;!&ndash; <url>https://services.openaire.eu/search/v2/api/datasources?q={like}&amp;fq=datasourcetypeuiname exact "Data Repository"&amp;page={page}&amp;size={pageSize}&amp;format=json</url>&ndash;&gt;
&lt;!&ndash; Replaced with id field instead of name&ndash;&gt;
<url>https://services.openaire.eu/search/v2/api/datasources?q={like}&amp;fq=datasourcetypeuiid exact "datarepository::unknown"&amp;page={page}&amp;size={pageSize}&amp;format=json</url>
<firstPage>0</firstPage>
<contenttype>application/json;charset=UTF-8</contenttype>
<data>
@ -519,6 +521,8 @@
<label>OpenAIRE Alternative</label>
<ordinal>1</ordinal>
<type>External</type>
&lt;!&ndash; Uncomment to exclude Journals&ndash;&gt;
&lt;!&ndash; <url>https://services.openaire.eu/search/v2/api/resources?query=oaftype exact datasource and {like} and datasourcetypeuiid &lt;&gt; &quot;pubsrepository::journal&quot; and datasourcetypeuiid &lt;&gt; &quot;aggregator::pubsrepository::journals&quot;&amp;page={page}&amp;size=2&amp;format=json</url>&ndash;&gt;
<url>https://services.openaire.eu/search/v2/api/resources?query=oaftype exact datasource and {like}&amp;page={page}&amp;size={pageSize}&amp;format=json</url>
<firstPage>0</firstPage>
<contenttype>application/json;charset=UTF-8</contenttype>
@ -531,17 +535,18 @@
</fields>
</data>
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>
</urlConfig>
</urlConfig>-->
<urlConfig>
<key>openairealt2</key>
<label>Another OpenAIRE Alternative</label>
<ordinal>1</ordinal>
<type>External</type>
<request>POST</request>
<url>https://services.openaire.eu/openaire/ds/searchregistered/{page}/{pageSize}?requestSortBy=id&amp;order=ASCENDING</url>
<url>https://services.openaire.eu/openaire/ds/searchdetails/{page}/{pageSize}?requestSortBy=id&amp;order=ASCENDING</url>
<!-- <url>https://services.openaire.eu/openaire/ds/searchregistered/{page}/{pageSize}?requestSortBy=id&amp;order=ASCENDING</url>-->
<firstPage>0</firstPage>
<contenttype>application/json</contenttype>
<requestBody>{"officialname": "{like}"}</requestBody>
<requestBody>{"officialname": "{like}", "typology":"data"}</requestBody>
<data>
<path>$['datasourceInfo'][*]</path>
<fields>
@ -611,8 +616,153 @@
</urls>
<fetchMode>FIRST</fetchMode> <!-- EITHER 'FIRST' OR 'ALL' -->
</repositories>
<!--
include
pubsrepository::institutional
pubsrepository::thematic
pubsrepository::unknown
aggregator::pubsrepository::institutional
aggregator::pubsrepository::thematic
aggregator::pubsrepository::unknown
but not
pubsrepository::journal
aggregator::pubsrepository::journals-->
<pubRepositories>
<urls>
<urlConfig>
<key>openaire</key>
<label>OpenAIRE publication repositories 1</label>
<ordinal>1</ordinal>
<type>External</type>
<request>POST</request>
<url>https://services.openaire.eu/openaire/ds/searchdetails/{page}/{pageSize}?requestSortBy=id&amp;order=ASCENDING</url>
<firstPage>0</firstPage>
<contenttype>application/json</contenttype>
<requestBody>{"officialname": "{like}", "typology":"pubsrepository::institutional"}</requestBody>
<data>
<path>$['datasourceInfo'][*]</path>
<fields>
<id>'id'</id>
<name>'officialname'</name>
<count>'count'</count>
</fields>
</data>
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>
</urlConfig>
<urlConfig>
<key>openaire</key>
<label>OpenAIRE publication repositories 2</label>
<ordinal>1</ordinal>
<type>External</type>
<request>POST</request>
<url>https://services.openaire.eu/openaire/ds/searchdetails/{page}/{pageSize}?requestSortBy=id&amp;order=ASCENDING</url>
<firstPage>0</firstPage>
<contenttype>application/json</contenttype>
<requestBody>{"officialname": "{like}", "typology":"pubsrepository::thematic"}</requestBody>
<data>
<path>$['datasourceInfo'][*]</path>
<fields>
<id>'id'</id>
<name>'officialname'</name>
<count>'count'</count>
</fields>
</data>
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>
</urlConfig>
<urlConfig>
<key>openaire</key>
<label>OpenAIRE publication repositories 3</label>
<ordinal>1</ordinal>
<type>External</type>
<request>POST</request>
<url>https://services.openaire.eu/openaire/ds/searchdetails/{page}/{pageSize}?requestSortBy=id&amp;order=ASCENDING</url>
<firstPage>0</firstPage>
<contenttype>application/json</contenttype>
<requestBody>{"officialname": "{like}", "typology":"pubsrepository::unknown"}</requestBody>
<data>
<path>$['datasourceInfo'][*]</path>
<fields>
<id>'id'</id>
<name>'officialname'</name>
<count>'count'</count>
</fields>
</data>
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>
</urlConfig>
</urls>
<fetchMode>FIRST</fetchMode> <!-- EITHER 'FIRST' OR 'ALL' -->
</pubRepositories>
<journals>
<urls>
<urlConfig>
<key>openaire</key>
<label>OpenAIRE Journals</label>
<ordinal>1</ordinal>
<type>External</type>
<request>POST</request>
<url>https://services.openaire.eu/openaire/ds/searchdetails/{page}/{pageSize}?requestSortBy=id&amp;order=ASCENDING</url>
<firstPage>0</firstPage>
<contenttype>application/json</contenttype>
<requestBody>{"officialname": "{like}", "typology":"journal"}</requestBody>
<data>
<path>$['datasourceInfo'][*]</path>
<fields>
<id>'id'</id>
<name>'officialname'</name>
<count>'count'</count>
</fields>
</data>
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>
</urlConfig>
</urls>
<fetchMode>FIRST</fetchMode> <!-- EITHER 'FIRST' OR 'ALL' -->
</journals>
<taxonomies>
<urls>
<urlConfig>
<key>taxonomy</key>
<label>Taxonomies</label>
<ordinal>1</ordinal>
<type>External</type>
<url>https://eestore.paas2.uninett.no/api/taxonomy/</url>
<firstPage>0</firstPage>
<contenttype>application/vnd.api+json</contenttype>
<data>
<path>$['data'][*]['attributes']</path>
<fields>
<id>'pid'</id>
<name>'name'</name>
<count>'count'</count>
</fields>
</data>
<!-- <paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>-->
</urlConfig>
</urls>
<fetchMode>ALL</fetchMode> <!-- EITHER 'FIRST' OR 'ALL' -->
</taxonomies>
<publications>
<urls>
<urlConfig>
<key>openaire</key>
<label>OpenAIRE Publications</label>
<ordinal>1</ordinal>
<type>External</type>
<url>https://services.openaire.eu/search/v2/api/resources?query=oaftype exact result and {like}&amp;page={page}&amp;size={pageSize}&amp;format=json</url>
<firstPage>0</firstPage>
<contenttype>application/json;charset=UTF-8</contenttype>
<data>
<path>$['results'][*]['result']['metadata']['oaf:entity']['oaf:result']</path>
<fields>
<id>'originalId'</id>
<name>'title'</name>
<count>'count'</count>
</fields>
</data>
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>
</urlConfig>
</urls>
<fetchMode>FIRST</fetchMode> <!-- EITHER 'FIRST' OR 'ALL' -->
</publications>
<services>
<urls>
<urlConfig>

View File

@ -10,6 +10,11 @@ export enum DatasetProfileFieldViewStyle {
InternalDmpEntities = "internalDmpEntities",
ExternalDatasets = "externalDatasets",
DataRepositories = "dataRepositories",
PubRepositories = "pubRepositories",
JournalRepositories = "journalRepositories",
Taxonomies = "taxonomies",
Licenses = "licenses",
Publications = "publications",
Registries = "registries",
Services = "services",
Tags = "tags",

View File

@ -84,6 +84,18 @@ export interface DataRepositoriesFieldData extends FieldData {
multiAutoComplete: boolean;
}
export interface TaxonomiesFieldData extends FieldData {
multiAutoComplete: boolean;
}
export interface LicensesFieldData extends FieldData {
multiAutoComplete: boolean;
}
export interface PublicationsFieldData extends FieldData {
multiAutoComplete: boolean;
}
export interface RegistriesFieldData extends FieldData {
multiAutoComplete: boolean;
}

View File

@ -0,0 +1,9 @@
export interface LicenseModel {
id: string;
name: string;
abbreviation: string;
uri: string;
pid: string;
info: string;
source: string;
}

View File

@ -0,0 +1,9 @@
export interface PublicationModel {
id: string;
name: string;
abbreviation: string;
uri: string;
pid: string;
info: string;
source: string;
}

View File

@ -0,0 +1,9 @@
export interface TaxonomyModel {
id: string;
name: string;
abbreviation: string;
uri: string;
pid: string;
info: string;
source: string;
}

View File

@ -0,0 +1,4 @@
import { BaseCriteria } from "../base-criteria";
export class PublicationCriteria extends BaseCriteria {
public type: string;
}

View File

@ -0,0 +1,5 @@
import { BaseCriteria } from "../base-criteria";
export class TaxonomyCriteria extends BaseCriteria {
public type: string;
}

View File

@ -13,6 +13,7 @@ import { TagCriteria } from '../../query/tag/tag-criteria';
import { BaseHttpService } from '../http/base-http.service';
import { ConfigurationService } from '../configuration/configuration.service';
import { LicenseCriteria } from '@app/core/query/license/license-criteria';
import {PublicationCriteria} from "@app/core/query/publication/publication-criteria";
@Injectable()
export class ExternalSourcesService {
@ -36,6 +37,18 @@ export class ExternalSourcesService {
public searchDatasetRepository(requestItem: RequestItem<DataRepositoryCriteria>): Observable<ExternalSourceItemModel[]> {
return this.http.get<ExternalSourceItemModel[]>(this.actionUrl + 'datarepos' + '?query=' + requestItem.criteria.like + '&type=' + requestItem.criteria.type, { headers: this.headers });
}
public searchPublicationRepository(requestItem: RequestItem<DataRepositoryCriteria>): Observable<ExternalSourceItemModel[]> {
return this.http.get<ExternalSourceItemModel[]>(this.actionUrl + 'pubrepos' + '?query=' + requestItem.criteria.like + '&type=' + requestItem.criteria.type, { headers: this.headers });
}
public searchJournals(requestItem: RequestItem<DataRepositoryCriteria>): Observable<ExternalSourceItemModel[]> {
return this.http.get<ExternalSourceItemModel[]>(this.actionUrl + 'journals' + '?query=' + requestItem.criteria.like + '&type=' + requestItem.criteria.type, { headers: this.headers });
}
public searchTaxonomies(requestItem: RequestItem<TagCriteria>): Observable<ExternalSourceItemModel[]> {
return this.http.get<ExternalSourceItemModel[]>(this.actionUrl + 'taxonomies' + '?query=' + requestItem.criteria.like + '&type=' + requestItem.criteria.type, { headers: this.headers });
}
public searchPublications(requestItem: RequestItem<PublicationCriteria>): Observable<ExternalSourceItemModel[]> {
return this.http.get<ExternalSourceItemModel[]>(this.actionUrl + 'publications' + '?query=' + requestItem.criteria.like + '&type=' + requestItem.criteria.type, { headers: this.headers });
}
public searchDatasetService(requestItem: RequestItem<ServiceCriteria>): Observable<ExternalSourceItemModel[]> {
return this.http.get<ExternalSourceItemModel[]>(this.actionUrl + 'services' + '?query=' + requestItem.criteria.like + '&type=' + requestItem.criteria.type, { headers: this.headers });

View File

@ -83,6 +83,11 @@ export class EnumUtils {
case DatasetProfileFieldViewStyle.DatePicker: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.DATE-PICKER');
case DatasetProfileFieldViewStyle.ExternalDatasets: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.EXTERNAL-DATASETS');
case DatasetProfileFieldViewStyle.DataRepositories: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.DATA-REPOSITORIES');
case DatasetProfileFieldViewStyle.PubRepositories: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.PUB-REPOSITORIES');
case DatasetProfileFieldViewStyle.JournalRepositories: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.JOURNALS-REPOSITORIES');
case DatasetProfileFieldViewStyle.Taxonomies: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.TAXONOMIES');
case DatasetProfileFieldViewStyle.Licenses: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.LICENSES');
case DatasetProfileFieldViewStyle.Publications: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.PUBLICATIONS');
case DatasetProfileFieldViewStyle.Registries: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.REGISTRIES');
case DatasetProfileFieldViewStyle.Services: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.SERVICES');
case DatasetProfileFieldViewStyle.Tags: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.TAGS');
@ -106,6 +111,11 @@ export class EnumUtils {
case ViewStyleType.DatePicker: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.DATE-PICKER');
case ViewStyleType.ExternalDatasets: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.EXTERNAL-DATASETS');
case ViewStyleType.DataRepositories: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.DATA-REPOSITORIES');
case ViewStyleType.PubRepositories: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.PUB-REPOSITORIES');
case ViewStyleType.JournalRepositories: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.JOURNALS-REPOSITORIES');
case ViewStyleType.Taxonomies: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.TAXONOMIES');
case ViewStyleType.Licenses: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.LICENSES');
case ViewStyleType.Publications: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.PUBLICATIONS');
case ViewStyleType.Registries: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.REGISTRIES');
case ViewStyleType.Services: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.SERVICES');
case ViewStyleType.Tags: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.TAGS');

View File

@ -0,0 +1,21 @@
import { FormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { LicensesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class LicensesDataEditorModel extends FieldDataEditorModel<LicensesDataEditorModel> {
public label: string;
public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
});
return formGroup;
}
fromModel(item: LicensesFieldData): LicensesDataEditorModel {
this.label = item.label;
this.multiAutoComplete = item.multiAutoComplete;
return this;
}
}

View File

@ -0,0 +1,21 @@
import { FormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { PublicationsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class PublicationsDataEditorModel extends FieldDataEditorModel<PublicationsDataEditorModel> {
public label: string;
public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
});
return formGroup;
}
fromModel(item: PublicationsFieldData): PublicationsDataEditorModel {
this.label = item.label;
this.multiAutoComplete = item.multiAutoComplete;
return this;
}
}

View File

@ -0,0 +1,22 @@
import { FormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import {TaxonomiesFieldData} from "@app/core/model/dataset-profile-definition/field-data/field-data";
export class TaxonomiesDataEditorModel extends FieldDataEditorModel<TaxonomiesDataEditorModel> {
public label: string;
public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]
});
return formGroup;
}
fromModel(item: TaxonomiesFieldData): TaxonomiesDataEditorModel {
this.label = item.label;
this.multiAutoComplete = item.multiAutoComplete;
return this;
}
}

View File

@ -31,6 +31,9 @@ import { CurrencyDataEditorModel } from './field-data/currency-data-editor-model
import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type';
import { EditorCustomValidators } from '../editor/custom-validators/editor-custom-validators';
import { ValidationDataEditorModel } from './field-data/validation-data-editor-models';
import {PublicationsDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/publications-data-editor-models";
import {LicensesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/licenses-data-editor-models";
import {TaxonomiesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/taxonomies-data-editor-models";
export class FieldEditorModel extends BaseFormModel {
@ -73,6 +76,11 @@ export class FieldEditorModel extends BaseFormModel {
if (this.viewStyle.renderStyle === 'datePicker') { this.data = new DatePickerDataEditorModel().fromModel(item.data); }
if (this.viewStyle.renderStyle === 'externalDatasets') { this.data = new ExternalDatasetsDataEditorModel().fromModel(item.data); }
if (this.viewStyle.renderStyle === 'dataRepositories') { this.data = new DataRepositoriesDataEditorModel().fromModel(item.data); }
if (this.viewStyle.renderStyle === 'pubRepositories') { this.data = new DataRepositoriesDataEditorModel().fromModel(item.data); }
if (this.viewStyle.renderStyle === 'journalRepositories') { this.data = new DataRepositoriesDataEditorModel().fromModel(item.data); }
if (this.viewStyle.renderStyle === 'taxonomies') { this.data = new TaxonomiesDataEditorModel().fromModel(item.data); }
if (this.viewStyle.renderStyle === 'licenses') { this.data = new LicensesDataEditorModel().fromModel(item.data); }
if (this.viewStyle.renderStyle === 'publications') { this.data = new PublicationsDataEditorModel().fromModel(item.data); }
if (this.viewStyle.renderStyle === 'registries') { this.data = new RegistriesDataEditorModel().fromModel(item.data); }
if (this.viewStyle.renderStyle === 'services') { this.data = new ServicesDataEditorModel().fromModel(item.data); }
if (this.viewStyle.renderStyle === 'tags') { this.data = new TagsDataEditorModel().fromModel(item.data); }
@ -111,7 +119,7 @@ export class FieldEditorModel extends BaseFormModel {
// //setting up listeners
// formGroup.get('viewStyle').valueChanges.subscribe(changes=>{
// // const viewStyleChanges:{cssClass:string, renderStyle: string} = changes;
// this._removeCustomValidators(formGroup);
// this._appendCustomValidators(formGroup);

View File

@ -54,6 +54,11 @@ import { DatasetProfileTableOfContentsInternalSection } from './table-of-content
import {TransitionGroupModule} from "@app/ui/transition-group/transition-group.module";
import { RichTextEditorModule } from "@app/library/rich-text-editor/rich-text-editor.module";
import {DatasetProfileEditorRichTextAreaFieldComponent} from "@app/ui/admin/dataset-profile/editor/components/field-type/rich-textarea/dataset-profile-editor-rich-text-area-field.component";
import {DatasetProfileEditorTaxonomiesFieldComponent} from "@app/ui/admin/dataset-profile/editor/components/field-type/taxonomies/dataset-profile-editor-taxonomies-field.component";
import {DatasetProfileEditorLicensesFieldComponent} from "@app/ui/admin/dataset-profile/editor/components/field-type/licenses/dataset-profile-editor-licenses-field.component";
import {DatasetProfileEditorPublicationsFieldComponent} from "@app/ui/admin/dataset-profile/editor/components/field-type/publications/dataset-profile-editor-publications-field.component";
import {DatasetProfileEditorJournalRepositoriesFieldComponent} from "@app/ui/admin/dataset-profile/editor/components/field-type/journal-repositories/dataset-profile-editor-journal-repositories-field.component";
import {DatasetProfileEditorPubRepositoriesFieldComponent} from "@app/ui/admin/dataset-profile/editor/components/field-type/pub-repositories/dataset-profile-editor-pub-repositories-field.component";
@ -103,6 +108,11 @@ import {DatasetProfileEditorRichTextAreaFieldComponent} from "@app/ui/admin/data
ParseStatus,
DatasetProfileEditorExternalDatasetsFieldComponent,
DatasetProfileEditorDataRepositoriesFieldComponent,
DatasetProfileEditorPubRepositoriesFieldComponent,
DatasetProfileEditorJournalRepositoriesFieldComponent,
DatasetProfileEditorTaxonomiesFieldComponent,
DatasetProfileEditorLicensesFieldComponent,
DatasetProfileEditorPublicationsFieldComponent,
DatasetProfileEditorRegistriesFieldComponent,
DatasetProfileEditorServicesFieldComponent,
DatasetProfileEditorTagsFieldComponent,

View File

@ -347,6 +347,26 @@
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="DataRepositories icon">
{{enumUtils.toDatasetProfileViewTypeString(viewTypeEnum.DataRepositories)}}
</button>
<button mat-list-item (click)="addNewInput(viewTypeEnum.PubRepositories)">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="PubRepositories icon">
{{enumUtils.toDatasetProfileViewTypeString(viewTypeEnum.PubRepositories)}}
</button>
<button mat-list-item (click)="addNewInput(viewTypeEnum.JournalRepositories)">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="JournalRepositories icon">
{{enumUtils.toDatasetProfileViewTypeString(viewTypeEnum.JournalRepositories)}}
</button>
<button mat-list-item (click)="addNewInput(viewTypeEnum.Taxonomies)">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Taxonomies icon">
{{enumUtils.toDatasetProfileViewTypeString(viewTypeEnum.Taxonomies)}}
</button>
<button mat-list-item (click)="addNewInput(viewTypeEnum.Licenses)">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Licenses icon">
{{enumUtils.toDatasetProfileViewTypeString(viewTypeEnum.Licenses)}}
</button>
<button mat-list-item (click)="addNewInput(viewTypeEnum.Publications)">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Publications icon">
{{enumUtils.toDatasetProfileViewTypeString(viewTypeEnum.Publications)}}
</button>
<button mat-list-item (click)="addNewInput(viewTypeEnum.Other)">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Other icon">
{{enumUtils.toDatasetProfileViewTypeString(viewTypeEnum.Other)}}

View File

@ -42,7 +42,10 @@ import {
TextAreaFieldData,
RichTextAreaFieldData,
ValidationFieldData,
WordListFieldData
WordListFieldData,
TaxonomiesFieldData,
LicensesFieldData,
PublicationsFieldData
} from '@app/core/model/dataset-profile-definition/field-data/field-data';
import {CompositeField} from '@app/core/model/dataset-profile-definition/composite-field';
import {Field as FieldDefinition} from '@app/core/model/dataset-profile-definition/field';
@ -742,6 +745,67 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
break;
}
case this.viewTypeEnum.PubRepositories:{
const data: DataRepositoriesFieldData = {
label: '',
multiAutoComplete: false
}
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.DataRepositories;
field.data = data;
break;
}
case this.viewTypeEnum.JournalRepositories:{
const data: DataRepositoriesFieldData = {
label: '',
multiAutoComplete: false
}
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.DataRepositories;
field.data = data;
break;
}
case this.viewTypeEnum.Taxonomies:{
const data: TaxonomiesFieldData = {
label: '',
multiAutoComplete: false
}
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Taxonomies;
field.data = data;
break;
}
case this.viewTypeEnum.Licenses:{
const data: LicensesFieldData = {
label: '',
multiAutoComplete: false
}
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Licenses;
field.data = data;
break;
}
case this.viewTypeEnum.Publications:{
const data: PublicationsFieldData = {
label: '',
multiAutoComplete: false
}
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Publications;
field.data = data;
break;
}
case this.viewTypeEnum.Registries:{

View File

@ -0,0 +1,12 @@
<div class="row" *ngIf="form.get('data')">
<h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-JOURNALS-REPOSITORIES-TITLE'
| translate}}</h5>
<mat-checkbox class="col-auto" [formControl]="this.form.get('data').get('multiAutoComplete')" name="multi">
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-MULTIPLE-AUTOCOMPLETE' | translate}}
</mat-checkbox>
<mat-form-field class="col-12">
<mat-label>{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-JOURNALS-REPOSITORIES-PLACEHOLDER' | translate}}</mat-label>
<input matInput type="string"
[formControl]="form.get('data').get('label')">
</mat-form-field>
</div>

View File

@ -0,0 +1,19 @@
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';
import { FormControl } from '@angular/forms';
@Component({
selector: 'app-dataset-profile-editor-journal-repositories-field-component',
styleUrls: ['./dataset-profile-editor-journal-repositories-field.component.scss'],
templateUrl: './dataset-profile-editor-journal-repositories-field.component.html'
})
export class DatasetProfileEditorJournalRepositoriesFieldComponent implements OnInit {
@Input() form: FormGroup;
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
ngOnInit() {
if (!this.form.get('data')) { this.form.addControl('data', this.data.buildForm()); }
}
}

View File

@ -0,0 +1,12 @@
<div class="row" *ngIf="form.get('data')">
<h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-LICENSES-TITLE'
| translate}}</h5>
<mat-checkbox class="col-auto" [formControl]="this.form.get('data').get('multiAutoComplete')">
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-MULTIPLE-AUTOCOMPLETE' | translate}}
</mat-checkbox>
<mat-form-field class="col-12">
<mat-label>{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-LICENSES-PLACEHOLDER' | translate}}</mat-label>
<input matInput type="string"
[formControl]="form.get('data').get('label')">
</mat-form-field>
</div>

View File

@ -0,0 +1,18 @@
import {Component, Input, OnInit} from '@angular/core';
import {FormGroup} from '@angular/forms';
import {LicensesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/licenses-data-editor-models";
@Component({
selector: 'app-dataset-profile-editor-licenses-field-component',
styleUrls: ['./dataset-profile-editor-licenses-field.component.scss'],
templateUrl: './dataset-profile-editor-licenses-field.component.html'
})
export class DatasetProfileEditorLicensesFieldComponent implements OnInit {
@Input() form: FormGroup;
private data: LicensesDataEditorModel = new LicensesDataEditorModel();
ngOnInit() {
if (!this.form.get('data')) { this.form.addControl('data', this.data.buildForm()); }
}
}

View File

@ -0,0 +1,12 @@
<div class="row" *ngIf="form.get('data')">
<h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-PUB-REPOSITORIES-TITLE'
| translate}}</h5>
<mat-checkbox class="col-auto" [formControl]="this.form.get('data').get('multiAutoComplete')">
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-MULTIPLE-AUTOCOMPLETE' | translate}}
</mat-checkbox>
<mat-form-field class="col-12">
<mat-label>{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-PUB-REPOSITORIES-PLACEHOLDER' | translate}}</mat-label>
<input matInput type="string"
[formControl]="form.get('data').get('label')">
</mat-form-field>
</div>

View File

@ -0,0 +1,20 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models';
import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models';
import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models';
@Component({
selector: 'app-dataset-profile-editor-pub-repositories-field-component',
styleUrls: ['./dataset-profile-editor-pub-repositories-field.component.scss'],
templateUrl: './dataset-profile-editor-pub-repositories-field.component.html'
})
export class DatasetProfileEditorPubRepositoriesFieldComponent implements OnInit {
@Input() form: FormGroup;
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
ngOnInit() {
if (!this.form.get('data')) { this.form.addControl('data', this.data.buildForm()); }
}
}

View File

@ -0,0 +1,12 @@
<div class="row" *ngIf="form.get('data')">
<h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-PUBLICATIONS-TITLE'
| translate}}</h5>
<mat-checkbox class="col-auto" [formControl]="this.form.get('data').get('multiAutoComplete')">
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-MULTIPLE-AUTOCOMPLETE' | translate}}
</mat-checkbox>
<mat-form-field class="col-12">
<mat-label>{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-PUBLICATIONS-PLACEHOLDER' | translate}}</mat-label>
<input matInput type="string"
[formControl]="form.get('data').get('label')">
</mat-form-field>
</div>

View File

@ -0,0 +1,18 @@
import {Component, Input, OnInit} from '@angular/core';
import {FormGroup} from '@angular/forms';
import {PublicationsDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/publications-data-editor-models";
@Component({
selector: 'app-dataset-profile-editor-publications-field-component',
styleUrls: ['./dataset-profile-editor-publications-field.component.scss'],
templateUrl: './dataset-profile-editor-publications-field.component.html'
})
export class DatasetProfileEditorPublicationsFieldComponent implements OnInit {
@Input() form: FormGroup;
private data: PublicationsDataEditorModel = new PublicationsDataEditorModel();
ngOnInit() {
if (!this.form.get('data')) { this.form.addControl('data', this.data.buildForm()); }
}
}

View File

@ -0,0 +1,12 @@
<div class="row" *ngIf="form.get('data')">
<h5 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-TAXONOMIES-TITLE'
| translate}}</h5>
<mat-checkbox class="col-auto" [formControl]="this.form.get('data').get('multiAutoComplete')">
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-MULTIPLE-AUTOCOMPLETE' | translate}}
</mat-checkbox>
<mat-form-field class="col-12">
<mat-label>{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-TAXONOMIES-PLACEHOLDER' | translate}}</mat-label>
<input matInput type="string"
[formControl]="form.get('data').get('label')">
</mat-form-field>
</div>

View File

@ -0,0 +1,18 @@
import {Component, Input, OnInit} from '@angular/core';
import {FormGroup} from '@angular/forms';
import {TaxonomiesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/taxonomies-data-editor-models";
@Component({
selector: 'app-dataset-profile-editor-taxonomies-field-component',
styleUrls: ['./dataset-profile-editor-taxonomies-field.component.scss'],
templateUrl: './dataset-profile-editor-taxonomies-field.component.html'
})
export class DatasetProfileEditorTaxonomiesFieldComponent implements OnInit {
@Input() form: FormGroup;
private data: TaxonomiesDataEditorModel = new TaxonomiesDataEditorModel();
ngOnInit() {
if (!this.form.get('data')) { this.form.addControl('data', this.data.buildForm()); }
}
}

View File

@ -147,6 +147,26 @@
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="DataRepositories icon">
{{enumUtils.toDatasetProfileViewTypeString(viewTypeEnum.DataRepositories)}}
</mat-option>
<mat-option [value]="viewTypeEnum.PubRepositories">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="PubRepositories icon">
{{enumUtils.toDatasetProfileViewTypeString(viewTypeEnum.PubRepositories)}}
</mat-option>
<mat-option [value]="viewTypeEnum.JournalRepositories">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Journal Repositories icon">
{{enumUtils.toDatasetProfileViewTypeString(viewTypeEnum.JournalRepositories)}}
</mat-option>
<mat-option [value]="viewTypeEnum.Taxonomies">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Taxonomies icon">
{{enumUtils.toDatasetProfileViewTypeString(viewTypeEnum.Taxonomies)}}
</mat-option>
<mat-option [value]="viewTypeEnum.Licenses">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="licenses icon">
{{enumUtils.toDatasetProfileViewTypeString(viewTypeEnum.Licenses)}}
</mat-option>
<mat-option [value]="viewTypeEnum.Publications">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Publications icon">
{{enumUtils.toDatasetProfileViewTypeString(viewTypeEnum.Publications)}}
</mat-option>
<mat-option [value]="viewTypeEnum.Other">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Other icon">
{{enumUtils.toDatasetProfileViewTypeString(viewTypeEnum.Other)}}
@ -246,6 +266,11 @@
<app-dataset-profile-editor-external-datasets-field-component *ngSwitchCase="viewStyleEnum.ExternalDatasets" class="col-12" [form]="form"></app-dataset-profile-editor-external-datasets-field-component>
<app-dataset-profile-editor-data-repositories-field-component *ngSwitchCase="viewStyleEnum.DataRepositories" class="col-12" [form]="form"></app-dataset-profile-editor-data-repositories-field-component>
<app-dataset-profile-editor-pub-repositories-field-component *ngSwitchCase="viewStyleEnum.PubRepositories" class="col-12" [form]="form"></app-dataset-profile-editor-pub-repositories-field-component>
<app-dataset-profile-editor-journal-repositories-field-component *ngSwitchCase="viewStyleEnum.JournalRepositories" class="col-12" [form]="form"></app-dataset-profile-editor-journal-repositories-field-component>
<app-dataset-profile-editor-taxonomies-field-component *ngSwitchCase="viewStyleEnum.Taxonomies" class="col-12" [form]="form"></app-dataset-profile-editor-taxonomies-field-component>
<app-dataset-profile-editor-licenses-field-component *ngSwitchCase="viewStyleEnum.Licenses" class="col-12" [form]="form"></app-dataset-profile-editor-licenses-field-component>
<app-dataset-profile-editor-publications-field-component *ngSwitchCase="viewStyleEnum.Publications" class="col-12" [form]="form"></app-dataset-profile-editor-publications-field-component>
<app-dataset-profile-editor-registries-field-component *ngSwitchCase="viewStyleEnum.Registries" class="col-12" [form]="form"></app-dataset-profile-editor-registries-field-component>
<app-dataset-profile-editor-services-field-component *ngSwitchCase="viewStyleEnum.Services" class="col-12" [form]="form"></app-dataset-profile-editor-services-field-component>
<app-dataset-profile-editor-tags-field-component *ngSwitchCase="viewStyleEnum.Tags" class="col-12" [form]="form"></app-dataset-profile-editor-tags-field-component>

View File

@ -27,13 +27,16 @@ import {
ExternalDatasetsFieldData,
FieldDataOption,
FreeTextFieldData,
LicensesFieldData,
OrganizationsFieldData,
PublicationsFieldData,
RadioBoxFieldData,
RegistriesFieldData,
ResearchersAutoCompleteFieldData,
RichTextAreaFieldData,
ServicesFieldData,
TagsFieldData,
TaxonomiesFieldData,
TextAreaFieldData,
ValidationFieldData,
WordListFieldData
@ -143,6 +146,21 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
case DatasetProfileFieldViewStyle.DataRepositories:
this.viewType = this.viewTypeEnum.DataRepositories;
break;
case DatasetProfileFieldViewStyle.PubRepositories:
this.viewType = this.viewTypeEnum.PubRepositories;
break;
case DatasetProfileFieldViewStyle.JournalRepositories:
this.viewType = this.viewTypeEnum.JournalRepositories;
break;
case DatasetProfileFieldViewStyle.Taxonomies:
this.viewType = this.viewTypeEnum.Taxonomies;
break;
case DatasetProfileFieldViewStyle.Licenses:
this.viewType = this.viewTypeEnum.Licenses;
break;
case DatasetProfileFieldViewStyle.Publications:
this.viewType = this.viewTypeEnum.Publications;
break;
case DatasetProfileFieldViewStyle.Registries:
this.viewType = this.viewTypeEnum.Registries;
break;
@ -654,6 +672,66 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
break;
}
case this.viewTypeEnum.PubRepositories:{
const data: DataRepositoriesFieldData = {
label: '',
multiAutoComplete: false
}
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.PubRepositories;
field.data = data;
break;
}
case this.viewTypeEnum.JournalRepositories:{
const data: DataRepositoriesFieldData = {
label: '',
multiAutoComplete: false
}
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.JournalRepositories;
field.data = data;
break;
}
case this.viewTypeEnum.Taxonomies:{
const data: TaxonomiesFieldData = {
label: '',
multiAutoComplete: false
}
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Taxonomies;
field.data = data;
break;
}
case this.viewTypeEnum.Licenses:{
const data: LicensesFieldData = {
label: '',
multiAutoComplete: false
}
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Licenses;
field.data = data;
break;
}
case this.viewTypeEnum.Publications:{
const data: PublicationsFieldData = {
label: '',
multiAutoComplete: false
}
field.viewStyle.renderStyle = DatasetProfileFieldViewStyle.Publications;
field.data = data;
break;
}
case this.viewTypeEnum.Registries:{

View File

@ -9,6 +9,11 @@ export enum ViewStyleType{
InternalDmpEntities = "internalDmpEntities",
ExternalDatasets = "externalDatasets",
DataRepositories = "dataRepositories",
PubRepositories = "pubRepositories",
JournalRepositories = "journalRepositories",
Taxonomies = "taxonomies",
Licenses = "licenses",
Publications = "publications",
Registries = "registries",
Services = "services",
Tags = "tags",

View File

@ -190,6 +190,104 @@
</mat-form-field>
</div>
</div>
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.PubRepositories" class="col-12">
<div class="row">
<mat-form-field class="col-md-12">
<ng-container *ngIf="form.get('data').value.multiAutoComplete">
<app-multiple-auto-complete placeholder="{{ (form.get('data').value.label | translate) + (form.get('validationRequired').value? ' *': '') }}" [formControl]="form.get('value')"
[configuration]="pubRepositoriesAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
</app-multiple-auto-complete>
</ng-container>
<ng-container *ngIf="!(form.get('data').value.multiAutoComplete)">
<app-single-auto-complete placeholder="{{ (form.get('data').value.label | translate) + (form.get('validationRequired').value? ' *': '') }}" [formControl]="form.get('value')"
[configuration]="pubRepositoriesAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
</app-single-auto-complete>
</ng-container>
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field>
</div>
</div>
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.JournalRepositories" class="col-12">
<div class="row">
<mat-form-field class="col-md-12">
<ng-container *ngIf="form.get('data').value.multiAutoComplete">
<app-multiple-auto-complete placeholder="{{ (form.get('data').value.label | translate) + (form.get('validationRequired').value? ' *': '') }}" [formControl]="form.get('value')"
[configuration]="journalRepositoriesAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
</app-multiple-auto-complete>
</ng-container>
<ng-container *ngIf="!(form.get('data').value.multiAutoComplete)">
<app-single-auto-complete placeholder="{{ (form.get('data').value.label | translate) + (form.get('validationRequired').value? ' *': '') }}" [formControl]="form.get('value')"
[configuration]="journalRepositoriesAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
</app-single-auto-complete>
</ng-container>
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field>
</div>
</div>
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.Taxonomies" class="col-12">
<div *ngIf="form.get('data').value" class="row">
<mat-form-field class="col-md-12">
<ng-container *ngIf="form.get('data').value.multiAutoComplete">
<app-multiple-auto-complete placeholder="{{ (form.get('data').value.label | translate) + (form.get('validationRequired').value? ' *': '') }}" [formControl]="form.get('value')"
[configuration]="taxonomiesAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
</app-multiple-auto-complete>
</ng-container>
<ng-container *ngIf="!(form.get('data').value.multiAutoComplete)">
<app-single-auto-complete placeholder="{{ (form.get('data').value.label | translate) + (form.get('validationRequired').value? ' *': '') }}" [formControl]="form.get('value')"
[configuration]="taxonomiesAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
</app-single-auto-complete>
</ng-container>
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field>
</div>
</div>
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.Licenses" class="col-12">
<div *ngIf="form.get('data').value" class="row">
<mat-form-field class="col-md-12">
<ng-container *ngIf="form.get('data').value.multiAutoComplete">
<app-multiple-auto-complete placeholder="{{ (form.get('data').value.label | translate) + (form.get('validationRequired').value? ' *': '') }}" [formControl]="form.get('value')"
[configuration]="licensesAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
</app-multiple-auto-complete>
</ng-container>
<ng-container *ngIf="!(form.get('data').value.multiAutoComplete)">
<app-single-auto-complete placeholder="{{ (form.get('data').value.label | translate) + (form.get('validationRequired').value? ' *': '') }}" [formControl]="form.get('value')"
[configuration]="licensesAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
</app-single-auto-complete>
</ng-container>
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field>
</div>
</div>
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.Publications" class="col-12">
<div *ngIf="form.get('data').value" class="row">
<mat-form-field class="col-md-12">
<ng-container *ngIf="form.get('data').value.multiAutoComplete">
<app-multiple-auto-complete placeholder="{{ (form.get('data').value.label | translate) + (form.get('validationRequired').value? ' *': '') }}" [formControl]="form.get('value')"
[configuration]="publicationsAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
</app-multiple-auto-complete>
</ng-container>
<ng-container *ngIf="!(form.get('data').value.multiAutoComplete)">
<app-single-auto-complete placeholder="{{ (form.get('data').value.label | translate) + (form.get('validationRequired').value? ' *': '') }}" [formControl]="form.get('value')"
[configuration]="publicationsAutoCompleteConfiguration" [required]="form.get('validationRequired').value">
</app-single-auto-complete>
</ng-container>
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field>
</div>
</div>
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.Registries" class="col-12">
<div class="row">

View File

@ -35,6 +35,9 @@ 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';
import { AutoCompleteSingleData } from '@app/core/model/dataset-profile-definition/field-data/field-data';
import {LicenseCriteria} from "@app/core/query/license/license-criteria";
import {TaxonomyCriteria} from "@app/core/query/taxonomy/taxonomy-criteria";
import {PublicationCriteria} from "@app/core/query/publication/publication-criteria";
@Component({
selector: 'app-form-field',
@ -68,6 +71,11 @@ export class FormFieldComponent extends BaseComponent implements OnInit {
datasetProfileInternalDmpEntitiesTypeEnum = DatasetProfileInternalDmpEntitiesType;
externalDatasetAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
dataRepositoriesAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
pubRepositoriesAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
journalRepositoriesAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
taxonomiesAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
licensesAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
publicationsAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
registriesAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
servicesAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
tagsAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
@ -188,6 +196,56 @@ export class FormFieldComponent extends BaseComponent implements OnInit {
valueAssign: (item) => { try { return typeof (item) == 'string' ? item : JSON.stringify(item) } catch { return '' } }
};
break;
case DatasetProfileFieldViewStyle.PubRepositories:
this.pubRepositoriesAutoCompleteConfiguration = {
filterFn: this.searchDatasetExternalPubRepositories.bind(this),
initialItems: () => this.searchDatasetExternalPubRepositories(''),
displayFn: (item) => { try{return typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name}catch{return''}},
titleFn: (item) => { try{return typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name}catch{return''}},
subtitleFn: (item) => { try{return item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')}catch{return''}},
valueAssign: (item) => { try{return typeof (item) == 'string' ? item : JSON.stringify(item)}catch{return''}}
};
break;
case DatasetProfileFieldViewStyle.JournalRepositories:
this.journalRepositoriesAutoCompleteConfiguration = {
filterFn: this.searchDatasetExternalJournalRepositories.bind(this),
initialItems: () => this.searchDatasetExternalJournalRepositories(''),
displayFn: (item) => { try{return typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name}catch{return''}},
titleFn: (item) => { try{return typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name}catch{return''}},
subtitleFn: (item) => { try{return item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')}catch{return''}},
valueAssign: (item) => { try{return typeof (item) == 'string' ? item : JSON.stringify(item)}catch{return''}}
};
break;
case DatasetProfileFieldViewStyle.Taxonomies:
this.taxonomiesAutoCompleteConfiguration = {
filterFn: this.searchDatasetExternalTaxonomies.bind(this),
initialItems: () => this.searchDatasetExternalTaxonomies(''),
displayFn: (item) => { try{return typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name}catch{return''}},
titleFn: (item) => { try{return typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name}catch{return''}},
subtitleFn: (item) => { try{return item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')}catch{return''}},
valueAssign: (item) => { try{return typeof (item) == 'string' ? item : JSON.stringify(item)}catch{return''}}
};
break;
case DatasetProfileFieldViewStyle.Licenses:
this.licensesAutoCompleteConfiguration = {
filterFn: this.searchDatasetExternalLicences.bind(this),
initialItems: () => this.searchDatasetExternalLicences(''),
displayFn: (item) => { try{return typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name}catch{return''}},
titleFn: (item) => { try{return typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name}catch{return''}},
subtitleFn: (item) => { try{return item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')}catch{return''}},
valueAssign: (item) => { try{return typeof (item) == 'string' ? item : JSON.stringify(item)}catch{return''}}
};
break;
case DatasetProfileFieldViewStyle.Publications:
this.publicationsAutoCompleteConfiguration = {
filterFn: this.searchDatasetExternalPublications.bind(this),
initialItems: () => this.searchDatasetExternalPublications(''),
displayFn: (item) => { try{return typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name}catch{return''}},
titleFn: (item) => { try{return typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name}catch{return''}},
subtitleFn: (item) => { try{return item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')}catch{return''}},
valueAssign: (item) => { try{return typeof (item) == 'string' ? item : JSON.stringify(item)}catch{return''}}
};
break;
case DatasetProfileFieldViewStyle.Registries:
this.registriesAutoCompleteConfiguration = {
filterFn: this.searchDatasetExternalRegistries.bind(this),
@ -385,6 +443,41 @@ export class FormFieldComponent extends BaseComponent implements OnInit {
requestItem.criteria.type = '';
return this.externalSourcesService.searchDatasetRepository(requestItem);
}
searchDatasetExternalPubRepositories(query: string): Observable<ExternalSourceItemModel[]> {
const requestItem: RequestItem<DataRepositoryCriteria> = new RequestItem();
requestItem.criteria = new DataRepositoryCriteria();
requestItem.criteria.like = query;
requestItem.criteria.type = '';
return this.externalSourcesService.searchPublicationRepository(requestItem);
}
searchDatasetExternalJournalRepositories(query: string): Observable<ExternalSourceItemModel[]> {
const requestItem: RequestItem<DataRepositoryCriteria> = new RequestItem();
requestItem.criteria = new DataRepositoryCriteria();
requestItem.criteria.like = query;
requestItem.criteria.type = '';
return this.externalSourcesService.searchJournals(requestItem);
}
searchDatasetExternalTaxonomies(query: string): Observable<ExternalSourceItemModel[]> {
const requestItem: RequestItem<TaxonomyCriteria> = new RequestItem();
requestItem.criteria = new TaxonomyCriteria();
requestItem.criteria.like = query;
requestItem.criteria.type = '';
return this.externalSourcesService.searchTaxonomies(requestItem);
}
searchDatasetExternalLicences(query: string): Observable<ExternalSourceItemModel[]> {
const requestItem: RequestItem<LicenseCriteria> = new RequestItem();
requestItem.criteria = new LicenseCriteria();
requestItem.criteria.like = query;
requestItem.criteria.type = '';
return this.externalSourcesService.searchLicense(requestItem);
}
searchDatasetExternalPublications(query: string): Observable<ExternalSourceItemModel[]> {
const requestItem: RequestItem<PublicationCriteria> = new RequestItem();
requestItem.criteria = new PublicationCriteria();
requestItem.criteria.like = query;
requestItem.criteria.type = '';
return this.externalSourcesService.searchPublications(requestItem);
}
searchDatasetExternalRegistries(query: string): Observable<ExternalSourceItemModel[]> {
const requestItem: RequestItem<RegistryCriteria> = new RequestItem();

View File

@ -438,7 +438,7 @@
"FIELD-MULTIPLE-WORDLIST": "Multiple Selection",
"FIELD-CURRENCY-TITLE": "Currency Data",
"FIELD-CURRENCY-PLACEHOLDER": "Input Placeholder Text",
"FIELD-REGISTRIES-TITLE": "Registries Data",
"FIELD-REGISTRIES-TITLE": "Metadata",
"FIELD-REGISTRIES-PLACEHOLDER": "Input Placeholder Text",
"FIELD-SERVICES-TITLE": "Services Data",
"FIELD-SERVICES-PLACEHOLDER": "Input Placeholder Text",
@ -448,6 +448,16 @@
"FIELD-EXTERNAL-DATASETS-PLACEHOLDER": "Input placeholder",
"FIELD-DATA-REPOSITORIES-TITLE": "Data Repositories Data Text",
"FIELD-DATA-REPOSITORIES-PLACEHOLDER": "Input placeholder",
"FIELD-PUB-REPOSITORIES-TITLE": "Publication repositories",
"FIELD-PUB-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-JOURNALS-REPOSITORIES-TITLE": "Journals",
"FIELD-JOURNALS-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-TAXONOMIES-TITLE": "Taxonomies Data",
"FIELD-TAXONOMIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-LICENSES-TITLE": "Licenses Data",
"FIELD-LICENSES-PLACEHOLDER": "Input placeholder Text",
"FIELD-PUBLICATIONS-TITLE": "Publications Data",
"FIELD-PUBLICATIONS-PLACEHOLDER": "Input placeholder Text",
"FIELD-TAGS-TITLE": "Tags Data",
"FIELD-TAGS-PLACEHOLDER": "Input placeholder Text",
"FIELD-DATASET-IDENTIFIER-TITLE": "Dataset Identifier Data",
@ -1377,7 +1387,12 @@
"DATE-PICKER": "Date Picker",
"EXTERNAL-DATASETS": "External Datasets",
"DATA-REPOSITORIES": "Data Repositories",
"REGISTRIES": "Registries",
"PUB-REPOSITORIES": "Publication Repositories",
"JOURNALS-REPOSITORIES": "Journals",
"TAXONOMIES": "Taxonomies",
"LICENSES": "Licenses",
"PUBLICATIONS": "Publications",
"REGISTRIES": "Metadata",
"SERVICES": "Services",
"TAGS": "Tags",
"RESEARCHERS": "Researchers",

View File

@ -438,7 +438,7 @@
"FIELD-MULTIPLE-WORDLIST": "Multiple Selection",
"FIELD-CURRENCY-TITLE": "Currency Data",
"FIELD-CURRENCY-PLACEHOLDER": "Input Placeholder Text",
"FIELD-REGISTRIES-TITLE": "Registries Data",
"FIELD-REGISTRIES-TITLE": "Metadata",
"FIELD-REGISTRIES-PLACEHOLDER": "Input Placeholder Text",
"FIELD-SERVICES-TITLE": "Services Data",
"FIELD-SERVICES-PLACEHOLDER": "Input Placeholder Text",
@ -448,6 +448,16 @@
"FIELD-EXTERNAL-DATASETS-PLACEHOLDER": "Input placeholder Text",
"FIELD-DATA-REPOSITORIES-TITLE": "Data Repositories Data",
"FIELD-DATA-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-PUB-REPOSITORIES-TITLE": "Publication repositories",
"FIELD-PUB-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-JOURNALS-REPOSITORIES-TITLE": "Journals",
"FIELD-JOURNALS-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-TAXONOMIES-TITLE": "Taxonomies Data",
"FIELD-TAXONOMIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-LICENSES-TITLE": "Licenses Data",
"FIELD-LICENSES-PLACEHOLDER": "Input placeholder Text",
"FIELD-PUBLICATIONS-TITLE": "Publications Data",
"FIELD-PUBLICATIONS-PLACEHOLDER": "Input placeholder Text",
"FIELD-TAGS-TITLE": "Tags Data",
"FIELD-TAGS-PLACEHOLDER": "Input placeholder Text",
"FIELD-DATASET-IDENTIFIER-TITLE": "Dataset Identifier Data",
@ -1377,7 +1387,12 @@
"DATE-PICKER": "Date Picker",
"EXTERNAL-DATASETS": "External Datasets",
"DATA-REPOSITORIES": "Data Repositories",
"REGISTRIES": "Registries",
"PUB-REPOSITORIES": "Publication Repositories",
"JOURNALS-REPOSITORIES": "Journals",
"TAXONOMIES": "Taxonomies",
"LICENSES": "Licenses",
"PUBLICATIONS": "Publications",
"REGISTRIES": "Metadata",
"SERVICES": "Services",
"TAGS": "Tags",
"RESEARCHERS": "Researchers",

View File

@ -448,6 +448,16 @@
"FIELD-EXTERNAL-DATASETS-PLACEHOLDER": "Introduzca marcador del texto",
"FIELD-DATA-REPOSITORIES-TITLE": "Datos de Repositorios de Datos",
"FIELD-DATA-REPOSITORIES-PLACEHOLDER": "Introduzca marcador del texto",
"FIELD-PUB-REPOSITORIES-TITLE": "Publication repositories",
"FIELD-PUB-REPOSITORIES-PLACEHOLDER": "Introduzca marcador del texto",
"FIELD-JOURNALS-REPOSITORIES-TITLE": "Journals",
"FIELD-JOURNALS-REPOSITORIES-PLACEHOLDER": "Introduzca marcador del texto",
"FIELD-TAXONOMIES-TITLE": "Taxonomies Data",
"FIELD-TAXONOMIES-PLACEHOLDER": "Introduzca marcador del texto",
"FIELD-LICENSES-TITLE": "Licenses Data",
"FIELD-LICENSES-PLACEHOLDER": "Introduzca marcador del texto",
"FIELD-PUBLICATIONS-TITLE": "Publications Data",
"FIELD-PUBLICATIONS-PLACEHOLDER": "Introduzca marcador del texto",
"FIELD-TAGS-TITLE": "Datos de etiquetas",
"FIELD-TAGS-PLACEHOLDER": "Introduzca marcador del texto",
"FIELD-DATASET-IDENTIFIER-TITLE": "Datos del identifcador del dataset",
@ -1376,6 +1386,11 @@
"DATE-PICKER": "Campo de entrada para fecha",
"EXTERNAL-DATASETS": "Datasets externos",
"DATA-REPOSITORIES": "Repositorios de datos",
"PUB-REPOSITORIES": "Publication Repositories",
"JOURNALS-REPOSITORIES": "Journals",
"TAXONOMIES": "Taxonomies",
"LICENSES": "Licenses",
"PUBLICATIONS": "Publications",
"REGISTRIES": "Registros",
"SERVICES": "Servicios",
"TAGS": "Etiquetas",

View File

@ -438,7 +438,7 @@
"FIELD-MULTIPLE-WORDLIST": "Πολλαπλή Επιλογή",
"FIELD-CURRENCY-TITLE": "Currency Data",
"FIELD-CURRENCY-PLACEHOLDER": "Input Placeholder Text",
"FIELD-REGISTRIES-TITLE": "Registries Data",
"FIELD-REGISTRIES-TITLE": "Metadata",
"FIELD-REGISTRIES-PLACEHOLDER": "Input Placeholder Text",
"FIELD-SERVICES-TITLE": "Services Data",
"FIELD-SERVICES-PLACEHOLDER": "Input Placeholder Text",
@ -448,6 +448,16 @@
"FIELD-EXTERNAL-DATASETS-PLACEHOLDER": "Input placeholder Text",
"FIELD-DATA-REPOSITORIES-TITLE": "Data Repositories Data",
"FIELD-DATA-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-PUB-REPOSITORIES-TITLE": "Publication repositories",
"FIELD-PUB-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-JOURNALS-REPOSITORIES-TITLE": "Journals",
"FIELD-JOURNALS-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-TAXONOMIES-TITLE": "Taxonomies Data",
"FIELD-TAXONOMIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-LICENSES-TITLE": "Licenses Data",
"FIELD-LICENSES-PLACEHOLDER": "Input placeholder Text",
"FIELD-PUBLICATIONS-TITLE": "Publications Data",
"FIELD-PUBLICATIONS-PLACEHOLDER": "Input placeholder Text",
"FIELD-TAGS-TITLE": "Tags Data",
"FIELD-TAGS-PLACEHOLDER": "Input placeholder Text",
"FIELD-DATASET-IDENTIFIER-TITLE": "Dataset Identifier Data",
@ -1377,6 +1387,11 @@
"DATE-PICKER": "Επιλογή Ημερομηνίας",
"EXTERNAL-DATASETS": "Εξωτερικά Σύνολα Δεδομένων",
"DATA-REPOSITORIES": "Αποθετήρια Δεδομένων",
"PUB-REPOSITORIES": "Publication Repositories",
"JOURNALS-REPOSITORIES": "Journals",
"TAXONOMIES": "Taxonomies",
"LICENSES": "Licenses",
"PUBLICATIONS": "Publications",
"REGISTRIES": "Κατάλογοι",
"SERVICES": "Υπηρεσίες",
"TAGS": "Ετικέτες",

View File

@ -448,6 +448,16 @@
"FIELD-EXTERNAL-DATASETS-PLACEHOLDER": "Texto de Entrada",
"FIELD-DATA-REPOSITORIES-TITLE": "Dados dos Repositórios",
"FIELD-DATA-REPOSITORIES-PLACEHOLDER": "Texto de Entrada",
"FIELD-PUB-REPOSITORIES-TITLE": "Publication repositories",
"FIELD-PUB-REPOSITORIES-PLACEHOLDER": "Texto de Entrada",
"FIELD-JOURNALS-REPOSITORIES-TITLE": "Journals",
"FIELD-JOURNALS-REPOSITORIES-PLACEHOLDER": "Texto de Entrada",
"FIELD-TAXONOMIES-TITLE": "Taxonomies Data",
"FIELD-TAXONOMIES-PLACEHOLDER": "Texto de Entrada",
"FIELD-LICENSES-TITLE": "Licenses Data",
"FIELD-LICENSES-PLACEHOLDER": "Texto de Entrada",
"FIELD-PUBLICATIONS-TITLE": "Publications Data",
"FIELD-PUBLICATIONS-PLACEHOLDER": "Texto de Entrada",
"FIELD-TAGS-TITLE": "Dados das Etiquetas",
"FIELD-TAGS-PLACEHOLDER": "Texto de Entrada",
"FIELD-DATASET-IDENTIFIER-TITLE": "Dados de Identificador de Dataset",
@ -1376,6 +1386,11 @@
"DATE-PICKER": "Escolha de Data",
"EXTERNAL-DATASETS": "Datasets Externos",
"DATA-REPOSITORIES": "Repositórios de Dados",
"PUB-REPOSITORIES": "Publication Repositories",
"JOURNALS-REPOSITORIES": "Journals",
"TAXONOMIES": "Taxonomies",
"LICENSES": "Licenses",
"PUBLICATIONS": "Publications",
"REGISTRIES": "Registos",
"SERVICES": "Serviços",
"TAGS": "Etiquetas",

View File

@ -438,7 +438,7 @@
"FIELD-MULTIPLE-WORDLIST": "Multiple Selection",
"FIELD-CURRENCY-TITLE": "Currency Data",
"FIELD-CURRENCY-PLACEHOLDER": "Input Placeholder Text",
"FIELD-REGISTRIES-TITLE": "Registries Data",
"FIELD-REGISTRIES-TITLE": "Metadata",
"FIELD-REGISTRIES-PLACEHOLDER": "Input Placeholder Text",
"FIELD-SERVICES-TITLE": "Services Data",
"FIELD-SERVICES-PLACEHOLDER": "Input Placeholder Text",
@ -448,6 +448,16 @@
"FIELD-EXTERNAL-DATASETS-PLACEHOLDER": "Input placeholder Text",
"FIELD-DATA-REPOSITORIES-TITLE": "Data Repositories Data",
"FIELD-DATA-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-PUB-REPOSITORIES-TITLE": "Publication repositories",
"FIELD-PUB-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-JOURNALS-REPOSITORIES-TITLE": "Journals",
"FIELD-JOURNALS-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-TAXONOMIES-TITLE": "Taxonomies Data",
"FIELD-TAXONOMIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-LICENSES-TITLE": "Licenses Data",
"FIELD-LICENSES-PLACEHOLDER": "Input placeholder Text",
"FIELD-PUBLICATIONS-TITLE": "Publications Data",
"FIELD-PUBLICATIONS-PLACEHOLDER": "Input placeholder Text",
"FIELD-TAGS-TITLE": "Tags Data",
"FIELD-TAGS-PLACEHOLDER": "Input placeholder Text",
"FIELD-DATASET-IDENTIFIER-TITLE": "Dataset Identifier Data",
@ -1377,6 +1387,11 @@
"DATE-PICKER": "Výber dátumu (Date Picker) ",
"EXTERNAL-DATASETS": "Externé súbory dát (External Datasets)",
"DATA-REPOSITORIES": "Repozitáre dát (Data Repositories)",
"PUB-REPOSITORIES": "Publication Repositories",
"JOURNALS-REPOSITORIES": "Journals",
"TAXONOMIES": "Taxonomies",
"LICENSES": "Licenses",
"PUBLICATIONS": "Publications",
"REGISTRIES": "Registre (Registries)",
"SERVICES": "Služby (Services)",
"TAGS": "Tagy (tags)",

View File

@ -438,7 +438,7 @@
"FIELD-MULTIPLE-WORDLIST": "Višestruki odabir",
"FIELD-CURRENCY-TITLE": "Currency Data",
"FIELD-CURRENCY-PLACEHOLDER": "Input Placeholder Text",
"FIELD-REGISTRIES-TITLE": "Registries Data",
"FIELD-REGISTRIES-TITLE": "Metadata",
"FIELD-REGISTRIES-PLACEHOLDER": "Input Placeholder Text",
"FIELD-SERVICES-TITLE": "Services Data",
"FIELD-SERVICES-PLACEHOLDER": "Input Placeholder Text",
@ -448,6 +448,16 @@
"FIELD-EXTERNAL-DATASETS-PLACEHOLDER": "Input placeholder Text",
"FIELD-DATA-REPOSITORIES-TITLE": "Data Repositories Data",
"FIELD-DATA-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-PUB-REPOSITORIES-TITLE": "Publication repositories",
"FIELD-PUB-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-JOURNALS-REPOSITORIES-TITLE": "Journals",
"FIELD-JOURNALS-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-TAXONOMIES-TITLE": "Taxonomies Data",
"FIELD-TAXONOMIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-LICENSES-TITLE": "Licenses Data",
"FIELD-LICENSES-PLACEHOLDER": "Input placeholder Text",
"FIELD-PUBLICATIONS-TITLE": "Publications Data",
"FIELD-PUBLICATIONS-PLACEHOLDER": "Input placeholder Text",
"FIELD-TAGS-TITLE": "Tags Data",
"FIELD-TAGS-PLACEHOLDER": "Input placeholder Text",
"FIELD-DATASET-IDENTIFIER-TITLE": "Dataset Identifier Data",
@ -1377,6 +1387,11 @@
"DATE-PICKER": "Alat za odabir podataka",
"EXTERNAL-DATASETS": "Spoljni skupovi podataka",
"DATA-REPOSITORIES": "Repozitorijumi podataka",
"PUB-REPOSITORIES": "Publication Repositories",
"JOURNALS-REPOSITORIES": "Journals",
"TAXONOMIES": "Taxonomies",
"LICENSES": "Licenses",
"PUBLICATIONS": "Publications",
"REGISTRIES": "Spiskovi",
"SERVICES": "Usluge",
"TAGS": "Ključne oznake",

View File

@ -438,7 +438,7 @@
"FIELD-MULTIPLE-WORDLIST": "Çoklu Seçim",
"FIELD-CURRENCY-TITLE": "Currency Data",
"FIELD-CURRENCY-PLACEHOLDER": "Input Placeholder Text",
"FIELD-REGISTRIES-TITLE": "Registries Data",
"FIELD-REGISTRIES-TITLE": "Metadata",
"FIELD-REGISTRIES-PLACEHOLDER": "Input Placeholder Text",
"FIELD-SERVICES-TITLE": "Services Data",
"FIELD-SERVICES-PLACEHOLDER": "Input Placeholder Text",
@ -448,6 +448,16 @@
"FIELD-EXTERNAL-DATASETS-PLACEHOLDER": "Input placeholder Text",
"FIELD-DATA-REPOSITORIES-TITLE": "Data Repositories Data",
"FIELD-DATA-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-PUB-REPOSITORIES-TITLE": "Publication repositories",
"FIELD-PUB-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-JOURNALS-REPOSITORIES-TITLE": "Journals",
"FIELD-JOURNALS-REPOSITORIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-TAXONOMIES-TITLE": "Taxonomies Data",
"FIELD-TAXONOMIES-PLACEHOLDER": "Input placeholder Text",
"FIELD-LICENSES-TITLE": "Licenses Data",
"FIELD-LICENSES-PLACEHOLDER": "Input placeholder Text",
"FIELD-PUBLICATIONS-TITLE": "Publications Data",
"FIELD-PUBLICATIONS-PLACEHOLDER": "Input placeholder Text",
"FIELD-TAGS-TITLE": "Tags Data",
"FIELD-TAGS-PLACEHOLDER": "Input placeholder Text",
"FIELD-DATASET-IDENTIFIER-TITLE": "Dataset Identifier Data",
@ -1377,6 +1387,11 @@
"DATE-PICKER": "Tarih Seçici",
"EXTERNAL-DATASETS": "Harici Veri Setleri",
"DATA-REPOSITORIES": "Veri Depoları",
"PUB-REPOSITORIES": "Publication Repositories",
"JOURNALS-REPOSITORIES": "Journals",
"TAXONOMIES": "Taxonomies",
"LICENSES": "Licenses",
"PUBLICATIONS": "Publications",
"REGISTRIES": "Kayıtlar",
"SERVICES": "Hizmetler",
"TAGS": "Etiketler",