schematics implementation, xml import export of dataset profiles
This commit is contained in:
parent
e22e348330
commit
9a8fc5e92e
|
@ -194,4 +194,10 @@ public class Admin extends BaseController {
|
|||
public ResponseEntity getRDACommonStandards(@ClaimedAuthorities(claims = {ADMIN, DATASET_PROFILE_MANAGER}) Principal principal) {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<String>>().status(ApiMessageCode.SUCCESS_MESSAGE).payload(configLoader.getRdaProperties()));
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = {"/getSchematics"}, produces = "application/json")
|
||||
public ResponseEntity<ResponseItem<List<String>>> getSchematics(@RequestParam(value = "query", required = false) String query, @ClaimedAuthorities(claims = {ADMIN, DATASET_PROFILE_MANAGER}) Principal principal) {
|
||||
List<String> schematics = this.datasetProfileManager.getSchematics(query);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<String>>().status(ApiMessageCode.SUCCESS_MESSAGE).payload(schematics));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ import eu.eudat.data.query.items.item.datasetprofile.DatasetProfileAutocompleteR
|
|||
import eu.eudat.data.query.items.table.datasetprofile.DatasetProfileTableRequestItem;
|
||||
import eu.eudat.exceptions.datasetprofile.DatasetProfileNewVersionException;
|
||||
import eu.eudat.logic.builders.model.models.DataTableDataBuilder;
|
||||
import eu.eudat.logic.proxy.config.Schematic;
|
||||
import eu.eudat.logic.proxy.config.configloaders.ConfigLoader;
|
||||
import eu.eudat.logic.services.ApiContext;
|
||||
import eu.eudat.logic.services.operations.DatabaseRepository;
|
||||
import eu.eudat.logic.utilities.builders.XmlBuilder;
|
||||
|
@ -62,14 +64,16 @@ public class DatasetProfileManager {
|
|||
private ApiContext apiContext;
|
||||
private DatabaseRepository databaseRepository;
|
||||
private Environment environment;
|
||||
private ConfigLoader configLoader;
|
||||
|
||||
private final MetricsManager metricsManager;
|
||||
|
||||
@Autowired
|
||||
public DatasetProfileManager(ApiContext apiContext, Environment environment, MetricsManager metricsManager) {
|
||||
public DatasetProfileManager(ApiContext apiContext, Environment environment, ConfigLoader configLoader, MetricsManager metricsManager) {
|
||||
this.apiContext = apiContext;
|
||||
this.databaseRepository = apiContext.getOperationsContext().getDatabaseRepository();
|
||||
this.environment = environment;
|
||||
this.configLoader = configLoader;
|
||||
this.metricsManager = metricsManager;
|
||||
}
|
||||
|
||||
|
@ -363,4 +367,13 @@ public class DatasetProfileManager {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
public List<String> getSchematics(String query) {
|
||||
List<Schematic> schematics = configLoader.getSchematics();
|
||||
List<String> filteredSchematics = schematics.stream().map(Schematic::getName).collect(Collectors.toList());
|
||||
if(query != null && !query.isEmpty()){
|
||||
filteredSchematics = schematics.stream().filter(x -> x.getCategory().contains(query) || x.getName().contains(query)).map(Schematic::getName).collect(Collectors.toList());
|
||||
}
|
||||
return filteredSchematics;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package eu.eudat.logic.proxy.config;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class Schematic {
|
||||
|
||||
@JsonProperty("category")
|
||||
private String category;
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
public void setCategory(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package eu.eudat.logic.proxy.config.configloaders;
|
||||
|
||||
import eu.eudat.logic.proxy.config.ExternalUrls;
|
||||
import eu.eudat.logic.proxy.config.Schematic;
|
||||
import eu.eudat.logic.security.customproviders.ConfigurableProvider.entities.ConfigurableProviders;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
|
||||
|
@ -10,6 +11,7 @@ import java.util.Map;
|
|||
public interface ConfigLoader {
|
||||
ExternalUrls getExternalUrls();
|
||||
List<String> getRdaProperties();
|
||||
List<Schematic> getSchematics();
|
||||
XWPFDocument getDocument();
|
||||
XWPFDocument getDatasetDocument();
|
||||
ConfigurableProviders getConfigurableProviders();
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package eu.eudat.logic.proxy.config.configloaders;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import eu.eudat.logic.proxy.config.ExternalUrls;
|
||||
import eu.eudat.logic.proxy.config.Schematic;
|
||||
import eu.eudat.logic.security.customproviders.ConfigurableProvider.entities.ConfigurableProviders;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -36,6 +38,7 @@ public class DefaultConfigLoader implements ConfigLoader {
|
|||
|
||||
private ExternalUrls externalUrls;
|
||||
private List<String> rdaProperties;
|
||||
private List<Schematic> schematics;
|
||||
private XWPFDocument document;
|
||||
private XWPFDocument datasetDocument;
|
||||
private ConfigurableProviders configurableProviders;
|
||||
|
@ -84,6 +87,19 @@ public class DefaultConfigLoader implements ConfigLoader {
|
|||
rdaProperties = rdaList;
|
||||
}
|
||||
|
||||
private void setSchematics() {
|
||||
String filePath = environment.getProperty("configuration.schematics");
|
||||
logger.info("Loaded also config file: " + filePath);
|
||||
if (filePath != null) {
|
||||
try {
|
||||
schematics = mapper.readValue(getStreamFromPath(filePath), new TypeReference<List<Schematic>>(){});
|
||||
}
|
||||
catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setDocument() {
|
||||
String filePath = environment.getProperty("configuration.h2020template");
|
||||
logger.info("Loaded also config file: " + filePath);
|
||||
|
@ -179,6 +195,14 @@ public class DefaultConfigLoader implements ConfigLoader {
|
|||
return rdaProperties;
|
||||
}
|
||||
|
||||
public List<Schematic> getSchematics() {
|
||||
if (schematics == null) {
|
||||
schematics = new ArrayList<>();
|
||||
this.setSchematics();
|
||||
}
|
||||
return schematics;
|
||||
}
|
||||
|
||||
public XWPFDocument getDocument() {
|
||||
this.setDocument();
|
||||
return document;
|
||||
|
|
|
@ -169,6 +169,15 @@ public class ExportXmlBuilderDatasetProfile {
|
|||
rdaProperty.setTextContent(field.getRdaProperty());
|
||||
elementField.appendChild(rdaProperty);
|
||||
}
|
||||
if (field.getSchematics() != null) {
|
||||
Element schematics = element.createElement("schematics");
|
||||
field.getSchematics().forEach(schematic -> {
|
||||
Element schematicChild = element.createElement("schematic");
|
||||
schematicChild.setTextContent(schematic);
|
||||
schematics.appendChild(schematicChild);
|
||||
});
|
||||
elementField.appendChild(schematics);
|
||||
}
|
||||
if (field.getValidations() != null) {
|
||||
Element validations = element.createElement("validations");
|
||||
field.getValidations().forEach(validation -> {
|
||||
|
|
|
@ -31,6 +31,8 @@ public class Field {
|
|||
|
||||
private String rdaProperty;
|
||||
|
||||
private Schematics schematics;
|
||||
|
||||
@XmlAttribute(name = "id")
|
||||
public String getId() {
|
||||
return id;
|
||||
|
@ -112,6 +114,14 @@ public class Field {
|
|||
this.rdaProperty = rdaProperty;
|
||||
}
|
||||
|
||||
@XmlElement(name = "schematics")
|
||||
public Schematics getSchematics() {
|
||||
return schematics;
|
||||
}
|
||||
|
||||
public void setSchematics(Schematics schematics) {
|
||||
this.schematics = schematics;
|
||||
}
|
||||
|
||||
public eu.eudat.models.data.admin.components.datasetprofile.Field toAdminCompositeModelSection() {
|
||||
eu.eudat.models.data.admin.components.datasetprofile.Field fieldEntity =new eu.eudat.models.data.admin.components.datasetprofile.Field();
|
||||
|
@ -132,6 +142,14 @@ public class Field {
|
|||
fieldEntity.setData(data.toMap((Element) this.data));
|
||||
}
|
||||
fieldEntity.setRdaCommonStandard(this.rdaProperty);
|
||||
List<String> schematicsList = new LinkedList<>();
|
||||
if (this.schematics != null && this.schematics.getSchematics() != null) {
|
||||
for (Schematic schematic : this.schematics.getSchematics()) {
|
||||
if (schematic != null && schematic.getSchematic() != null && !schematic.getSchematic().isEmpty())
|
||||
schematicsList.add(schematic.getSchematic());
|
||||
}
|
||||
}
|
||||
fieldEntity.setSchematics(schematicsList);
|
||||
return fieldEntity;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlValue;
|
||||
|
||||
@XmlRootElement(name = "schematic")
|
||||
public class Schematic {
|
||||
|
||||
private String schematic;
|
||||
|
||||
@XmlValue
|
||||
public String getSchematic() {
|
||||
return schematic;
|
||||
}
|
||||
public void setSchematic(String schematic) {
|
||||
this.schematic = schematic;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.Fields;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import java.util.List;
|
||||
|
||||
@XmlRootElement(name = "schematics")
|
||||
public class Schematics {
|
||||
|
||||
private List<Schematic> schematics;
|
||||
|
||||
@XmlElement(name = "schematic")
|
||||
public List<Schematic> getSchematics() {
|
||||
return schematics;
|
||||
}
|
||||
|
||||
public void setSchematics(List<Schematic> schematics) {
|
||||
this.schematics = schematics;
|
||||
}
|
||||
}
|
|
@ -46,6 +46,7 @@ public class Field implements ViewStyleDefinition<eu.eudat.models.data.entities.
|
|||
private String id;
|
||||
private Integer ordinal;
|
||||
private String rdaCommonStandard;
|
||||
private List<String> schematics;
|
||||
private String value;
|
||||
private ViewStyle viewStyle;
|
||||
private String datatype;
|
||||
|
@ -77,6 +78,13 @@ public class Field implements ViewStyleDefinition<eu.eudat.models.data.entities.
|
|||
this.rdaCommonStandard = rdaCommonStandard;
|
||||
}
|
||||
|
||||
public List<String> getSchematics() {
|
||||
return schematics;
|
||||
}
|
||||
public void setSchematics(List<String> schematics) {
|
||||
this.schematics = schematics;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
@ -153,6 +161,7 @@ public class Field implements ViewStyleDefinition<eu.eudat.models.data.entities.
|
|||
field.setDefaultValue(this.defaultValue);
|
||||
field.setValidations(this.validations);
|
||||
field.setRdaCommonStandard(this.rdaCommonStandard);
|
||||
field.setSchematics(this.schematics);
|
||||
field.setExport(this.export);
|
||||
return field;
|
||||
}
|
||||
|
@ -167,6 +176,7 @@ public class Field implements ViewStyleDefinition<eu.eudat.models.data.entities.
|
|||
this.defaultValue = item.getDefaultValue();
|
||||
this.validations = item.getValidations();
|
||||
this.rdaCommonStandard = item.getRdaCommonStandard();
|
||||
this.schematics = item.getSchematics();
|
||||
this.export = item.getExport();
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ public class Field implements DatabaseViewStyleDefinition, XmlSerializable<Field
|
|||
private String id;
|
||||
private int ordinal;
|
||||
private String rdaCommonStandard;
|
||||
private List<String> schematics;
|
||||
private String numbering;
|
||||
private ViewStyle viewStyle;
|
||||
private DefaultValue defaultValue;
|
||||
|
@ -49,6 +50,13 @@ public class Field implements DatabaseViewStyleDefinition, XmlSerializable<Field
|
|||
this.rdaCommonStandard = rdaCommonStandard;
|
||||
}
|
||||
|
||||
public List<String> getSchematics() {
|
||||
return schematics;
|
||||
}
|
||||
public void setSchematics(List<String> schematics) {
|
||||
this.schematics = schematics;
|
||||
}
|
||||
|
||||
public ViewStyle getViewStyle() {
|
||||
return viewStyle;
|
||||
}
|
||||
|
@ -108,6 +116,13 @@ public class Field implements DatabaseViewStyleDefinition, XmlSerializable<Field
|
|||
Element rdaCommonStandard = doc.createElement("rdaCommonStandard");
|
||||
rdaCommonStandard.setTextContent(this.rdaCommonStandard);
|
||||
|
||||
Element schematics = doc.createElement("schematics");
|
||||
for(String s : this.schematics){
|
||||
Element schematic = doc.createElement("schematic");
|
||||
schematic.setTextContent(s);
|
||||
schematics.appendChild(schematic);
|
||||
}
|
||||
|
||||
Element viewStyle = doc.createElement("viewStyle");
|
||||
viewStyle.setAttribute("renderstyle", this.viewStyle.getRenderStyle());
|
||||
viewStyle.setAttribute("cssClass", this.viewStyle.getCssClass());
|
||||
|
@ -129,6 +144,7 @@ public class Field implements DatabaseViewStyleDefinition, XmlSerializable<Field
|
|||
numbering.setTextContent(this.numbering);
|
||||
|
||||
rootElement.appendChild(rdaCommonStandard);
|
||||
rootElement.appendChild(schematics);
|
||||
rootElement.appendChild(numbering);
|
||||
rootElement.appendChild(validations);
|
||||
rootElement.appendChild(defaultValue);
|
||||
|
@ -161,6 +177,18 @@ public class Field implements DatabaseViewStyleDefinition, XmlSerializable<Field
|
|||
Element rdaCommonStandard = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "rdaCommonStandard");
|
||||
if (rdaCommonStandard != null) this.rdaCommonStandard = rdaCommonStandard.getTextContent();
|
||||
|
||||
this.schematics = new LinkedList<>();
|
||||
Element schematics = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "schematics");
|
||||
if(schematics != null){
|
||||
NodeList schematicElements = schematics.getChildNodes();
|
||||
for (int temp = 0; temp < schematicElements.getLength(); temp++) {
|
||||
Node schematicElement = schematicElements.item(temp);
|
||||
if (schematicElement.getNodeType() == Node.ELEMENT_NODE) {
|
||||
this.schematics.add(schematicElement.getTextContent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Element dataElement = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "data");
|
||||
|
||||
Element defaultValue = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "defaultValue");
|
||||
|
|
|
@ -40,6 +40,7 @@ public class Field implements Comparable, PropertiesModelBuilder, ViewStyleDefin
|
|||
private List<eu.eudat.models.data.admin.components.datasetprofile.Field.ValidationType> validations;
|
||||
private Visibility visible;
|
||||
private String rdaProperty;
|
||||
private List<String> schematics;
|
||||
|
||||
private Boolean export;
|
||||
|
||||
|
@ -162,6 +163,14 @@ public class Field implements Comparable, PropertiesModelBuilder, ViewStyleDefin
|
|||
this.rdaProperty = rdaProperty;
|
||||
}
|
||||
|
||||
public List<String> getSchematics() {
|
||||
return schematics;
|
||||
}
|
||||
|
||||
public void setSchematics(List<String> schematics) {
|
||||
this.schematics = schematics;
|
||||
}
|
||||
|
||||
public Boolean getExport() {
|
||||
return export;
|
||||
}
|
||||
|
@ -182,6 +191,7 @@ public class Field implements Comparable, PropertiesModelBuilder, ViewStyleDefin
|
|||
newField.data = this.data;
|
||||
newField.validations = this.validations;
|
||||
newField.rdaProperty = this.rdaProperty;
|
||||
newField.schematics = this.schematics;
|
||||
newField.numbering = "mult" + index + "_" + this.numbering;
|
||||
newField.export = this.export;
|
||||
return newField;
|
||||
|
@ -197,6 +207,7 @@ public class Field implements Comparable, PropertiesModelBuilder, ViewStyleDefin
|
|||
field.setVisible(this.visible);
|
||||
field.setValidations(this.validations);
|
||||
field.setRdaCommonStandard(this.rdaProperty);
|
||||
field.setSchematics(this.schematics);
|
||||
field.setExport(this.export);
|
||||
return field;
|
||||
}
|
||||
|
@ -212,6 +223,7 @@ public class Field implements Comparable, PropertiesModelBuilder, ViewStyleDefin
|
|||
this.visible = item.getVisible();
|
||||
this.validations = item.getValidations();
|
||||
this.rdaProperty = item.getRdaCommonStandard();
|
||||
this.schematics = item.getSchematics();
|
||||
this.export = item.getExport();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,330 @@
|
|||
[
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.data_quality_assurance"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.access_url"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.available_until"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.byte_size"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.data_access"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.description"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.download_url"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.format"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.host.availability"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.host.backup_frequency"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.host.backup_type"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.host.certified_with"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.host.description"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.host.geo_location"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.host.pid_system"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.host.storage_type"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.host.supports_versioning"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.host.title"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.host.url"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.license.license_ref"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.license.start_date"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.distribution.title"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.keyword"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.language"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.metadata.description"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.metadata.language"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.metadata.metadata_standard_id"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.metadata.metadata_standard_id.identifier"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.metadata.metadata_standard_id.type"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.personal_data"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.preservation_statement"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.security_and_privacy"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.security_and_privacy.description"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.security_and_privacy.title"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.sensitive_data"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.technical_resource.description"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.technical_resource.name"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.title"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.type"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.issued"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.dataset_id"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.dataset_id.identifier"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.dataset_id.type"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dataset.description"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.contact"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.contact.contact_id.identifier"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.contact.contact_id.type"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.contact.mbox"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.contact.name"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.contributor"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.contributor.contributor_id.identifier"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.contributor.contributor_id.type"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.contributor.mbox"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.contributor.name"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.contributor.role"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.cost"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.cost.currency_code"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.cost.description"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.cost.title"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.cost.value"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.created"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.description"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.dmp_id"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.dmp_id.identifier"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.dmp_id.type"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.ethical_issues_description"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.ethical_issues_exist"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.ethical_issues_report"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.language"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.modified"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.project"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.project.description"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.project.end"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.project.funding"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.project.funding.funder_id.identifier"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.project.funding.funder_id.type"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.project.funding.funding_status"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.project.funding.grant_id.identifier"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.project.funding.grant_id.type"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.project.start"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.dmp.project.title"
|
||||
},
|
||||
{
|
||||
"category": "rda",
|
||||
"name": "rda.dmp.title"
|
||||
}
|
||||
]
|
|
@ -24,6 +24,7 @@ pdf.converter.url=http://localhost:3000/
|
|||
####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS##########
|
||||
configuration.externalUrls=externalUrls/ExternalUrls.xml
|
||||
configuration.rda=RDACommonStandards.txt
|
||||
configuration.schematics=Schematics.json
|
||||
configuration.h2020template=documents/h2020.docx
|
||||
configuration.h2020datasettemplate=documents/h2020_dataset.docx
|
||||
configuration.configurable_login_providers=configurableLoginProviders.json
|
||||
|
|
|
@ -50,6 +50,7 @@ elasticsearch.certKey=
|
|||
####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS##########
|
||||
configuration.externalUrls=externalUrls/ExternalUrls.xml
|
||||
configuration.rda=RDACommonStandards.txt
|
||||
configuration.schematics=Schematics.json
|
||||
configuration.h2020template=documents/h2020.docx
|
||||
configuration.h2020datasettemplate=documents/h2020_dataset.docx
|
||||
configuration.configurable_login_providers=configurableLoginProviders.json
|
||||
|
|
|
@ -60,6 +60,7 @@ export interface Field {
|
|||
visible: Visibility;
|
||||
validations: ValidationType[];
|
||||
rdaCommonStandard: string;
|
||||
schematics: string[];
|
||||
export: boolean;
|
||||
}
|
||||
|
||||
|
|
|
@ -90,4 +90,8 @@ export class DatasetProfileService extends BaseService {
|
|||
this.rdaCommonStandardsLoading = false;
|
||||
});
|
||||
}
|
||||
|
||||
searchSchematics(like: string): Observable<String[]> {
|
||||
return this.http.get<String[]>(this.actionUrl + "getSchematics?query=" + like);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ export class FieldEditorModel extends BaseFormModel {
|
|||
public data: FieldDataEditorModel<any>;
|
||||
public validations: ValidationType[] = [];
|
||||
public rdaCommonStandard: string;
|
||||
public schematics: string[];
|
||||
public export: boolean = true;
|
||||
|
||||
fromModel(item: Field): FieldEditorModel {
|
||||
|
@ -59,6 +60,7 @@ export class FieldEditorModel extends BaseFormModel {
|
|||
this.viewStyle = new ViewStyleEditorModel().fromModel(item.viewStyle);
|
||||
this.visible = new VisibilityEditorModel().fromModel(item.visible);
|
||||
this.rdaCommonStandard = item.rdaCommonStandard;
|
||||
this.schematics = item.schematics;
|
||||
this.export = item.export;
|
||||
|
||||
if (item.data) {
|
||||
|
@ -106,6 +108,7 @@ export class FieldEditorModel extends BaseFormModel {
|
|||
ordinal: [{ value: this.ordinal, disabled: (disabled && !skipDisable.includes('FieldEditorModel.ordinal')) }],
|
||||
validations: [{ value: this.validations, disabled: (disabled && !skipDisable.includes('FieldEditorModel.validations')) }],
|
||||
rdaCommonStandard: [{value: this.rdaCommonStandard, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.rdaCommonStandard')) }],
|
||||
schematics: [{ value: this.schematics, disabled: (disabled && !skipDisable.includes('FieldEditorModel.schematics')) }],
|
||||
export: [{value: this.export, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.export'))}]
|
||||
});
|
||||
|
||||
|
|
|
@ -227,13 +227,9 @@
|
|||
</mat-form-field> -->
|
||||
|
||||
<mat-form-field class="col-6">
|
||||
<mat-label>{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.RDA-COMMON-STANDARDS' | translate}}</mat-label>
|
||||
<mat-select [formControl]="this.form.get('rdaCommonStandard')">
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let property of datasetProfileService.getRDACommonStandards()" [value]="property">
|
||||
{{property}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-label>Schematics</mat-label>
|
||||
<app-multiple-auto-complete placeholder="Schematics" [hidePlaceholder]="true" required='false' [formControl]="this.form.get('schematics')" [configuration]="schematicsAutoCompleteConfiguration">
|
||||
</app-multiple-auto-complete>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-checkbox [formControl]="this.form.get('export')" class="col-6" [disabled]="viewOnly">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.EXPORT' | translate}}</mat-checkbox>
|
||||
|
|
|
@ -6,7 +6,7 @@ import {DatasetProfileService} from '@app/core/services/dataset-profile/dataset-
|
|||
import {EnumUtils} from '@app/core/services/utilities/enum-utils.service';
|
||||
import {RuleEditorModel} from '@app/ui/admin/dataset-profile/admin/rule-editor-model';
|
||||
import {BaseComponent} from '@common/base/base.component';
|
||||
import {Subscription} from 'rxjs';
|
||||
import {Observable, Subscription} from 'rxjs';
|
||||
import {ViewStyleType} from './view-style-enum';
|
||||
import {DatasetProfileComboBoxType} from '@app/core/common/enum/dataset-profile-combo-box-type';
|
||||
import {ErrorStateMatcher} from '@angular/material/core';
|
||||
|
@ -44,6 +44,8 @@ import {
|
|||
WordListFieldData
|
||||
} from '@app/core/model/dataset-profile-definition/field-data/field-data';
|
||||
import {ConfigurationService} from "@app/core/services/configuration/configuration.service";
|
||||
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dataset-profile-editor-field-component',
|
||||
|
@ -73,6 +75,17 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
|||
|
||||
//rdaCommonStandards = this.datasetProfileService.getRDACommonStandards(); //GK: Don't do that again. The service has a weird async behaviour.
|
||||
|
||||
schematicsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||
filterFn: this.filterSchematics.bind(this),
|
||||
initialItems: (excludedItems: any[]) => this.filterSchematics('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x !== resultItem)))),
|
||||
displayFn: (item) => item,
|
||||
titleFn: (item) => item
|
||||
}
|
||||
|
||||
filterSchematics(value: string): Observable<String[]> {
|
||||
return this.datasetProfileService.searchSchematics(value);
|
||||
}
|
||||
|
||||
constructor(
|
||||
public enumUtils: EnumUtils,
|
||||
public datasetProfileService: DatasetProfileService,
|
||||
|
|
|
@ -12,5 +12,6 @@
|
|||
"WordListFieldDataEditorModel.label",
|
||||
"FieldDataOptionEditorModel.label",
|
||||
"FieldSetEditorModel.rdaCommonStandard",
|
||||
"FieldSetEditorModel.schematics",
|
||||
"FieldSetEditorModel.export"
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue