2018-06-27 12:29:21 +02:00
|
|
|
package eu.eudat.models.data.datasetwizard;
|
2017-12-22 14:42:47 +01:00
|
|
|
|
2022-01-12 10:43:32 +01:00
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
2021-12-10 14:37:39 +01:00
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
2018-05-28 11:50:42 +02:00
|
|
|
import eu.eudat.data.entities.*;
|
2018-07-11 15:47:36 +02:00
|
|
|
import eu.eudat.elastic.entities.Tag;
|
2021-12-10 14:37:39 +01:00
|
|
|
import eu.eudat.logic.managers.DatasetManager;
|
2022-01-12 10:43:32 +01:00
|
|
|
import eu.eudat.logic.proxy.config.entities.PrefillingFixedMapping;
|
|
|
|
import eu.eudat.logic.proxy.config.entities.PrefillingGet;
|
|
|
|
import eu.eudat.logic.proxy.config.entities.DefaultPrefillingMapping;
|
2021-12-10 14:37:39 +01:00
|
|
|
import eu.eudat.logic.proxy.config.entities.PrefillingMapping;
|
|
|
|
import eu.eudat.logic.utilities.json.JsonSearcher;
|
2017-12-22 14:42:47 +01:00
|
|
|
import eu.eudat.models.DataModel;
|
2018-06-27 12:29:21 +02:00
|
|
|
import eu.eudat.models.data.dataset.DataRepository;
|
|
|
|
import eu.eudat.models.data.dataset.Registry;
|
|
|
|
import eu.eudat.models.data.dataset.Service;
|
2020-09-04 16:00:34 +02:00
|
|
|
import eu.eudat.models.data.datasetprofile.DatasetProfileOverviewModel;
|
2018-06-27 12:29:21 +02:00
|
|
|
import eu.eudat.models.data.dmp.DataManagementPlan;
|
|
|
|
import eu.eudat.models.data.externaldataset.ExternalDatasetListingModel;
|
|
|
|
import eu.eudat.models.data.user.composite.PagedDatasetProfile;
|
2018-05-28 11:50:42 +02:00
|
|
|
import net.minidev.json.JSONValue;
|
2017-12-22 14:42:47 +01:00
|
|
|
|
2021-12-10 14:37:39 +01:00
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
|
import java.lang.reflect.Method;
|
2018-05-28 11:50:42 +02:00
|
|
|
import java.util.*;
|
2017-12-22 14:42:47 +01:00
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
2018-02-01 10:08:06 +01:00
|
|
|
|
2018-02-16 08:45:18 +01:00
|
|
|
public class DatasetWizardModel implements DataModel<Dataset, DatasetWizardModel> {
|
2017-12-22 14:42:47 +01:00
|
|
|
|
|
|
|
private UUID id;
|
|
|
|
private String label;
|
|
|
|
private String reference;
|
|
|
|
private String uri;
|
|
|
|
private String description;
|
|
|
|
private short status;
|
|
|
|
private Date created;
|
|
|
|
private DataManagementPlan dmp;
|
2018-01-19 10:31:05 +01:00
|
|
|
private PagedDatasetProfile datasetProfileDefinition;
|
2017-12-22 14:42:47 +01:00
|
|
|
private List<Registry> registries;
|
|
|
|
private List<Service> services;
|
|
|
|
private List<DataRepository> dataRepositories;
|
2018-07-11 15:47:36 +02:00
|
|
|
private List<Tag> tags;
|
2018-01-17 16:06:35 +01:00
|
|
|
private List<ExternalDatasetListingModel> externalDatasets;
|
2020-09-04 16:00:34 +02:00
|
|
|
private DatasetProfileOverviewModel profile;
|
2019-04-22 11:11:21 +02:00
|
|
|
private Boolean isProfileLatestVersion;
|
2020-02-10 17:21:06 +01:00
|
|
|
private Date modified;
|
2017-12-22 14:42:47 +01:00
|
|
|
|
|
|
|
public UUID getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
public void setId(UUID id) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getLabel() {
|
|
|
|
return label;
|
|
|
|
}
|
|
|
|
public void setLabel(String label) {
|
|
|
|
this.label = label;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getReference() {
|
|
|
|
return reference;
|
|
|
|
}
|
|
|
|
public void setReference(String reference) {
|
|
|
|
this.reference = reference;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getUri() {
|
|
|
|
return uri;
|
|
|
|
}
|
|
|
|
public void setUri(String uri) {
|
|
|
|
this.uri = uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
return description;
|
|
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
|
|
this.description = description;
|
|
|
|
}
|
|
|
|
|
|
|
|
public short getStatus() {
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
public void setStatus(short status) {
|
|
|
|
this.status = status;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getCreated() {
|
|
|
|
return created;
|
|
|
|
}
|
|
|
|
public void setCreated(Date created) {
|
|
|
|
this.created = created;
|
|
|
|
}
|
|
|
|
|
|
|
|
public DataManagementPlan getDmp() {
|
|
|
|
return dmp;
|
|
|
|
}
|
|
|
|
public void setDmp(DataManagementPlan dmp) {
|
|
|
|
this.dmp = dmp;
|
|
|
|
}
|
|
|
|
|
2018-01-19 10:31:05 +01:00
|
|
|
public PagedDatasetProfile getDatasetProfileDefinition() {
|
2017-12-22 14:42:47 +01:00
|
|
|
return datasetProfileDefinition;
|
|
|
|
}
|
2018-01-19 10:31:05 +01:00
|
|
|
public void setDatasetProfileDefinition(PagedDatasetProfile datasetProfileDefinition) {
|
2017-12-22 14:42:47 +01:00
|
|
|
this.datasetProfileDefinition = datasetProfileDefinition;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<Registry> getRegistries() {
|
|
|
|
return registries;
|
|
|
|
}
|
|
|
|
public void setRegistries(List<Registry> registries) {
|
|
|
|
this.registries = registries;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<Service> getServices() {
|
|
|
|
return services;
|
|
|
|
}
|
|
|
|
public void setServices(List<Service> services) {
|
|
|
|
this.services = services;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<DataRepository> getDataRepositories() {
|
|
|
|
return dataRepositories;
|
|
|
|
}
|
|
|
|
public void setDataRepositories(List<DataRepository> dataRepositories) {
|
|
|
|
this.dataRepositories = dataRepositories;
|
|
|
|
}
|
|
|
|
|
2020-09-04 16:00:34 +02:00
|
|
|
public DatasetProfileOverviewModel getProfile() {
|
2017-12-22 14:42:47 +01:00
|
|
|
return profile;
|
|
|
|
}
|
2020-09-04 16:00:34 +02:00
|
|
|
|
|
|
|
public void setProfile(DatasetProfileOverviewModel profile) {
|
2017-12-22 14:42:47 +01:00
|
|
|
this.profile = profile;
|
|
|
|
}
|
|
|
|
|
2018-01-17 16:06:35 +01:00
|
|
|
public List<ExternalDatasetListingModel> getExternalDatasets() {
|
|
|
|
return externalDatasets;
|
|
|
|
}
|
|
|
|
public void setExternalDatasets(List<ExternalDatasetListingModel> externalDatasets) {
|
|
|
|
this.externalDatasets = externalDatasets;
|
|
|
|
}
|
|
|
|
|
2018-07-11 15:47:36 +02:00
|
|
|
public List<Tag> getTags() {
|
|
|
|
return tags;
|
|
|
|
}
|
|
|
|
public void setTags(List<Tag> tags) {
|
|
|
|
this.tags = tags;
|
|
|
|
}
|
|
|
|
|
2019-04-22 11:11:21 +02:00
|
|
|
public Boolean getIsProfileLatestVersion() {
|
|
|
|
return isProfileLatestVersion;
|
|
|
|
}
|
|
|
|
public void setIsProfileLatestVersion(Boolean profileLatestVersion) {
|
|
|
|
isProfileLatestVersion = profileLatestVersion;
|
|
|
|
}
|
|
|
|
|
2020-02-10 17:21:06 +01:00
|
|
|
public Date getModified() {
|
|
|
|
return modified;
|
|
|
|
}
|
|
|
|
public void setModified(Date modified) {
|
|
|
|
this.modified = modified;
|
|
|
|
}
|
|
|
|
|
2017-12-22 14:42:47 +01:00
|
|
|
@Override
|
2018-02-16 08:45:18 +01:00
|
|
|
public DatasetWizardModel fromDataModel(Dataset entity) {
|
2017-12-22 14:42:47 +01:00
|
|
|
this.id = entity.getId();
|
|
|
|
this.label = entity.getLabel();
|
2018-01-19 10:31:05 +01:00
|
|
|
this.status = entity.getStatus();
|
2017-12-22 14:42:47 +01:00
|
|
|
this.reference = entity.getReference();
|
|
|
|
this.description = entity.getDescription();
|
2020-09-04 16:00:34 +02:00
|
|
|
this.profile = new DatasetProfileOverviewModel();
|
|
|
|
this.profile = this.profile.fromDataModel(entity.getProfile());
|
2018-01-19 15:19:14 +01:00
|
|
|
this.uri = entity.getUri();
|
2020-04-01 17:16:06 +02:00
|
|
|
this.registries = entity.getRegistries() != null ? entity.getRegistries().stream().map(item -> new Registry().fromDataModel(item)).collect(Collectors.toList()) : new ArrayList<>();
|
|
|
|
this.dataRepositories = entity.getDatasetDataRepositories() != null ? entity.getDatasetDataRepositories().stream().map(item -> {
|
2018-05-28 11:50:42 +02:00
|
|
|
DataRepository dataRepository = new DataRepository().fromDataModel(item.getDataRepository());
|
2019-12-13 16:10:21 +01:00
|
|
|
if (item.getData() != null) {
|
2018-05-28 11:50:42 +02:00
|
|
|
Map<String, Map<String, String>> data = (Map<String, Map<String, String>>) JSONValue.parse(item.getData());
|
|
|
|
Map<String, String> values = data.get("data");
|
|
|
|
dataRepository.setInfo(values.get("info"));
|
|
|
|
}
|
|
|
|
return dataRepository;
|
2020-04-01 17:16:06 +02:00
|
|
|
}).collect(Collectors.toList()) : new ArrayList<>();
|
|
|
|
this.services = entity.getServices() != null ? entity.getServices().stream().map(item -> new Service().fromDataModel(item.getService())).collect(Collectors.toList()) : new ArrayList<>();
|
2017-12-22 14:42:47 +01:00
|
|
|
this.created = entity.getCreated();
|
2019-09-06 11:20:32 +02:00
|
|
|
this.dmp = new DataManagementPlan().fromDataModelNoDatasets(entity.getDmp());
|
2020-04-01 17:16:06 +02:00
|
|
|
this.externalDatasets = entity.getDatasetExternalDatasets() != null ? entity.getDatasetExternalDatasets().stream().map(item -> {
|
2018-05-28 11:50:42 +02:00
|
|
|
ExternalDatasetListingModel externalDatasetListingModel = new ExternalDatasetListingModel().fromDataModel(item.getExternalDataset());
|
2019-12-13 16:10:21 +01:00
|
|
|
if (item.getData() != null) {
|
2018-05-28 11:50:42 +02:00
|
|
|
Map<String, Map<String, String>> data = (Map<String, Map<String, String>>) JSONValue.parse(item.getData());
|
2020-07-27 12:09:30 +02:00
|
|
|
Map<String, String> values = data.get("data");
|
|
|
|
externalDatasetListingModel.setInfo(values.get("info"));
|
|
|
|
externalDatasetListingModel.setType(Integer.parseInt(values.get("type")));
|
|
|
|
}
|
|
|
|
return externalDatasetListingModel;
|
|
|
|
}).collect(Collectors.toList()) : new ArrayList<>();
|
|
|
|
this.modified = entity.getModified();
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public DatasetWizardModel fromDataModelNoDmp(Dataset entity) {
|
|
|
|
this.id = entity.getId();
|
|
|
|
this.label = entity.getLabel();
|
|
|
|
this.status = entity.getStatus();
|
|
|
|
this.reference = entity.getReference();
|
|
|
|
this.description = entity.getDescription();
|
2020-09-04 16:00:34 +02:00
|
|
|
this.profile = new DatasetProfileOverviewModel();
|
|
|
|
this.profile = this.profile.fromDataModel(entity.getProfile());
|
2020-07-27 12:09:30 +02:00
|
|
|
this.uri = entity.getUri();
|
|
|
|
this.registries = entity.getRegistries() != null ? entity.getRegistries().stream().map(item -> new Registry().fromDataModel(item)).collect(Collectors.toList()) : new ArrayList<>();
|
|
|
|
this.dataRepositories = entity.getDatasetDataRepositories() != null ? entity.getDatasetDataRepositories().stream().map(item -> {
|
|
|
|
DataRepository dataRepository = new DataRepository().fromDataModel(item.getDataRepository());
|
|
|
|
if (item.getData() != null) {
|
|
|
|
Map<String, Map<String, String>> data = (Map<String, Map<String, String>>) JSONValue.parse(item.getData());
|
|
|
|
Map<String, String> values = data.get("data");
|
|
|
|
dataRepository.setInfo(values.get("info"));
|
|
|
|
}
|
|
|
|
return dataRepository;
|
|
|
|
}).collect(Collectors.toList()) : new ArrayList<>();
|
|
|
|
this.services = entity.getServices() != null ? entity.getServices().stream().map(item -> new Service().fromDataModel(item.getService())).collect(Collectors.toList()) : new ArrayList<>();
|
|
|
|
this.created = entity.getCreated();
|
|
|
|
this.externalDatasets = entity.getDatasetExternalDatasets() != null ? entity.getDatasetExternalDatasets().stream().map(item -> {
|
|
|
|
ExternalDatasetListingModel externalDatasetListingModel = new ExternalDatasetListingModel().fromDataModel(item.getExternalDataset());
|
|
|
|
if (item.getData() != null) {
|
|
|
|
Map<String, Map<String, String>> data = (Map<String, Map<String, String>>) JSONValue.parse(item.getData());
|
2018-05-28 11:50:42 +02:00
|
|
|
Map<String, String> values = data.get("data");
|
|
|
|
externalDatasetListingModel.setInfo(values.get("info"));
|
|
|
|
externalDatasetListingModel.setType(Integer.parseInt(values.get("type")));
|
|
|
|
}
|
|
|
|
return externalDatasetListingModel;
|
2020-04-01 17:16:06 +02:00
|
|
|
}).collect(Collectors.toList()) : new ArrayList<>();
|
2020-02-10 17:21:06 +01:00
|
|
|
this.modified = entity.getModified();
|
2018-02-16 08:45:18 +01:00
|
|
|
return this;
|
2017-12-22 14:42:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-01-17 13:03:51 +01:00
|
|
|
public Dataset toDataModel() throws Exception {
|
2018-03-21 11:57:56 +01:00
|
|
|
eu.eudat.data.entities.Dataset entity = new eu.eudat.data.entities.Dataset();
|
2017-12-22 14:42:47 +01:00
|
|
|
entity.setId(this.id);
|
|
|
|
entity.setLabel(this.label);
|
|
|
|
entity.setReference(this.reference);
|
|
|
|
entity.setUri(this.uri);
|
|
|
|
entity.setStatus(this.status);
|
2019-06-26 15:34:33 +02:00
|
|
|
if (this.status == (int) Dataset.Status.FINALISED.getValue())
|
|
|
|
entity.setFinalizedAt(new Date());
|
2018-08-24 17:21:02 +02:00
|
|
|
DMP dmp = new DMP();
|
|
|
|
dmp.setId(this.dmp.getId());
|
|
|
|
entity.setDmp(dmp);
|
2017-12-22 14:42:47 +01:00
|
|
|
entity.setDescription(this.description);
|
2018-01-08 15:57:21 +01:00
|
|
|
entity.setCreated(this.created != null ? this.created : new Date());
|
2017-12-22 14:42:47 +01:00
|
|
|
entity.setModified(new Date());
|
2019-01-25 14:54:14 +01:00
|
|
|
DatasetProfile profile = new DatasetProfile();
|
2020-09-04 16:00:34 +02:00
|
|
|
profile.setId(this.profile.getId());
|
2019-01-25 14:54:14 +01:00
|
|
|
entity.setProfile(profile);
|
2018-01-17 16:06:35 +01:00
|
|
|
if (this.registries != null && !this.registries.isEmpty()) {
|
2019-11-06 11:05:40 +01:00
|
|
|
entity.setRegistries(new HashSet<>());
|
2018-01-08 15:57:21 +01:00
|
|
|
for (Registry registry : this.registries) {
|
2017-12-22 14:42:47 +01:00
|
|
|
entity.getRegistries().add(registry.toDataModel());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-17 16:06:35 +01:00
|
|
|
if (this.dataRepositories != null && !this.dataRepositories.isEmpty()) {
|
2019-11-06 11:05:40 +01:00
|
|
|
entity.setDatasetDataRepositories(new HashSet<>());
|
2018-05-28 11:50:42 +02:00
|
|
|
for (DataRepository dataRepositoryModel : this.dataRepositories) {
|
|
|
|
eu.eudat.data.entities.DataRepository dataRepository = dataRepositoryModel.toDataModel();
|
|
|
|
DatasetDataRepository datasetDataRepository = new DatasetDataRepository();
|
|
|
|
datasetDataRepository.setDataRepository(dataRepository);
|
2019-12-13 16:10:21 +01:00
|
|
|
Map<String, Map<String, String>> data = new HashMap<>();
|
|
|
|
Map<String, String> values = new HashMap<>();
|
|
|
|
values.put("info", dataRepositoryModel.getInfo());
|
|
|
|
data.put("data", values);
|
2018-05-28 11:50:42 +02:00
|
|
|
datasetDataRepository.setData(JSONValue.toJSONString(data));
|
|
|
|
entity.getDatasetDataRepositories().add(datasetDataRepository);
|
2017-12-22 14:42:47 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-17 16:06:35 +01:00
|
|
|
if (this.services != null && !this.services.isEmpty()) {
|
2019-11-06 11:05:40 +01:00
|
|
|
entity.setServices(new HashSet<>());
|
2018-05-28 11:50:42 +02:00
|
|
|
for (Service serviceModel : this.services) {
|
|
|
|
eu.eudat.data.entities.Service service = serviceModel.toDataModel();
|
|
|
|
DatasetService datasetService = new DatasetService();
|
|
|
|
datasetService.setService(service);
|
|
|
|
entity.getServices().add(datasetService);
|
2017-12-22 14:42:47 +01:00
|
|
|
}
|
|
|
|
}
|
2018-01-17 16:06:35 +01:00
|
|
|
|
|
|
|
if (this.externalDatasets != null && !this.externalDatasets.isEmpty()) {
|
2019-11-06 11:05:40 +01:00
|
|
|
entity.setDatasetExternalDatasets(new HashSet<>());
|
2018-01-17 16:06:35 +01:00
|
|
|
for (ExternalDatasetListingModel externalDataset : this.externalDatasets) {
|
2018-05-28 11:50:42 +02:00
|
|
|
ExternalDataset externalDatasetEntity = externalDataset.toDataModel();
|
|
|
|
DatasetExternalDataset datasetExternalDataset = new DatasetExternalDataset();
|
|
|
|
datasetExternalDataset.setExternalDataset(externalDatasetEntity);
|
|
|
|
Map<String,Map<String,String>> data = new HashMap<>();
|
|
|
|
Map<String,String> values = new HashMap<>();
|
|
|
|
values.put("info",externalDataset.getInfo());
|
|
|
|
values.put("type",externalDataset.getType().toString());
|
|
|
|
data.put("data",values);
|
|
|
|
datasetExternalDataset.setData(JSONValue.toJSONString(data));
|
|
|
|
entity.getDatasetExternalDatasets().add(datasetExternalDataset);
|
2018-01-17 16:06:35 +01:00
|
|
|
}
|
|
|
|
}
|
2017-12-22 14:42:47 +01:00
|
|
|
return entity;
|
|
|
|
}
|
2018-01-19 10:31:05 +01:00
|
|
|
|
2022-01-12 10:43:32 +01:00
|
|
|
public static DatasetWizardModel fromPrefilledEntity(Map<String, Object> prefilledEntity, PrefillingGet prefillingGet,
|
2021-12-10 14:37:39 +01:00
|
|
|
DatasetProfile profile, DatasetManager datasetManager) throws Exception {
|
|
|
|
DatasetWizardModel datasetWizardModel = new DatasetWizardModel();
|
|
|
|
datasetWizardModel.setProfile(new DatasetProfileOverviewModel().fromDataModel(profile));
|
|
|
|
Dataset dataset = new Dataset();
|
|
|
|
dataset.setProfile(profile);
|
|
|
|
Map<String, Object> properties = new HashMap<>();
|
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
JsonNode parentNode = objectMapper.readTree(objectMapper.writeValueAsString(datasetManager.getPagedProfile(datasetWizardModel, dataset)));
|
2022-01-12 10:43:32 +01:00
|
|
|
for (DefaultPrefillingMapping prefillingMapping: prefillingGet.getMappings()) {
|
2021-12-10 14:37:39 +01:00
|
|
|
List<String> sourceKeys = Arrays.asList(prefillingMapping.getSource().split("\\."));
|
|
|
|
Object sourceValue = null;
|
|
|
|
for (String sourceKey: sourceKeys) {
|
|
|
|
if (sourceValue == null) {
|
|
|
|
sourceValue = prefilledEntity.get(sourceKey);
|
|
|
|
} else if (sourceValue instanceof Map) {
|
|
|
|
sourceValue = ((Map)sourceValue).get(sourceKey);
|
|
|
|
}
|
|
|
|
}
|
2022-01-12 10:43:32 +01:00
|
|
|
setValue(prefillingMapping, objectMapper.writeValueAsString(sourceValue), datasetWizardModel, parentNode, properties);
|
|
|
|
}
|
|
|
|
for (PrefillingFixedMapping fixedMapping: prefillingGet.getFixedMappings()) {
|
|
|
|
setValue(fixedMapping, fixedMapping.getValue(), datasetWizardModel, parentNode, properties);
|
2021-12-10 14:37:39 +01:00
|
|
|
}
|
|
|
|
dataset.setProperties(objectMapper.writeValueAsString(properties));
|
|
|
|
datasetWizardModel.setDatasetProfileDefinition(datasetManager.getPagedProfile(datasetWizardModel, dataset));
|
|
|
|
return datasetWizardModel;
|
|
|
|
}
|
|
|
|
|
2022-01-12 10:43:32 +01:00
|
|
|
private static void setValue(PrefillingMapping prefillingMapping, String value, DatasetWizardModel datasetWizardModel, JsonNode parentNode, Map<String, Object> properties) throws InvocationTargetException, IllegalAccessException, JsonProcessingException {
|
|
|
|
if (prefillingMapping.getTarget() != null) {
|
|
|
|
try {
|
|
|
|
String methodName = "set" + prefillingMapping.getTarget().substring(0, 1).toUpperCase(Locale.ROOT) + prefillingMapping.getTarget().substring(1);
|
|
|
|
Method setterMethod = Arrays.stream(DatasetWizardModel.class.getDeclaredMethods())
|
|
|
|
.filter(method -> method.getName().equals(methodName)).collect(Collectors.toList()).get(0);
|
|
|
|
Class<?>[] params = setterMethod.getParameterTypes();
|
|
|
|
setterMethod.invoke(datasetWizardModel, new ObjectMapper().readValue(value, params[0]));
|
|
|
|
}catch (InvocationTargetException | IllegalAccessException | JsonProcessingException e) {
|
|
|
|
throw e;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
List<JsonNode> nodes = JsonSearcher.findNodes(parentNode, "rdaProperty", prefillingMapping.getMaDmpTarget());
|
|
|
|
for (JsonNode node: nodes) {
|
|
|
|
String id = node.get(0) != null ? node.get(0).get("id").asText() : node.get("id").asText();
|
|
|
|
properties.put(id, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-19 10:31:05 +01:00
|
|
|
@Override
|
|
|
|
public String getHint() {
|
2018-02-08 16:54:31 +01:00
|
|
|
return "datasetWizardModel";
|
2018-01-19 10:31:05 +01:00
|
|
|
}
|
2017-12-22 14:42:47 +01:00
|
|
|
}
|