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
This commit is contained in:
commit
cc926970ca
|
@ -15,6 +15,7 @@ import eu.eudat.logic.proxy.config.configloaders.ConfigLoader;
|
||||||
import eu.eudat.logic.security.claims.ClaimedAuthorities;
|
import eu.eudat.logic.security.claims.ClaimedAuthorities;
|
||||||
import eu.eudat.logic.services.ApiContext;
|
import eu.eudat.logic.services.ApiContext;
|
||||||
import eu.eudat.logic.services.forms.VisibilityRuleService;
|
import eu.eudat.logic.services.forms.VisibilityRuleService;
|
||||||
|
import eu.eudat.logic.services.forms.VisibilityRuleServiceImpl;
|
||||||
import eu.eudat.logic.utilities.documents.helpers.FileEnvelope;
|
import eu.eudat.logic.utilities.documents.helpers.FileEnvelope;
|
||||||
import eu.eudat.logic.utilities.documents.pdf.PDFUtils;
|
import eu.eudat.logic.utilities.documents.pdf.PDFUtils;
|
||||||
import eu.eudat.models.data.dataset.DatasetOverviewModel;
|
import eu.eudat.models.data.dataset.DatasetOverviewModel;
|
||||||
|
@ -126,11 +127,11 @@ public class Datasets extends BaseController {
|
||||||
public @ResponseBody
|
public @ResponseBody
|
||||||
ResponseEntity getSingle(@PathVariable String id, @RequestHeader("Content-Type") String contentType, @ClaimedAuthorities(claims = {Authorities.ADMIN, Authorities.MANAGER, Authorities.USER, Authorities.ANONYMOUS}) Principal principal) throws IllegalAccessException, IOException, InstantiationException {
|
ResponseEntity getSingle(@PathVariable String id, @RequestHeader("Content-Type") String contentType, @ClaimedAuthorities(claims = {Authorities.ADMIN, Authorities.MANAGER, Authorities.USER, Authorities.ANONYMOUS}) Principal principal) throws IllegalAccessException, IOException, InstantiationException {
|
||||||
try {
|
try {
|
||||||
|
VisibilityRuleService visibilityRuleService = new VisibilityRuleServiceImpl();
|
||||||
if (contentType.equals("application/xml")) {
|
if (contentType.equals("application/xml")) {
|
||||||
VisibilityRuleService visibilityRuleService = this.getApiContext().getUtilitiesService().getVisibilityRuleService();
|
|
||||||
return this.datasetManager.getDocument(id, visibilityRuleService, contentType, principal);
|
return this.datasetManager.getDocument(id, visibilityRuleService, contentType, principal);
|
||||||
} else if (contentType.equals("application/msword")) {
|
} else if (contentType.equals("application/msword")) {
|
||||||
FileEnvelope file = datasetManager.getWordDocumentFile(this.configLoader, id, this.getApiContext().getUtilitiesService().getVisibilityRuleService(), principal);
|
FileEnvelope file = datasetManager.getWordDocumentFile(this.configLoader, id, visibilityRuleService, principal);
|
||||||
InputStream resource = new FileInputStream(file.getFile());
|
InputStream resource = new FileInputStream(file.getFile());
|
||||||
HttpHeaders responseHeaders = new HttpHeaders();
|
HttpHeaders responseHeaders = new HttpHeaders();
|
||||||
responseHeaders.setContentLength(file.getFile().length());
|
responseHeaders.setContentLength(file.getFile().length());
|
||||||
|
@ -218,7 +219,7 @@ public class Datasets extends BaseController {
|
||||||
@RequestMapping(method = RequestMethod.GET, value = {"/getPDF/{id}"})
|
@RequestMapping(method = RequestMethod.GET, value = {"/getPDF/{id}"})
|
||||||
public @ResponseBody
|
public @ResponseBody
|
||||||
ResponseEntity<byte[]> getPDFDocument(@PathVariable String id, @ClaimedAuthorities(claims = {Authorities.ADMIN, Authorities.MANAGER, Authorities.USER, Authorities.ANONYMOUS}) Principal principal) throws IllegalAccessException, IOException, InstantiationException, InterruptedException {
|
ResponseEntity<byte[]> getPDFDocument(@PathVariable String id, @ClaimedAuthorities(claims = {Authorities.ADMIN, Authorities.MANAGER, Authorities.USER, Authorities.ANONYMOUS}) Principal principal) throws IllegalAccessException, IOException, InstantiationException, InterruptedException {
|
||||||
FileEnvelope file = datasetManager.getWordDocumentFile(this.configLoader, id, this.getApiContext().getUtilitiesService().getVisibilityRuleService(), principal);
|
FileEnvelope file = datasetManager.getWordDocumentFile(this.configLoader, id, new VisibilityRuleServiceImpl(), principal);
|
||||||
String fileName = file.getFilename().replace(" ", "_").replace(",", "_");
|
String fileName = file.getFilename().replace(" ", "_").replace(",", "_");
|
||||||
if (fileName.endsWith(".docx")){
|
if (fileName.endsWith(".docx")){
|
||||||
fileName = fileName.substring(0, fileName.length() - 5);
|
fileName = fileName.substring(0, fileName.length() - 5);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package eu.eudat.logic.managers;
|
package eu.eudat.logic.managers;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonParser;
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import eu.eudat.configurations.dynamicgrant.DynamicGrantConfiguration;
|
import eu.eudat.configurations.dynamicgrant.DynamicGrantConfiguration;
|
||||||
import eu.eudat.configurations.dynamicgrant.entities.Property;
|
import eu.eudat.configurations.dynamicgrant.entities.Property;
|
||||||
|
@ -33,6 +31,7 @@ import eu.eudat.logic.mapper.elastic.criteria.DmpCriteriaMapper;
|
||||||
import eu.eudat.logic.proxy.config.configloaders.ConfigLoader;
|
import eu.eudat.logic.proxy.config.configloaders.ConfigLoader;
|
||||||
import eu.eudat.logic.services.ApiContext;
|
import eu.eudat.logic.services.ApiContext;
|
||||||
import eu.eudat.logic.services.forms.VisibilityRuleService;
|
import eu.eudat.logic.services.forms.VisibilityRuleService;
|
||||||
|
import eu.eudat.logic.services.forms.VisibilityRuleServiceImpl;
|
||||||
import eu.eudat.logic.services.operations.DatabaseRepository;
|
import eu.eudat.logic.services.operations.DatabaseRepository;
|
||||||
import eu.eudat.logic.services.utilities.UtilitiesService;
|
import eu.eudat.logic.services.utilities.UtilitiesService;
|
||||||
import eu.eudat.logic.utilities.builders.XmlBuilder;
|
import eu.eudat.logic.utilities.builders.XmlBuilder;
|
||||||
|
@ -106,7 +105,6 @@ public class DataManagementPlanManager {
|
||||||
|
|
||||||
private ApiContext apiContext;
|
private ApiContext apiContext;
|
||||||
private DatasetManager datasetManager;
|
private DatasetManager datasetManager;
|
||||||
private UtilitiesService utilitiesService;
|
|
||||||
private DatabaseRepository databaseRepository;
|
private DatabaseRepository databaseRepository;
|
||||||
private Environment environment;
|
private Environment environment;
|
||||||
private RDAManager rdaManager;
|
private RDAManager rdaManager;
|
||||||
|
@ -117,7 +115,6 @@ public class DataManagementPlanManager {
|
||||||
public DataManagementPlanManager(ApiContext apiContext, DatasetManager datasetManager, Environment environment, RDAManager rdaManager, UserManager userManager, MetricsManager metricsManager) {
|
public DataManagementPlanManager(ApiContext apiContext, DatasetManager datasetManager, Environment environment, RDAManager rdaManager, UserManager userManager, MetricsManager metricsManager) {
|
||||||
this.apiContext = apiContext;
|
this.apiContext = apiContext;
|
||||||
this.datasetManager = datasetManager;
|
this.datasetManager = datasetManager;
|
||||||
this.utilitiesService = apiContext.getUtilitiesService();
|
|
||||||
this.databaseRepository = apiContext.getOperationsContext().getDatabaseRepository();
|
this.databaseRepository = apiContext.getOperationsContext().getDatabaseRepository();
|
||||||
this.environment = environment;
|
this.environment = environment;
|
||||||
this.rdaManager = rdaManager;
|
this.rdaManager = rdaManager;
|
||||||
|
@ -1172,7 +1169,7 @@ public class DataManagementPlanManager {
|
||||||
|
|
||||||
public FileEnvelope getWordDocument(String id, Principal principal, ConfigLoader configLoader, Boolean versioned) throws IOException {
|
public FileEnvelope getWordDocument(String id, Principal principal, ConfigLoader configLoader, Boolean versioned) throws IOException {
|
||||||
WordBuilder wordBuilder = new WordBuilder();
|
WordBuilder wordBuilder = new WordBuilder();
|
||||||
VisibilityRuleService visibilityRuleService = this.utilitiesService.getVisibilityRuleService();
|
VisibilityRuleService visibilityRuleService = new VisibilityRuleServiceImpl();
|
||||||
DatasetWizardModel dataset = new DatasetWizardModel();
|
DatasetWizardModel dataset = new DatasetWizardModel();
|
||||||
XWPFDocument document = configLoader.getDocument();
|
XWPFDocument document = configLoader.getDocument();
|
||||||
|
|
||||||
|
@ -1341,7 +1338,7 @@ public class DataManagementPlanManager {
|
||||||
|
|
||||||
private FileEnvelope getXmlDocument(String id, Principal principal) throws InstantiationException, IllegalAccessException, IOException {
|
private FileEnvelope getXmlDocument(String id, Principal principal) throws InstantiationException, IllegalAccessException, IOException {
|
||||||
ExportXmlBuilder xmlBuilder = new ExportXmlBuilder();
|
ExportXmlBuilder xmlBuilder = new ExportXmlBuilder();
|
||||||
VisibilityRuleService visibilityRuleService = utilitiesService.getVisibilityRuleService();
|
VisibilityRuleService visibilityRuleService = new VisibilityRuleServiceImpl();
|
||||||
eu.eudat.data.entities.DMP dmp = databaseRepository.getDmpDao().find(UUID.fromString(id));
|
eu.eudat.data.entities.DMP dmp = databaseRepository.getDmpDao().find(UUID.fromString(id));
|
||||||
if (!dmp.isPublic() && dmp.getUsers().stream().filter(userInfo -> userInfo.getUser().getId() == principal.getId()).collect(Collectors.toList()).size() == 0)
|
if (!dmp.isPublic() && dmp.getUsers().stream().filter(userInfo -> userInfo.getUser().getId() == principal.getId()).collect(Collectors.toList()).size() == 0)
|
||||||
throw new UnauthorisedException();
|
throw new UnauthorisedException();
|
||||||
|
|
|
@ -164,18 +164,23 @@ public class DataManagementProfileManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Tuple<String, String>> externalAutocompleteRequest(DmpProfileExternalAutoComplete data, String like) {
|
private List<Tuple<String, String>> externalAutocompleteRequest(DmpProfileExternalAutoComplete data, String like) {
|
||||||
List<Tuple<String, String>> result = new LinkedList<>();
|
return externalAutocompleteRequest(data.getUrl(), data.getOptionsRoot(), data.getLabel(), data.getValue(), like);
|
||||||
RestTemplate restTemplate = new RestTemplate();
|
|
||||||
HttpHeaders headers = new HttpHeaders();
|
|
||||||
headers.setAccept(Collections.singletonList(MediaType.valueOf("application/vnd.api+json; charset=utf-8")));
|
|
||||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
|
||||||
HttpEntity<String> entity = new HttpEntity<>("parameters", headers);
|
|
||||||
|
|
||||||
ResponseEntity<Object> response = restTemplate.exchange(data.getUrl() + "?search=" + like, HttpMethod.GET, entity, Object.class);
|
|
||||||
DocumentContext jsonContext = JsonPath.parse(response.getBody());
|
|
||||||
|
|
||||||
List<Map<String, String>> jsonItems = jsonContext.read(data.getOptionsRoot() + "['" + data.getLabel() + "','" + data.getValue() + "']");
|
|
||||||
jsonItems.forEach(item -> result.add(new Tuple<>(item.get(data.getValue()), item.get(data.getLabel()))));
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<Tuple<String, String>> externalAutocompleteRequest(String url, String optionsRoot, String label, String value, String like) {
|
||||||
|
List<Tuple<String, String>> result = new LinkedList<>();
|
||||||
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setAccept(Collections.singletonList(MediaType.valueOf("application/vnd.api+json; charset=utf-8")));
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
HttpEntity<String> entity = new HttpEntity<>("parameters", headers);
|
||||||
|
|
||||||
|
ResponseEntity<Object> response = restTemplate.exchange(url + "?search=" + like, HttpMethod.GET, entity, Object.class);
|
||||||
|
DocumentContext jsonContext = JsonPath.parse(response.getBody());
|
||||||
|
|
||||||
|
List<Map<String, String>> jsonItems = jsonContext.read(optionsRoot + "['" + label + "','" + value + "']");
|
||||||
|
jsonItems.forEach(item -> result.add(new Tuple<>(item.get(value), item.get(label))));
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ import eu.eudat.logic.mapper.elastic.criteria.DmpCriteriaMapper;
|
||||||
import eu.eudat.logic.proxy.config.configloaders.ConfigLoader;
|
import eu.eudat.logic.proxy.config.configloaders.ConfigLoader;
|
||||||
import eu.eudat.logic.services.ApiContext;
|
import eu.eudat.logic.services.ApiContext;
|
||||||
import eu.eudat.logic.services.forms.VisibilityRuleService;
|
import eu.eudat.logic.services.forms.VisibilityRuleService;
|
||||||
|
import eu.eudat.logic.services.forms.VisibilityRuleServiceImpl;
|
||||||
import eu.eudat.logic.services.operations.DatabaseRepository;
|
import eu.eudat.logic.services.operations.DatabaseRepository;
|
||||||
import eu.eudat.logic.utilities.documents.helpers.FileEnvelope;
|
import eu.eudat.logic.utilities.documents.helpers.FileEnvelope;
|
||||||
import eu.eudat.logic.utilities.documents.types.ParagraphStyle;
|
import eu.eudat.logic.utilities.documents.types.ParagraphStyle;
|
||||||
|
@ -49,7 +50,6 @@ import eu.eudat.models.data.user.composite.PagedDatasetProfile;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import eu.eudat.types.Authorities;
|
import eu.eudat.types.Authorities;
|
||||||
import eu.eudat.types.MetricNames;
|
import eu.eudat.types.MetricNames;
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
|
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
||||||
|
@ -60,11 +60,11 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.core.io.FileSystemResource;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.*;
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.util.LinkedMultiValueMap;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
|
@ -91,8 +91,6 @@ import java.time.temporal.ChronoUnit;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import java.util.zip.ZipEntry;
|
|
||||||
import java.util.zip.ZipInputStream;
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class DatasetManager {
|
public class DatasetManager {
|
||||||
|
@ -527,7 +525,7 @@ public class DatasetManager {
|
||||||
public String getWordDocumentText (Dataset datasetEntity) throws Exception {
|
public String getWordDocumentText (Dataset datasetEntity) throws Exception {
|
||||||
DatasetWizardModel datasetWizardModel = new DatasetWizardModel().fromDataModel(datasetEntity);
|
DatasetWizardModel datasetWizardModel = new DatasetWizardModel().fromDataModel(datasetEntity);
|
||||||
datasetWizardModel.setDatasetProfileDefinition(this.getPagedProfile(datasetWizardModel, datasetEntity));
|
datasetWizardModel.setDatasetProfileDefinition(this.getPagedProfile(datasetWizardModel, datasetEntity));
|
||||||
XWPFDocument document = getLightWordDocument(this.configLoader, datasetWizardModel, this.apiContext.getUtilitiesService().getVisibilityRuleService());
|
XWPFDocument document = getLightWordDocument(this.configLoader, datasetWizardModel, new VisibilityRuleServiceImpl());
|
||||||
XWPFWordExtractor extractor = new XWPFWordExtractor(document);
|
XWPFWordExtractor extractor = new XWPFWordExtractor(document);
|
||||||
return extractor.getText();/*.replaceAll("\n\\s*", " ");*/
|
return extractor.getText();/*.replaceAll("\n\\s*", " ");*/
|
||||||
}
|
}
|
||||||
|
@ -657,7 +655,7 @@ public class DatasetManager {
|
||||||
|
|
||||||
|
|
||||||
JSONObject obj = new JSONObject(dataset.getProperties());
|
JSONObject obj = new JSONObject(dataset.getProperties());
|
||||||
VisibilityRuleService visibilityRuleService = this.apiContext.getUtilitiesService().getVisibilityRuleService();
|
VisibilityRuleService visibilityRuleService = new VisibilityRuleServiceImpl();
|
||||||
visibilityRuleService.setProperties(obj.toMap());
|
visibilityRuleService.setProperties(obj.toMap());
|
||||||
|
|
||||||
dataset.setProfile(profile);
|
dataset.setProfile(profile);
|
||||||
|
@ -666,12 +664,16 @@ public class DatasetManager {
|
||||||
|
|
||||||
|
|
||||||
for (String validator : datasetProfileValidators) {
|
for (String validator : datasetProfileValidators) {
|
||||||
if ((obj.has(validator) && (obj.getString(validator) == null || obj.getString(validator).trim().isEmpty())) && isElementVisible(nodeList, validator, visibilityRuleService)) {
|
if (obj.has(validator) && isNullOrEmpty(obj.getString(validator)) && isElementVisible(nodeList, validator, visibilityRuleService)) {
|
||||||
throw new Exception("Field value of " + validator + " must be filled.");
|
throw new Exception("Field value of " + validator + " must be filled.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isNullOrEmpty(String value) {
|
||||||
|
return value == null || value.trim().isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isElementVisible(NodeList nodeList, String id, VisibilityRuleService visibilityRuleService) {
|
private boolean isElementVisible(NodeList nodeList, String id, VisibilityRuleService visibilityRuleService) {
|
||||||
Element fieldSet = null;
|
Element fieldSet = null;
|
||||||
for (int i = 0; i < nodeList.getLength(); i++) {
|
for (int i = 0; i < nodeList.getLength(); i++) {
|
||||||
|
@ -1048,10 +1050,13 @@ public class DatasetManager {
|
||||||
Set<JsonNode> tagNodes = new HashSet<>();
|
Set<JsonNode> tagNodes = new HashSet<>();
|
||||||
tagNodes.addAll(JsonSearcher.findNodes(propertiesJson, "renderStyle", "tags", true));
|
tagNodes.addAll(JsonSearcher.findNodes(propertiesJson, "renderStyle", "tags", true));
|
||||||
tagNodes.addAll(JsonSearcher.findNodes(propertiesJson, "rdaProperty", "dataset.keyword"));
|
tagNodes.addAll(JsonSearcher.findNodes(propertiesJson, "rdaProperty", "dataset.keyword"));
|
||||||
|
if(wizardModel.getTags() == null){
|
||||||
|
wizardModel.setTags(new ArrayList<>());
|
||||||
|
}
|
||||||
if (!tagNodes.isEmpty()) {
|
if (!tagNodes.isEmpty()) {
|
||||||
tagNodes.forEach(node -> {
|
tagNodes.forEach(node -> {
|
||||||
JsonNode value = node.get("value");
|
JsonNode value = node.get("value");
|
||||||
if (!value.toString().equals("\"\"")) {
|
if (!value.toString().equals("\"\"") && !value.toString().equals("null")) {
|
||||||
String stringValue = value.toString().replaceAll("=", ":");
|
String stringValue = value.toString().replaceAll("=", ":");
|
||||||
JSONArray values = new JSONArray(stringValue);
|
JSONArray values = new JSONArray(stringValue);
|
||||||
values.iterator().forEachRemaining(element -> {
|
values.iterator().forEachRemaining(element -> {
|
||||||
|
|
|
@ -1,30 +1,26 @@
|
||||||
package eu.eudat.logic.services.forms;
|
package eu.eudat.logic.services.forms;
|
||||||
|
|
||||||
import eu.eudat.models.data.user.components.commons.Rule;
|
import eu.eudat.models.data.user.components.commons.Rule;
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by ikalyvas on 3/5/2018.
|
* Created by ikalyvas on 3/5/2018.
|
||||||
*/
|
*/
|
||||||
@Service("visibilityRuleService")
|
|
||||||
public class VisibilityRuleServiceImpl implements VisibilityRuleService {
|
public class VisibilityRuleServiceImpl implements VisibilityRuleService {
|
||||||
private Map<String, Boolean> elementVisibility = new HashMap<>();
|
private final Map<String, Boolean> elementVisibility = new HashMap<>();
|
||||||
private VisibilityContext visibilityContext;
|
|
||||||
private Map<String, Object> properties;
|
private Map<String, Object> properties;
|
||||||
|
|
||||||
public boolean isElementVisible(String id) {
|
public boolean isElementVisible(String id) {
|
||||||
if (!this.elementVisibility.containsKey(id) || this.elementVisibility.get(id)) return true;
|
return !this.elementVisibility.containsKey(id) || this.elementVisibility.get(id);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setProperties(Map<String, Object> properties) {
|
public void setProperties(Map<String, Object> properties) {
|
||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
this.properties.entrySet().stream()
|
this.properties.entrySet().stream()
|
||||||
.filter(stringObjectEntry -> stringObjectEntry.getValue() instanceof String && ((String) stringObjectEntry.getValue()).startsWith("[") && ((String) stringObjectEntry.getValue()).endsWith("]")).forEach(stringObjectEntry -> {
|
.filter(stringObjectEntry -> stringObjectEntry.getValue() instanceof String && ((String) stringObjectEntry.getValue()).startsWith("[")
|
||||||
stringObjectEntry.setValue(parseArray((String) stringObjectEntry.getValue()));
|
&& ((String) stringObjectEntry.getValue()).endsWith("]"))
|
||||||
});
|
.forEach(stringObjectEntry -> stringObjectEntry.setValue(parseArray((String) stringObjectEntry.getValue())));
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> parseArray(String original) {
|
private List<String> parseArray(String original) {
|
||||||
|
@ -33,19 +29,20 @@ public class VisibilityRuleServiceImpl implements VisibilityRuleService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void buildVisibilityContext(List<Rule> sources) {
|
public void buildVisibilityContext(List<Rule> sources) {
|
||||||
this.visibilityContext = new VisibilityContext();
|
VisibilityContext visibilityContext = new VisibilityContext();
|
||||||
this.visibilityContext.buildVisibilityContext(sources);
|
visibilityContext.buildVisibilityContext(sources);
|
||||||
this.visibilityContext.getVisibilityRules().forEach(item-> this.evaluateVisibility(item));
|
visibilityContext.getVisibilityRules().forEach(this::evaluateVisibility);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void evaluateVisibility(VisibilityRule rule) {
|
private void evaluateVisibility(VisibilityRule rule) {
|
||||||
List<VisibilityRuleSource> sources = rule.getVisibilityRuleSources();
|
List<VisibilityRuleSource> sources = rule.getVisibilityRuleSources();
|
||||||
for(int i = 0; i < sources.size(); i++){
|
for(VisibilityRuleSource source: sources){
|
||||||
if (properties.containsKey(sources.get(i).getVisibilityRuleSourceId()) && (isContained(properties.get(sources.get(i).getVisibilityRuleSourceId()), sources.get(i).getVisibilityRuleSourceValue()) || properties.get(sources.get(i).getVisibilityRuleSourceId()).equals(sources.get(i).getVisibilityRuleSourceValue()))) {
|
if (properties.containsKey(source.getVisibilityRuleSourceId())
|
||||||
|
&& isContained(properties.get(source.getVisibilityRuleSourceId()), source.getVisibilityRuleSourceValue())) {
|
||||||
this.elementVisibility.put(rule.getVisibilityRuleTargetId(), true);
|
this.elementVisibility.put(rule.getVisibilityRuleTargetId(), true);
|
||||||
}else{
|
} else {
|
||||||
this.elementVisibility.put(rule.getVisibilityRuleTargetId(), false);
|
this.elementVisibility.put(rule.getVisibilityRuleTargetId(),
|
||||||
return;
|
this.elementVisibility.getOrDefault(rule.getVisibilityRuleTargetId(), false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +50,8 @@ public class VisibilityRuleServiceImpl implements VisibilityRuleService {
|
||||||
private Boolean isContained(Object values, String source) {
|
private Boolean isContained(Object values, String source) {
|
||||||
if (values instanceof List) {
|
if (values instanceof List) {
|
||||||
return ((Collection<?>) values).contains(source);
|
return ((Collection<?>) values).contains(source);
|
||||||
|
} else {
|
||||||
|
return values.equals(source);
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,5 @@ public interface UtilitiesService {
|
||||||
|
|
||||||
MailService getMailService();
|
MailService getMailService();
|
||||||
|
|
||||||
VisibilityRuleService getVisibilityRuleService();
|
|
||||||
|
|
||||||
ConfirmationEmailService getConfirmationEmailService();
|
ConfirmationEmailService getConfirmationEmailService();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package eu.eudat.logic.services.utilities;
|
package eu.eudat.logic.services.utilities;
|
||||||
|
|
||||||
import eu.eudat.logic.services.forms.VisibilityRuleService;
|
import eu.eudat.logic.services.forms.VisibilityRuleService;
|
||||||
|
import eu.eudat.logic.services.forms.VisibilityRuleServiceImpl;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -12,22 +13,15 @@ public class UtilitiesServiceImpl implements UtilitiesService {
|
||||||
|
|
||||||
private InvitationService invitationService;
|
private InvitationService invitationService;
|
||||||
private MailService mailService;
|
private MailService mailService;
|
||||||
private VisibilityRuleService visibilityRuleService;
|
|
||||||
private ConfirmationEmailService confirmationEmailService;
|
private ConfirmationEmailService confirmationEmailService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public UtilitiesServiceImpl(InvitationService invitationService, MailService mailService, VisibilityRuleService visibilityRuleService, ConfirmationEmailService confirmationEmailService) {
|
public UtilitiesServiceImpl(InvitationService invitationService, MailService mailService, ConfirmationEmailService confirmationEmailService) {
|
||||||
this.invitationService = invitationService;
|
this.invitationService = invitationService;
|
||||||
this.mailService = mailService;
|
this.mailService = mailService;
|
||||||
this.visibilityRuleService = visibilityRuleService;
|
|
||||||
this.confirmationEmailService = confirmationEmailService;
|
this.confirmationEmailService = confirmationEmailService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public VisibilityRuleService getVisibilityRuleService() {
|
|
||||||
return visibilityRuleService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ConfirmationEmailService getConfirmationEmailService() {
|
public ConfirmationEmailService getConfirmationEmailService() {
|
||||||
return confirmationEmailService;
|
return confirmationEmailService;
|
||||||
|
|
|
@ -27,7 +27,9 @@ import java.io.IOException;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
|
import java.time.ZoneOffset;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.format.DateTimeParseException;
|
import java.time.format.DateTimeParseException;
|
||||||
import java.time.temporal.TemporalAccessor;
|
import java.time.temporal.TemporalAccessor;
|
||||||
|
@ -191,6 +193,7 @@ public class WordBuilder {
|
||||||
private Boolean createCompositeFields(List<FieldSet> compositeFields, XWPFDocument mainDocumentPart, Integer indent, Boolean createListing, VisibilityRuleService visibilityRuleService, Integer page, String section) {
|
private Boolean createCompositeFields(List<FieldSet> compositeFields, XWPFDocument mainDocumentPart, Integer indent, Boolean createListing, VisibilityRuleService visibilityRuleService, Integer page, String section) {
|
||||||
if (createListing) this.addListing(mainDocumentPart, indent, true, true);
|
if (createListing) this.addListing(mainDocumentPart, indent, true, true);
|
||||||
boolean hasValue = false;
|
boolean hasValue = false;
|
||||||
|
boolean returnedValue = false;
|
||||||
for (FieldSet compositeField: compositeFields) {
|
for (FieldSet compositeField: compositeFields) {
|
||||||
if (visibilityRuleService.isElementVisible(compositeField.getId()) && hasVisibleFields(compositeField, visibilityRuleService)) {
|
if (visibilityRuleService.isElementVisible(compositeField.getId()) && hasVisibleFields(compositeField, visibilityRuleService)) {
|
||||||
char c = 'a';
|
char c = 'a';
|
||||||
|
@ -205,6 +208,9 @@ public class WordBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hasValue = createFields(compositeField.getFields(), mainDocumentPart, 3, createListing, visibilityRuleService);
|
hasValue = createFields(compositeField.getFields(), mainDocumentPart, 3, createListing, visibilityRuleService);
|
||||||
|
if(hasValue){
|
||||||
|
returnedValue = true;
|
||||||
|
}
|
||||||
if (compositeField.getMultiplicityItems() != null && !compositeField.getMultiplicityItems().isEmpty()) {
|
if (compositeField.getMultiplicityItems() != null && !compositeField.getMultiplicityItems().isEmpty()) {
|
||||||
List<FieldSet> list = compositeField.getMultiplicityItems().stream().sorted(Comparator.comparingInt(FieldSet::getOrdinal)).collect(Collectors.toList());
|
List<FieldSet> list = compositeField.getMultiplicityItems().stream().sorted(Comparator.comparingInt(FieldSet::getOrdinal)).collect(Collectors.toList());
|
||||||
for (FieldSet multiplicityFieldset : list) {
|
for (FieldSet multiplicityFieldset : list) {
|
||||||
|
@ -213,6 +219,9 @@ public class WordBuilder {
|
||||||
addParagraphContent(c + ".\n", mainDocumentPart, ParagraphStyle.HEADER6, numId);
|
addParagraphContent(c + ".\n", mainDocumentPart, ParagraphStyle.HEADER6, numId);
|
||||||
}
|
}
|
||||||
hasValue = createFields(multiplicityFieldset.getFields(), mainDocumentPart, 3, createListing, visibilityRuleService);
|
hasValue = createFields(multiplicityFieldset.getFields(), mainDocumentPart, 3, createListing, visibilityRuleService);
|
||||||
|
if(hasValue){
|
||||||
|
returnedValue = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (hasValue && compositeField.getHasCommentField() && compositeField.getCommentFieldValue() != null && !compositeField.getCommentFieldValue().isEmpty() && !createListing) {
|
if (hasValue && compositeField.getHasCommentField() && compositeField.getCommentFieldValue() != null && !compositeField.getCommentFieldValue().isEmpty() && !createListing) {
|
||||||
|
@ -225,7 +234,7 @@ public class WordBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return hasValue;
|
return returnedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Boolean createFields(List<Field> fields, XWPFDocument mainDocumentPart, Integer indent, Boolean createListing, VisibilityRuleService visibilityRuleService) {
|
private Boolean createFields(List<Field> fields, XWPFDocument mainDocumentPart, Integer indent, Boolean createListing, VisibilityRuleService visibilityRuleService) {
|
||||||
|
@ -395,7 +404,7 @@ public class WordBuilder {
|
||||||
try {
|
try {
|
||||||
instant = Instant.parse((String) field.getValue());
|
instant = Instant.parse((String) field.getValue());
|
||||||
} catch (DateTimeParseException ex) {
|
} catch (DateTimeParseException ex) {
|
||||||
instant = Instant.from(DateTimeFormatter.ofPattern("yyyy-MM-dd").withZone(ZoneId.systemDefault()).parse((String) field.getValue()));
|
instant = LocalDate.parse((String) field.getValue()).atStartOfDay().toInstant(ZoneOffset.UTC);
|
||||||
}
|
}
|
||||||
return field.getValue() != null ? DateTimeFormatter.ofPattern("yyyy-MM-dd").withZone(ZoneId.systemDefault()).format(instant) : "";
|
return field.getValue() != null ? DateTimeFormatter.ofPattern("yyyy-MM-dd").withZone(ZoneId.systemDefault()).format(instant) : "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,6 +163,11 @@ public class ExportXmlBuilderDatasetProfile {
|
||||||
numbering.setTextContent(field.getNumbering());
|
numbering.setTextContent(field.getNumbering());
|
||||||
elementField.appendChild(numbering);
|
elementField.appendChild(numbering);
|
||||||
}
|
}
|
||||||
|
if (field.getRdaProperty() != null) {
|
||||||
|
Element rdaProperty = element.createElement("rdaProperty");
|
||||||
|
rdaProperty.setTextContent(field.getRdaProperty());
|
||||||
|
elementField.appendChild(rdaProperty);
|
||||||
|
}
|
||||||
if (field.getValidations() != null) {
|
if (field.getValidations() != null) {
|
||||||
Element validations = element.createElement("validations");
|
Element validations = element.createElement("validations");
|
||||||
field.getValidations().forEach(validation -> {
|
field.getValidations().forEach(validation -> {
|
||||||
|
|
|
@ -29,6 +29,8 @@ public class Field {
|
||||||
|
|
||||||
private Object data;
|
private Object data;
|
||||||
|
|
||||||
|
private String rdaProperty;
|
||||||
|
|
||||||
@XmlAttribute(name = "id")
|
@XmlAttribute(name = "id")
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
|
@ -101,6 +103,15 @@ public class Field {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "rdaProperty")
|
||||||
|
public String getRdaProperty() {
|
||||||
|
return rdaProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRdaProperty(String rdaProperty) {
|
||||||
|
this.rdaProperty = rdaProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public eu.eudat.models.data.admin.components.datasetprofile.Field toAdminCompositeModelSection() {
|
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();
|
eu.eudat.models.data.admin.components.datasetprofile.Field fieldEntity =new eu.eudat.models.data.admin.components.datasetprofile.Field();
|
||||||
|
@ -120,6 +131,7 @@ public class Field {
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
fieldEntity.setData(data.toMap((Element) this.data));
|
fieldEntity.setData(data.toMap((Element) this.data));
|
||||||
}
|
}
|
||||||
|
fieldEntity.setRdaCommonStandard(this.rdaProperty);
|
||||||
return fieldEntity;
|
return fieldEntity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ import java.util.stream.Collectors;
|
||||||
public class Field implements ViewStyleDefinition<eu.eudat.models.data.entities.xmlmodels.datasetprofiledefinition.Field>, Comparable {
|
public class Field implements ViewStyleDefinition<eu.eudat.models.data.entities.xmlmodels.datasetprofiledefinition.Field>, Comparable {
|
||||||
|
|
||||||
public enum ValidationType {
|
public enum ValidationType {
|
||||||
NONE((short) 0), REQUIRED((short) 1);
|
NONE((short) 0), REQUIRED((short) 1), URL((short) 2);
|
||||||
private short value;
|
private short value;
|
||||||
|
|
||||||
private ValidationType(short value) {
|
private ValidationType(short value) {
|
||||||
|
@ -30,6 +30,8 @@ public class Field implements ViewStyleDefinition<eu.eudat.models.data.entities.
|
||||||
return NONE;
|
return NONE;
|
||||||
case 1:
|
case 1:
|
||||||
return REQUIRED;
|
return REQUIRED;
|
||||||
|
case 2:
|
||||||
|
return URL;
|
||||||
default:
|
default:
|
||||||
return NONE;
|
return NONE;
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import eu.eudat.data.entities.*;
|
import eu.eudat.data.entities.*;
|
||||||
import eu.eudat.elastic.entities.Tag;
|
import eu.eudat.elastic.entities.Tag;
|
||||||
|
import eu.eudat.logic.managers.DataManagementProfileManager;
|
||||||
import eu.eudat.logic.managers.DatasetManager;
|
import eu.eudat.logic.managers.DatasetManager;
|
||||||
import eu.eudat.logic.proxy.config.entities.PrefillingFixedMapping;
|
import eu.eudat.logic.proxy.config.entities.PrefillingFixedMapping;
|
||||||
import eu.eudat.logic.proxy.config.entities.PrefillingGet;
|
import eu.eudat.logic.proxy.config.entities.PrefillingGet;
|
||||||
|
@ -18,15 +19,11 @@ import eu.eudat.models.data.dataset.Service;
|
||||||
import eu.eudat.models.data.datasetprofile.DatasetProfileOverviewModel;
|
import eu.eudat.models.data.datasetprofile.DatasetProfileOverviewModel;
|
||||||
import eu.eudat.models.data.dmp.DataManagementPlan;
|
import eu.eudat.models.data.dmp.DataManagementPlan;
|
||||||
import eu.eudat.models.data.externaldataset.ExternalDatasetListingModel;
|
import eu.eudat.models.data.externaldataset.ExternalDatasetListingModel;
|
||||||
|
import eu.eudat.models.data.helpermodels.Tuple;
|
||||||
import eu.eudat.models.data.user.composite.PagedDatasetProfile;
|
import eu.eudat.models.data.user.composite.PagedDatasetProfile;
|
||||||
import net.minidev.json.JSONValue;
|
import net.minidev.json.JSONValue;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.springframework.http.HttpEntity;
|
|
||||||
import org.springframework.http.HttpHeaders;
|
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
@ -34,7 +31,6 @@ import java.time.LocalDate;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
|
|
||||||
public class DatasetWizardModel implements DataModel<Dataset, DatasetWizardModel> {
|
public class DatasetWizardModel implements DataModel<Dataset, DatasetWizardModel> {
|
||||||
|
@ -361,6 +357,11 @@ public class DatasetWizardModel implements DataModel<Dataset, DatasetWizardModel
|
||||||
if (rawTags.get(0) instanceof String) {
|
if (rawTags.get(0) instanceof String) {
|
||||||
List<Tag> parsedTags = rawTags.stream().map(rawTag -> new Tag((String) rawTag, (String) rawTag)).collect(Collectors.toList());
|
List<Tag> parsedTags = rawTags.stream().map(rawTag -> new Tag((String) rawTag, (String) rawTag)).collect(Collectors.toList());
|
||||||
value = mapper.writeValueAsString(parsedTags);
|
value = mapper.writeValueAsString(parsedTags);
|
||||||
|
List<JsonNode> nodes = JsonSearcher.findNodes(parentNode, "rdaProperty", "dataset.keyword");
|
||||||
|
for (JsonNode node: nodes) {
|
||||||
|
String id = node.get(0) != null ? node.get(0).get("id").asText() : node.get("id").asText();
|
||||||
|
properties.put(id, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setterMethod.invoke(datasetWizardModel, mapper.readValue(value, params[0]));
|
setterMethod.invoke(datasetWizardModel, mapper.readValue(value, params[0]));
|
||||||
|
@ -375,9 +376,10 @@ public class DatasetWizardModel implements DataModel<Dataset, DatasetWizardModel
|
||||||
date = date.plusYears(20);
|
date = date.plusYears(20);
|
||||||
value = date.toString();
|
value = date.toString();
|
||||||
}
|
}
|
||||||
|
StringBuilder freeTextFormat = new StringBuilder();
|
||||||
for (JsonNode node: nodes) {
|
for (JsonNode node: nodes) {
|
||||||
String id = node.get(0) != null ? node.get(0).get("id").asText() : node.get("id").asText();
|
String id = node.get(0) != null ? node.get(0).get("id").asText() : node.get("id").asText();
|
||||||
if(prefillingMapping.getMaDmpTarget().equals("dataset.distribution.format") && !value.equals("null")){
|
if(prefillingMapping.getMaDmpTarget().equals("dataset.distribution.format") && !value.equals("null")) {
|
||||||
JSONArray jsonArr = new JSONArray(value);
|
JSONArray jsonArr = new JSONArray(value);
|
||||||
List<String> formats = new ArrayList<>();
|
List<String> formats = new ArrayList<>();
|
||||||
String extension;
|
String extension;
|
||||||
|
@ -389,37 +391,45 @@ public class DatasetWizardModel implements DataModel<Dataset, DatasetWizardModel
|
||||||
formats.add(extension);
|
formats.add(extension);
|
||||||
}
|
}
|
||||||
formats = formats.stream().distinct().collect(Collectors.toList());
|
formats = formats.stream().distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
List<Object> standardFormats = new ArrayList<>();
|
List<Object> standardFormats = new ArrayList<>();
|
||||||
for(String format: formats) {
|
|
||||||
RestTemplate restTemplate = new RestTemplate();
|
String renderStyle = node.get(0) != null ? node.get(0).get("viewStyle").get("renderStyle").asText() : node.get("viewStyle").get("renderStyle").asText();
|
||||||
String parsedUrl = "https://eestore.paas2.uninett.no/api/fileformat/?search=" + format;
|
if(renderStyle.equals("combobox")){
|
||||||
HttpHeaders headers = new HttpHeaders();
|
String autocomplete = node.get(0) != null ? node.get(0).get("data").get("type").asText() : node.get("data").get("type").asText();
|
||||||
headers.setAccept(Collections.singletonList(new MediaType("application", "vnd.api+json")));
|
if(autocomplete.equals("autocomplete")) {
|
||||||
HttpEntity<String> entity = new HttpEntity("", headers);
|
JsonNode urlNode = node.get(0) != null ? node.get(0).get("data").get("autoCompleteSingleDataList") : node.get("data").get("autoCompleteSingleDataList");
|
||||||
Map<String, Object> data = restTemplate.exchange(parsedUrl, HttpMethod.GET, entity, LinkedHashMap.class).getBody();
|
String url = urlNode.get(0).get("url").asText();
|
||||||
jsonArr = new JSONArray(new ObjectMapper().writeValueAsString(data.get("data")));
|
String optionsRoot = urlNode.get(0).get("optionsRoot").asText();
|
||||||
for(int i = 0; i < jsonArr.length(); i++){
|
String label = urlNode.get(0).get("autoCompleteOptions").get("label").asText();
|
||||||
JSONObject jsonObj = jsonArr.getJSONObject(i);
|
String val = urlNode.get(0).get("autoCompleteOptions").get("value").asText();
|
||||||
jsonObj = jsonObj.getJSONObject("attributes");
|
for (String format : formats) {
|
||||||
JSONArray extensions = jsonObj.getJSONArray("extensions");
|
List<Tuple<String, String>> result = DataManagementProfileManager.externalAutocompleteRequest(url, optionsRoot, label, val, format);
|
||||||
Object formatName = jsonObj.get("name");
|
result = result.stream().distinct().collect(Collectors.toList());
|
||||||
boolean found = false;
|
if(!result.isEmpty()){
|
||||||
for(int j = 0; j < extensions.length(); j++){
|
for (Tuple<String, String> f : result) {
|
||||||
if(extensions.getString(j).equals(format)){
|
JSONObject cur = new JSONObject();
|
||||||
JSONObject cur = new JSONObject();
|
cur.put("label", f.getLabel());
|
||||||
cur.put("label", formatName.toString());
|
standardFormats.add(cur.toString());
|
||||||
standardFormats.add(cur.toString());
|
freeTextFormat.append(f.getLabel()).append(", ");
|
||||||
found = true;
|
}
|
||||||
break;
|
}
|
||||||
|
else{
|
||||||
|
freeTextFormat.append(format).append(", ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(found){
|
properties.put(id, standardFormats);
|
||||||
break;
|
}
|
||||||
|
}
|
||||||
|
else if(renderStyle.equals("freetext")){
|
||||||
|
if (freeTextFormat.length() == 0) {
|
||||||
|
for (String format : formats) {
|
||||||
|
freeTextFormat.append(format).append(", ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
freeTextFormat.setLength(freeTextFormat.length() - 2);
|
||||||
|
properties.put(id, freeTextFormat.toString());
|
||||||
}
|
}
|
||||||
properties.put(id, standardFormats);
|
|
||||||
}
|
}
|
||||||
else if(prefillingMapping.getMaDmpTarget().equals("dataset.distribution.data_access")){
|
else if(prefillingMapping.getMaDmpTarget().equals("dataset.distribution.data_access")){
|
||||||
value = value.replace("\"", "");
|
value = value.replace("\"", "");
|
||||||
|
|
|
@ -89,12 +89,12 @@ public class DistributionRDAMapper {
|
||||||
int i = 1;
|
int i = 1;
|
||||||
while(iter.hasNext()) {
|
while(iter.hasNext()) {
|
||||||
JsonNode current = iter.next();
|
JsonNode current = iter.next();
|
||||||
String format = JavaToJson.objectStringToJson(current.asText());
|
String format = JavaToJson.objectStringToJson(current.toString());
|
||||||
try {
|
try {
|
||||||
Map<String, String> result = new ObjectMapper().readValue(format, HashMap.class);
|
Map<String, String> result = new ObjectMapper().readValue(format, HashMap.class);
|
||||||
format = result.get("label");
|
format = result.get("label");
|
||||||
formats.add(format);
|
formats.add(format);
|
||||||
rda.setAdditionalProperty("format" + i++, new ObjectMapper().readTree(current.asText()));
|
rda.setAdditionalProperty("format" + i++, new ObjectMapper().readTree(current.toString()));
|
||||||
}
|
}
|
||||||
catch(JsonProcessingException e){
|
catch(JsonProcessingException e){
|
||||||
logger.warn(e.getMessage());
|
logger.warn(e.getMessage());
|
||||||
|
@ -103,7 +103,12 @@ public class DistributionRDAMapper {
|
||||||
rda.setFormat(formats);
|
rda.setFormat(formats);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
rda.setFormat(new ArrayList<>(Arrays.asList(rdaValue.replace(" ", "").split(","))));
|
if(rda.getFormat() == null || rda.getFormat().isEmpty()){
|
||||||
|
rda.setFormat(new ArrayList<>(Arrays.asList(rdaValue.replace(" ", "").split(","))));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
rda.getFormat().addAll(Arrays.asList(rdaValue.replace(" ", "").split(",")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
rda.setAdditionalProperty(ImportPropertyName.FORMAT.getName(), node.get("id").asText());
|
rda.setAdditionalProperty(ImportPropertyName.FORMAT.getName(), node.get("id").asText());
|
||||||
break;
|
break;
|
||||||
|
@ -209,19 +214,27 @@ public class DistributionRDAMapper {
|
||||||
break;
|
break;
|
||||||
case FORMAT:
|
case FORMAT:
|
||||||
if (rda.getFormat() != null && !rda.getFormat().isEmpty()) {
|
if (rda.getFormat() != null && !rda.getFormat().isEmpty()) {
|
||||||
Map<String, Object> additionalProperties = rda.getAdditionalProperties();
|
String style = distributionNode.get("viewStyle").get("renderStyle").asText();
|
||||||
List<Object> standardFormats = new ArrayList<>();
|
if(style.equals("combobox")) {
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
if (distributionNode.get("data").get("type").asText().equals("autocomplete")) {
|
||||||
rda.getAdditionalProperties().forEach((key, value) -> {
|
Map<String, Object> additionalProperties = rda.getAdditionalProperties();
|
||||||
try {
|
List<Object> standardFormats = new ArrayList<>();
|
||||||
if (key.matches("format\\d+")) {
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
standardFormats.add(additionalProperties.get(key));
|
rda.getAdditionalProperties().forEach((key, value) -> {
|
||||||
properties.put(distributionNode.get("id").asText(), mapper.writeValueAsString(standardFormats));
|
try {
|
||||||
}
|
if (key.matches("format\\d+")) {
|
||||||
} catch (JsonProcessingException e) {
|
standardFormats.add(additionalProperties.get(key));
|
||||||
logger.error(e.getMessage(), e);
|
properties.put(distributionNode.get("id").asText(), mapper.writeValueAsString(standardFormats));
|
||||||
|
}
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
logger.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
else if(style.equals("freetext")){
|
||||||
|
properties.put(distributionNode.get("id").asText(), String.join(", ", rda.getFormat()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LICENSE:
|
case LICENSE:
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
|
import {ValidatorFn, Validators} from "@angular/forms";
|
||||||
|
|
||||||
export enum ValidationType {
|
export enum ValidationType {
|
||||||
None = 0,
|
None = 0,
|
||||||
Required = 1
|
Required = 1,
|
||||||
|
URL = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ValidatorURL {
|
||||||
|
|
||||||
|
public static regex = 'https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.' +
|
||||||
|
'[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.' +
|
||||||
|
'[a-zA-Z0-9]+\.[^\s]{2,}';
|
||||||
|
|
||||||
|
public static get validator(): ValidatorFn {
|
||||||
|
return Validators.pattern(ValidatorURL.regex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,4 +21,5 @@ export interface Field {
|
||||||
data: any;
|
data: any;
|
||||||
validations: Array<ValidationType>;
|
validations: Array<ValidationType>;
|
||||||
validationRequired;
|
validationRequired;
|
||||||
}
|
validationURL;
|
||||||
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
//}
|
//}
|
||||||
|
|
||||||
.editor-wrapper {
|
.editor-wrapper {
|
||||||
|
position: relative;
|
||||||
border: 1px solid transparent !important;
|
border: 1px solid transparent !important;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
@ -40,6 +41,14 @@
|
||||||
border: 1px solid #f44336 !important;
|
border: 1px solid #f44336 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.clear {
|
||||||
|
position: absolute;
|
||||||
|
right: 5px;
|
||||||
|
bottom: 5px;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.full-width {
|
.full-width {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import {Component, Input} from "@angular/core";
|
import {Component, Input} from "@angular/core";
|
||||||
import {AngularEditorConfig} from "@kolkov/angular-editor";
|
import {AngularEditorConfig} from "@kolkov/angular-editor";
|
||||||
|
import {FormControl} from "@angular/forms";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'rich-text-editor-component',
|
selector: 'rich-text-editor-component',
|
||||||
|
@ -7,6 +8,7 @@ import {AngularEditorConfig} from "@kolkov/angular-editor";
|
||||||
<div class="editor-wrapper" [class]="wrapperClasses" [formGroup]="parentFormGroup">
|
<div class="editor-wrapper" [class]="wrapperClasses" [formGroup]="parentFormGroup">
|
||||||
<angular-editor class="full-width editor" [id]="id" [config]="editorConfig" [formControlName]="controlName"
|
<angular-editor class="full-width editor" [id]="id" [config]="editorConfig" [formControlName]="controlName"
|
||||||
placeholder="{{(placeholder? (placeholder | translate) : '') + (required ? ' *': '')}}"></angular-editor>
|
placeholder="{{(placeholder? (placeholder | translate) : '') + (required ? ' *': '')}}"></angular-editor>
|
||||||
|
<mat-icon *ngIf="formInput.value" (click)="formInput.patchValue('')" class="clear">close</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
styleUrls: ['./rich-text-editor.component.scss']
|
styleUrls: ['./rich-text-editor.component.scss']
|
||||||
|
@ -53,6 +55,7 @@ export class RichTextEditorComponent {
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor() {
|
get formInput(): FormControl {
|
||||||
|
return this.parentFormGroup.get(this.controlName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,16 @@
|
||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<ul class="list-unstyled list-inline d-flex align-items-center">
|
<ul class="list-unstyled list-inline d-flex align-items-center">
|
||||||
<li class="list-inline-item" >
|
<li class="list-inline-item">
|
||||||
<mat-slide-toggle class="field-toggler" [checked]="isRequired" (change)="toggleRequired($event)" labelPosition="before" [matTooltip]="'DATASET-PROFILE-EDITOR.ACTIONS.FIELD.MAKE-IT-REQUIRED' | translate" [disabled]="!viewType">
|
<mat-slide-toggle class="field-toggler" [checked]="isRequired" (change)="toggleRequired($event)" labelPosition="before" [matTooltip]="'DATASET-PROFILE-EDITOR.ACTIONS.FIELD.MAKE-IT-REQUIRED' | translate" [disabled]="!viewType">
|
||||||
{{'GENERAL.VALIDATION.REQUIRED' | translate}}
|
{{'GENERAL.VALIDATION.REQUIRED' | translate}}
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
</li>
|
</li>
|
||||||
|
<li *ngIf="viewType === viewTypeEnum.FreeText" class="list-inline-item">
|
||||||
|
<mat-slide-toggle class="field-toggler" [checked]="isURL" (change)="toggleURL($event)" labelPosition="before" [matTooltip]="'DATASET-PROFILE-EDITOR.ACTIONS.FIELD.MAKE-IT-REQUIRED' | translate" [disabled]="!viewType">
|
||||||
|
{{'GENERAL.VALIDATION.URL.LABEL' | translate}}
|
||||||
|
</mat-slide-toggle>
|
||||||
|
</li>
|
||||||
<!-- <li class="list-inline-item" *ngIf="!viewOnly && viewType && canApplyVisibility">
|
<!-- <li class="list-inline-item" *ngIf="!viewOnly && viewType && canApplyVisibility">
|
||||||
<mat-icon style="cursor: pointer;" (click)="addNewRule()" [matTooltip]="'DATASET-PROFILE-EDITOR.ACTIONS.FIELD.ADD-VISIBILITY-RULE' | translate">visibility</mat-icon>
|
<mat-icon style="cursor: pointer;" (click)="addNewRule()" [matTooltip]="'DATASET-PROFILE-EDITOR.ACTIONS.FIELD.ADD-VISIBILITY-RULE' | translate">visibility</mat-icon>
|
||||||
</li> -->
|
</li> -->
|
||||||
|
|
|
@ -1,21 +1,20 @@
|
||||||
|
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
||||||
import { Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
|
||||||
import {FormArray, FormControl, FormGroup, FormGroupDirective, NgForm,} from '@angular/forms';
|
import {FormArray, FormControl, FormGroup, FormGroupDirective, NgForm,} from '@angular/forms';
|
||||||
import { DatasetProfileFieldViewStyle } from '@app/core/common/enum/dataset-profile-field-view-style';
|
import {DatasetProfileFieldViewStyle} from '@app/core/common/enum/dataset-profile-field-view-style';
|
||||||
import { ValidationType } from '@app/core/common/enum/validation-type';
|
import {ValidationType} from '@app/core/common/enum/validation-type';
|
||||||
import { DatasetProfileService } from '@app/core/services/dataset-profile/dataset-profile.service';
|
import {DatasetProfileService} from '@app/core/services/dataset-profile/dataset-profile.service';
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
import {EnumUtils} from '@app/core/services/utilities/enum-utils.service';
|
||||||
import { RuleEditorModel } from '@app/ui/admin/dataset-profile/admin/rule-editor-model';
|
import {RuleEditorModel} from '@app/ui/admin/dataset-profile/admin/rule-editor-model';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import {BaseComponent} from '@common/base/base.component';
|
||||||
import { Subscription } from 'rxjs';
|
import {Subscription} from 'rxjs';
|
||||||
import { ViewStyleType } from './view-style-enum';
|
import {ViewStyleType} from './view-style-enum';
|
||||||
import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type';
|
import {DatasetProfileComboBoxType} from '@app/core/common/enum/dataset-profile-combo-box-type';
|
||||||
import { ErrorStateMatcher } from '@angular/material/core';
|
import {ErrorStateMatcher} from '@angular/material/core';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import {MatDialog} from '@angular/material/dialog';
|
||||||
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
import {MatSlideToggleChange} from '@angular/material/slide-toggle';
|
||||||
import { Field } from '@app/core/model/admin/dataset-profile/dataset-profile';
|
import {Field} from '@app/core/model/admin/dataset-profile/dataset-profile';
|
||||||
import { DatasetProfileInternalDmpEntitiesType } from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type';
|
import {DatasetProfileInternalDmpEntitiesType} from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type';
|
||||||
import { FieldEditorModel } from '../../../admin/field-editor-model';
|
import {FieldEditorModel} from '../../../admin/field-editor-model';
|
||||||
import {
|
import {
|
||||||
AutoCompleteFieldData,
|
AutoCompleteFieldData,
|
||||||
BooleanDecisionFieldData,
|
BooleanDecisionFieldData,
|
||||||
|
@ -28,17 +27,19 @@ import {
|
||||||
ExternalDatasetsFieldData,
|
ExternalDatasetsFieldData,
|
||||||
FieldDataOption,
|
FieldDataOption,
|
||||||
FreeTextFieldData,
|
FreeTextFieldData,
|
||||||
|
LicensesFieldData,
|
||||||
OrganizationsFieldData,
|
OrganizationsFieldData,
|
||||||
|
PublicationsFieldData,
|
||||||
RadioBoxFieldData,
|
RadioBoxFieldData,
|
||||||
RegistriesFieldData,
|
RegistriesFieldData,
|
||||||
ResearchersAutoCompleteFieldData,
|
ResearchersAutoCompleteFieldData,
|
||||||
|
RichTextAreaFieldData,
|
||||||
ServicesFieldData,
|
ServicesFieldData,
|
||||||
TagsFieldData,
|
TagsFieldData,
|
||||||
|
TaxonomiesFieldData,
|
||||||
TextAreaFieldData,
|
TextAreaFieldData,
|
||||||
RichTextAreaFieldData,
|
|
||||||
ValidationFieldData,
|
ValidationFieldData,
|
||||||
WordListFieldData,
|
WordListFieldData
|
||||||
TaxonomiesFieldData, LicensesFieldData, PublicationsFieldData
|
|
||||||
} from '@app/core/model/dataset-profile-definition/field-data/field-data';
|
} from '@app/core/model/dataset-profile-definition/field-data/field-data';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -185,7 +186,9 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
this.viewType = this.viewTypeEnum.Validation;
|
this.viewType = this.viewTypeEnum.Validation;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if(this.viewType !== this.viewTypeEnum.FreeText) {
|
||||||
|
this.setValidator(ValidationType.URL, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.showPreview = true;
|
// this.showPreview = true;
|
||||||
|
@ -891,20 +894,24 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
|
|
||||||
|
|
||||||
toggleRequired(event:MatSlideToggleChange){
|
toggleRequired(event:MatSlideToggleChange){
|
||||||
|
this.setValidator(ValidationType.Required, event.checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleURL(event:MatSlideToggleChange){
|
||||||
|
this.setValidator(ValidationType.URL, event.checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
private setValidator(validationType: ValidationType, add: boolean) {
|
||||||
let validationsControl = this.form.get('validations') as FormControl;
|
let validationsControl = this.form.get('validations') as FormControl;
|
||||||
let validations: Array<ValidationType> = validationsControl.value;
|
let validations: Array<ValidationType> = validationsControl.value;
|
||||||
|
|
||||||
if(event.checked){
|
if(add){
|
||||||
if(!validations.includes(ValidationType.Required)){//IS ALREADY REQUIRED
|
if(!validations.includes(validationType)){
|
||||||
// validationsControl.setValue(validations.filter(validator=> validator != ValidationType.Required));
|
validations.push(validationType);
|
||||||
// validationsControl.updateValueAndValidity();
|
|
||||||
validations.push(ValidationType.Required);
|
|
||||||
// validationsControl.setValue(validations);
|
|
||||||
validationsControl.updateValueAndValidity();
|
validationsControl.updateValueAndValidity();
|
||||||
}
|
}
|
||||||
}else{
|
} else{
|
||||||
validationsControl.setValue(validations.filter(validator=> validator != ValidationType.Required));
|
validationsControl.setValue(validations.filter(validator=> validator != validationType));
|
||||||
validationsControl.updateValueAndValidity();
|
validationsControl.updateValueAndValidity();
|
||||||
}
|
}
|
||||||
this.form.markAsDirty();//deactivate guard
|
this.form.markAsDirty();//deactivate guard
|
||||||
|
@ -916,6 +923,12 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
|
||||||
return validations.includes(ValidationType.Required);
|
return validations.includes(ValidationType.Required);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isURL(){
|
||||||
|
let validationsControl = this.form.get('validations') as FormControl;
|
||||||
|
let validations: Array<ValidationType> = validationsControl.value;
|
||||||
|
return validations.includes(ValidationType.URL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
onDelete(){
|
onDelete(){
|
||||||
this.delete.emit();
|
this.delete.emit();
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
<span class="material-icons">chevron_right</span>
|
<span class="material-icons">chevron_right</span>
|
||||||
<div>{{'DMP-EDITOR.STEPPER.NEXT' | translate}}</div>
|
<div>{{'DMP-EDITOR.STEPPER.NEXT' | translate}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="(this.step === this.maxStep) && !lockStatus && formGroup.get('profile').value && !viewOnly" mat-raised-button type="button" class="col-auto stepper-btn add-dataset-btn ml-auto">
|
<div *ngIf="(step === maxStep) && !lockStatus && formGroup.get('profile').value && !viewOnly" mat-raised-button type="button" class="col-auto stepper-btn add-dataset-btn ml-auto">
|
||||||
<div (click)="save(saveAnd.addNew)">{{ 'DATASET-WIZARD.ACTIONS.SAVE-AND-ADD' | translate }}</div>
|
<div (click)="save(saveAnd.addNew)">{{ 'DATASET-WIZARD.ACTIONS.SAVE-AND-ADD' | translate }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -107,7 +107,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <mat-slide-toggle [(ngModel)]="showtocentriesErrors">
|
<!-- <mat-slide-toggle [(ngModel)]="showtocentriesErrors">
|
||||||
|
|
||||||
</mat-slide-toggle> -->
|
</mat-slide-toggle> -->
|
||||||
|
|
||||||
<!-- <div class="row">
|
<!-- <div class="row">
|
||||||
|
|
|
@ -259,6 +259,9 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
|
||||||
this.formGroup = this.datasetWizardModel.buildForm();
|
this.formGroup = this.datasetWizardModel.buildForm();
|
||||||
this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
|
this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
|
||||||
this.formGroup.get('dmp').disable();
|
this.formGroup.get('dmp').disable();
|
||||||
|
this.maxStep = 1;
|
||||||
|
this.loadDatasetProfiles();
|
||||||
|
this.registerFormListeners();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.loadDatasetProfiles();
|
this.loadDatasetProfiles();
|
||||||
|
|
|
@ -574,19 +574,8 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements
|
||||||
}
|
}
|
||||||
|
|
||||||
onCallbackSuccessAddNew(dmp?: DmpModel) {
|
onCallbackSuccessAddNew(dmp?: DmpModel) {
|
||||||
// this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
|
// this.editDataset(dmp.id, true, this.isNew && !this.formGroup.get('datasets').value.length);
|
||||||
// this.router.navigate(['/datasets', 'new', dmp.id]);
|
this.editDataset(dmp.id, true, false);
|
||||||
// const showDialog = this.isNew && (this.formGroup.get('datasets') );
|
|
||||||
|
|
||||||
let showDialog = false;
|
|
||||||
|
|
||||||
try{
|
|
||||||
showDialog = this.isNew && !this.formGroup.get('datasets').value.length;
|
|
||||||
}catch{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
this.editDataset(dmp.id, true, showDialog);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public setErrorModel(validationErrorModel: ValidationErrorModel) {
|
public setErrorModel(validationErrorModel: ValidationErrorModel) {
|
||||||
|
|
|
@ -11,7 +11,8 @@
|
||||||
</h5>
|
</h5>
|
||||||
<mat-form-field *ngSwitchCase="datasetProfileFieldViewStyleEnum.FreeText" class="col-12">
|
<mat-form-field *ngSwitchCase="datasetProfileFieldViewStyleEnum.FreeText" class="col-12">
|
||||||
<input matInput [formControl]="form.get('value')" placeholder="{{(form.get('data').value.label) + (form.get('validationRequired').value? ' *': '')}}" [required]="form.get('validationRequired').value">
|
<input matInput [formControl]="form.get('value')" placeholder="{{(form.get('data').value.label) + (form.get('validationRequired').value? ' *': '')}}" [required]="form.get('validationRequired').value">
|
||||||
<mat-error *ngIf="form.get('value')['errors'] && form.get('value')['errors']['required']">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
|
<mat-error *ngIf="form.get('value').hasError('pattern')">{{'GENERAL.VALIDATION.URL.MESSAGE' | translate}}</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.ComboBox" class="col-12">
|
<div *ngSwitchCase="datasetProfileFieldViewStyleEnum.ComboBox" class="col-12">
|
||||||
|
@ -105,7 +106,7 @@
|
||||||
<button mat-icon-button type="button" *ngIf="!form.get('value').disabled && form.get('value').value" matSuffix aria-label="Clear" (click)="this.form.patchValue({'value': ''})">
|
<button mat-icon-button type="button" *ngIf="!form.get('value').disabled && form.get('value').value" matSuffix aria-label="Clear" (click)="this.form.patchValue({'value': ''})">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>close</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<mat-error *ngIf="form.get('value')['errors'] && form.get('value')['errors']['required']">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="form.get('value')['errors'] && form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<ng-container *ngSwitchCase="datasetProfileFieldViewStyleEnum.RichTextArea">
|
<ng-container *ngSwitchCase="datasetProfileFieldViewStyleEnum.RichTextArea">
|
||||||
<rich-text-editor-component class="col-12"
|
<rich-text-editor-component class="col-12"
|
||||||
|
@ -115,8 +116,8 @@
|
||||||
[wrapperClasses]="'full-width editor ' +
|
[wrapperClasses]="'full-width editor ' +
|
||||||
((form.get('validationRequired').value) ? 'required' : '')">
|
((form.get('validationRequired').value) ? 'required' : '')">
|
||||||
</rich-text-editor-component>
|
</rich-text-editor-component>
|
||||||
<div [class]="(form.get('value')['errors'] && form.get('value')['errors']['required']) ? 'visible' : 'invisible'" class="mat-form-field form-field-subscript-wrapper">
|
<div [class]="(form.get('value')['errors'] && form.get('value').hasError('required')) ? 'visible' : 'invisible'" class="mat-form-field form-field-subscript-wrapper">
|
||||||
<mat-error *ngIf="form.get('value')['errors'] && form.get('value')['errors']['required']">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="form.get('value')['errors'] && form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|
|
@ -91,10 +91,8 @@ export class FormProgressIndicationComponent extends BaseComponent implements On
|
||||||
}
|
}
|
||||||
|
|
||||||
private checkIfIsRequired(formControl: FormGroup): boolean {
|
private checkIfIsRequired(formControl: FormGroup): boolean {
|
||||||
if (formControl.get('validationRequired') && formControl.get('validationRequired').value) {
|
return !!(formControl.get('validationRequired') && formControl.get('validationRequired').value);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private checkFormsIfIsFieldsAndVisible(formControl: FormGroup): boolean {
|
private checkFormsIfIsFieldsAndVisible(formControl: FormGroup): boolean {
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
|
import {FormBuilder, FormControl, FormGroup, ValidatorFn, Validators} from "@angular/forms";
|
||||||
import { Guid } from '@common/types/guid';
|
import {Guid} from '@common/types/guid';
|
||||||
import { ValidationType } from "../../../core/common/enum/validation-type";
|
import {ValidationType, ValidatorURL} from "../../../core/common/enum/validation-type";
|
||||||
import { BaseFormModel } from "../../../core/model/base-form-model";
|
import {BaseFormModel} from "../../../core/model/base-form-model";
|
||||||
import { CompositeField } from "../../../core/model/dataset-profile-definition/composite-field";
|
import {CompositeField} from "../../../core/model/dataset-profile-definition/composite-field";
|
||||||
import { DatasetProfileDefinitionModel } from "../../../core/model/dataset-profile-definition/dataset-profile-definition";
|
import {DatasetProfileDefinitionModel} from "../../../core/model/dataset-profile-definition/dataset-profile-definition";
|
||||||
import { DefaultValue } from "../../../core/model/dataset-profile-definition/default-value";
|
import {DefaultValue} from "../../../core/model/dataset-profile-definition/default-value";
|
||||||
import { Field } from "../../../core/model/dataset-profile-definition/field";
|
import {Field} from "../../../core/model/dataset-profile-definition/field";
|
||||||
import { Multiplicity } from "../../../core/model/dataset-profile-definition/multiplicity";
|
import {Multiplicity} from "../../../core/model/dataset-profile-definition/multiplicity";
|
||||||
import { Page } from "../../../core/model/dataset-profile-definition/page";
|
import {Page} from "../../../core/model/dataset-profile-definition/page";
|
||||||
import { Rule } from "../../../core/model/dataset-profile-definition/rule";
|
import {Rule} from "../../../core/model/dataset-profile-definition/rule";
|
||||||
import { Section } from "../../../core/model/dataset-profile-definition/section";
|
import {Section} from "../../../core/model/dataset-profile-definition/section";
|
||||||
import { ViewStyle } from "../../../core/model/dataset-profile-definition/view-style";
|
import {ViewStyle} from "../../../core/model/dataset-profile-definition/view-style";
|
||||||
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
|
import {BackendErrorValidator} from '@common/forms/validation/custom-validator';
|
||||||
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
import {ValidationErrorModel} from '@common/forms/validation/error-model/validation-error-model';
|
||||||
|
|
||||||
export class DatasetDescriptionFormEditorModel extends BaseFormModel {
|
export class DatasetDescriptionFormEditorModel extends BaseFormModel {
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ export class DatasetDescriptionSectionEditorModel extends BaseFormModel {
|
||||||
formGroup.addControl('description', new FormControl({ value: this.description, disabled: true }));
|
formGroup.addControl('description', new FormControl({ value: this.description, disabled: true }));
|
||||||
formGroup.addControl('numbering', new FormControl({ value: this.numbering, disabled: true }));
|
formGroup.addControl('numbering', new FormControl({ value: this.numbering, disabled: true }));
|
||||||
formGroup.addControl('title', new FormControl({ value: this.title, disabled: true }));
|
formGroup.addControl('title', new FormControl({ value: this.title, disabled: true }));
|
||||||
formGroup.addControl('id', new FormControl({ value: this.title, disabled: false }));
|
formGroup.addControl('id', new FormControl({ value: this.id, disabled: false }));
|
||||||
formGroup.addControl('ordinal', new FormControl({ value: this.ordinal, disabled: true }));
|
formGroup.addControl('ordinal', new FormControl({ value: this.ordinal, disabled: true }));
|
||||||
return formGroup;
|
return formGroup;
|
||||||
}
|
}
|
||||||
|
@ -229,6 +229,7 @@ export class DatasetDescriptionFieldEditorModel extends BaseFormModel {
|
||||||
public data: any;
|
public data: any;
|
||||||
public validations: Array<ValidationType>;
|
public validations: Array<ValidationType>;
|
||||||
public validationRequired = false;
|
public validationRequired = false;
|
||||||
|
public validationURL = false;
|
||||||
|
|
||||||
fromModel(item: Field): DatasetDescriptionFieldEditorModel {
|
fromModel(item: Field): DatasetDescriptionFieldEditorModel {
|
||||||
this.id = item.id;
|
this.id = item.id;
|
||||||
|
@ -253,16 +254,27 @@ export class DatasetDescriptionFieldEditorModel extends BaseFormModel {
|
||||||
buildForm(): FormGroup {
|
buildForm(): FormGroup {
|
||||||
if (this.validations) {
|
if (this.validations) {
|
||||||
this.validations.forEach(validation => {
|
this.validations.forEach(validation => {
|
||||||
if (validation === ValidationType.Required) { this.validationRequired = true; }
|
if (validation === ValidationType.Required) {
|
||||||
|
this.validationRequired = true;
|
||||||
|
} else if(validation === ValidationType.URL) {
|
||||||
|
this.validationURL = true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
let validators: any[] = [];
|
||||||
|
if(this.validationRequired) {
|
||||||
|
validators.push(Validators.required)
|
||||||
|
}
|
||||||
|
if(this.validationURL) {
|
||||||
|
validators.push(ValidatorURL.validator);
|
||||||
|
}
|
||||||
const formGroup = this.formBuilder.group({
|
const formGroup = this.formBuilder.group({
|
||||||
value: [this.value, this.validationRequired === true ? Validators.required : null],
|
value: [this.value, validators],
|
||||||
id: [{ value: this.id, disabled: false }],
|
id: [{ value: this.id, disabled: false }],
|
||||||
viewStyle: [{ value: this.viewStyle, disabled: true }],
|
viewStyle: [{ value: this.viewStyle, disabled: true }],
|
||||||
data: [{ value: this.data, disabled: true }],
|
data: [{ value: this.data, disabled: true }],
|
||||||
validationRequired: [{ value: this.validationRequired, disabled: true }],
|
validationRequired: [{ value: this.validationRequired, disabled: true }],
|
||||||
|
validationURL: [{ value: this.validationURL, disabled: true }],
|
||||||
description: [{ value: this.description, disabled: true }],
|
description: [{ value: this.description, disabled: true }],
|
||||||
extendedDescription: [{ value: this.extendedDescription, disabled: true }],
|
extendedDescription: [{ value: this.extendedDescription, disabled: true }],
|
||||||
additionalInformation: [{ value: this.additionalInformation, disabled: true }],
|
additionalInformation: [{ value: this.additionalInformation, disabled: true }],
|
||||||
|
|
|
@ -3,7 +3,11 @@
|
||||||
"VALIDATION": {
|
"VALIDATION": {
|
||||||
"REQUIRED": "Pflichtfeld",
|
"REQUIRED": "Pflichtfeld",
|
||||||
"GRANT-START-AFTER-END": "Anfangsdatum der Förderung kann nicht nach dem Laufzeitende liegen",
|
"GRANT-START-AFTER-END": "Anfangsdatum der Förderung kann nicht nach dem Laufzeitende liegen",
|
||||||
"PATTERN-_": "Schriftzeichen \"_\" ist nicht erlaubt"
|
"PATTERN-_": "Schriftzeichen \"_\" ist nicht erlaubt",
|
||||||
|
"URL": {
|
||||||
|
"LABEL": "URL",
|
||||||
|
"MESSAGE": "Please provide a valid URL"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"DELETE-CONFIRMATION": {
|
"DELETE-CONFIRMATION": {
|
||||||
"TITLE": "Warnung",
|
"TITLE": "Warnung",
|
||||||
|
@ -731,7 +735,7 @@
|
||||||
"DATASET-NOT-FOUND": "Datensatzbeschreibung ist nicht vorhanden",
|
"DATASET-NOT-FOUND": "Datensatzbeschreibung ist nicht vorhanden",
|
||||||
"DATASET-NOT-ALLOWED": "Sie haben keinen Zugriff auf diese Datensatzbeschreibung",
|
"DATASET-NOT-ALLOWED": "Sie haben keinen Zugriff auf diese Datensatzbeschreibung",
|
||||||
"SUCCESS-UPDATE-DATASET-PROFILE": "Vorlage der Datensatzbeschreibung erfolgreich aktualisiert",
|
"SUCCESS-UPDATE-DATASET-PROFILE": "Vorlage der Datensatzbeschreibung erfolgreich aktualisiert",
|
||||||
"MISSING-FIELDS": "There are some required fields left unfilled. Please check the form and make sure that all required fields are filled. (Missing fields are marked in red color)"
|
"MISSING-FIELDS": "There are some required fields left unfilled. Please check the DMP and make sure that all required questions are answered and URLs are provided with valid input. (Missing fields are marked in red color)"
|
||||||
},
|
},
|
||||||
"UPLOAD": {
|
"UPLOAD": {
|
||||||
"UPLOAD-XML": "Importieren",
|
"UPLOAD-XML": "Importieren",
|
||||||
|
|
|
@ -3,7 +3,11 @@
|
||||||
"VALIDATION": {
|
"VALIDATION": {
|
||||||
"REQUIRED": "Required",
|
"REQUIRED": "Required",
|
||||||
"GRANT-START-AFTER-END": "Grant start date cannot be after the end date",
|
"GRANT-START-AFTER-END": "Grant start date cannot be after the end date",
|
||||||
"PATTERN-_": "Character \"_\" is not allowed"
|
"PATTERN-_": "Character \"_\" is not allowed",
|
||||||
|
"URL": {
|
||||||
|
"LABEL": "URL",
|
||||||
|
"MESSAGE": "Please provide a valid URL"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"DELETE-CONFIRMATION": {
|
"DELETE-CONFIRMATION": {
|
||||||
"TITLE": "Warning",
|
"TITLE": "Warning",
|
||||||
|
@ -731,7 +735,7 @@
|
||||||
"DATASET-NOT-FOUND": "Dataset does not exist",
|
"DATASET-NOT-FOUND": "Dataset does not exist",
|
||||||
"DATASET-NOT-ALLOWED": "You have no access to this Dataset",
|
"DATASET-NOT-ALLOWED": "You have no access to this Dataset",
|
||||||
"SUCCESS-UPDATE-DATASET-PROFILE": "Dataset Template updated successfully",
|
"SUCCESS-UPDATE-DATASET-PROFILE": "Dataset Template updated successfully",
|
||||||
"MISSING-FIELDS": "There are some required fields left unfilled. Please check the form and make sure that all required fields are filled. (Missing fields are marked in red color)"
|
"MISSING-FIELDS": "There are some required fields left unfilled. Please check the DMP and make sure that all required questions are answered and URLs are provided with valid input. (Missing fields are marked in red color)"
|
||||||
},
|
},
|
||||||
"UPLOAD": {
|
"UPLOAD": {
|
||||||
"UPLOAD-XML": "Import",
|
"UPLOAD-XML": "Import",
|
||||||
|
|
|
@ -3,7 +3,11 @@
|
||||||
"VALIDATION": {
|
"VALIDATION": {
|
||||||
"REQUIRED": "Obligatorio",
|
"REQUIRED": "Obligatorio",
|
||||||
"GRANT-START-AFTER-END": "La fecha de incio de la subvención no puede ser posterior a la fecha de fin",
|
"GRANT-START-AFTER-END": "La fecha de incio de la subvención no puede ser posterior a la fecha de fin",
|
||||||
"PATTERN-_": "Carácter \"_\" no permitido"
|
"PATTERN-_": "Carácter \"_\" no permitido",
|
||||||
|
"URL": {
|
||||||
|
"LABEL": "URL",
|
||||||
|
"MESSAGE": "Please provide a valid URL"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"DELETE-CONFIRMATION": {
|
"DELETE-CONFIRMATION": {
|
||||||
"TITLE": "Aviso",
|
"TITLE": "Aviso",
|
||||||
|
@ -731,8 +735,7 @@
|
||||||
"DATASET-NOT-FOUND": "No existe la descripción del dataset",
|
"DATASET-NOT-FOUND": "No existe la descripción del dataset",
|
||||||
"DATASET-NOT-ALLOWED": "No tiene acceso a la descricipción de este dataset",
|
"DATASET-NOT-ALLOWED": "No tiene acceso a la descricipción de este dataset",
|
||||||
"SUCCESS-UPDATE-DATASET-PROFILE": "Plantilla de descripción del dataset actualizada correctamente",
|
"SUCCESS-UPDATE-DATASET-PROFILE": "Plantilla de descripción del dataset actualizada correctamente",
|
||||||
"MISSING-FIELDS": "Hay campos requeridos sin rellenar. Por favor, compruebe el formulario y rellene los campos obligatorios (Los campos sin rellenar se marcan en color rojo)"
|
"MISSING-FIELDS": "There are some required fields left unfilled. Please check the DMP and make sure that all required questions are answered and URLs are provided with valid input. (Missing fields are marked in red color)" },
|
||||||
},
|
|
||||||
"UPLOAD": {
|
"UPLOAD": {
|
||||||
"UPLOAD-XML": "Importar",
|
"UPLOAD-XML": "Importar",
|
||||||
"UPLOAD-XML-FILE-TITLE": "Importar la plantilla de descripción del dataset",
|
"UPLOAD-XML-FILE-TITLE": "Importar la plantilla de descripción del dataset",
|
||||||
|
|
|
@ -3,7 +3,11 @@
|
||||||
"VALIDATION": {
|
"VALIDATION": {
|
||||||
"REQUIRED": "Προαπαιτούμενο",
|
"REQUIRED": "Προαπαιτούμενο",
|
||||||
"GRANT-START-AFTER-END": "Η ημερομηνία έναρξης της επιχορήγησης δεν μπορεί να είναι μεταγενέστερη της ημερομηνίας λήξης",
|
"GRANT-START-AFTER-END": "Η ημερομηνία έναρξης της επιχορήγησης δεν μπορεί να είναι μεταγενέστερη της ημερομηνίας λήξης",
|
||||||
"PATTERN-_": "Ο χαρακτήρας \"_\" δεν υποστηρίζεται"
|
"PATTERN-_": "Ο χαρακτήρας \"_\" δεν υποστηρίζεται",
|
||||||
|
"URL": {
|
||||||
|
"LABEL": "URL",
|
||||||
|
"MESSAGE": "Παρακαλώ εισάγεται ένα έγκυρο URL"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"DELETE-CONFIRMATION": {
|
"DELETE-CONFIRMATION": {
|
||||||
"TITLE": "Προσοχή",
|
"TITLE": "Προσοχή",
|
||||||
|
@ -731,7 +735,7 @@
|
||||||
"DATASET-NOT-FOUND": "Η Περιγραφή Συνόλου Δεδομένων δεν υπάρχει",
|
"DATASET-NOT-FOUND": "Η Περιγραφή Συνόλου Δεδομένων δεν υπάρχει",
|
||||||
"DATASET-NOT-ALLOWED": "Δεν έχετε πρόσβαση σε αυτή την Περιγραφή Συνόλου Δεδομένων",
|
"DATASET-NOT-ALLOWED": "Δεν έχετε πρόσβαση σε αυτή την Περιγραφή Συνόλου Δεδομένων",
|
||||||
"SUCCESS-UPDATE-DATASET-PROFILE": "Επιτυχία ενημέρωσης της Περιγραφής Συνόλου Δεδομένων",
|
"SUCCESS-UPDATE-DATASET-PROFILE": "Επιτυχία ενημέρωσης της Περιγραφής Συνόλου Δεδομένων",
|
||||||
"MISSING-FIELDS": "Υπάρχουν ορισμένα υποχρεωτικά πεδία που δεν έχουν συμπληρωθεί. Ελέγξτε τη φόρμα και βεβαιωθείτε ότι έχουν συμπληρωθεί όλα τα απαιτούμενα πεδία. (Τα πεδία που λείπουν επισημαίνονται με κόκκινο χρώμα)"
|
"MISSING-FIELDS": "Υπάρχουν ορισμένα υποχρεωτικά πεδία που δεν έχουν συμπληρωθεί. Ελέγξτε το DMP και βεβαιωθείτε ότι έχουν συμπληρωθεί όλα τα απαιτούμενα πεδία και τα URL είναι έγκυρα. (Τα πεδία που λείπουν επισημαίνονται με κόκκινο χρώμα)"
|
||||||
},
|
},
|
||||||
"UPLOAD": {
|
"UPLOAD": {
|
||||||
"UPLOAD-XML": "Εισαγωγή",
|
"UPLOAD-XML": "Εισαγωγή",
|
||||||
|
|
|
@ -3,7 +3,11 @@
|
||||||
"VALIDATION": {
|
"VALIDATION": {
|
||||||
"REQUIRED": "Obrigatório",
|
"REQUIRED": "Obrigatório",
|
||||||
"GRANT-START-AFTER-END": "A data de início do financiamento não pode ser posterior à data de término",
|
"GRANT-START-AFTER-END": "A data de início do financiamento não pode ser posterior à data de término",
|
||||||
"PATTERN-_": "O caracter \"_\" não é permitido"
|
"PATTERN-_": "O caracter \"_\" não é permitido",
|
||||||
|
"URL": {
|
||||||
|
"LABEL": "URL",
|
||||||
|
"MESSAGE": "Please provide a valid URL"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"DELETE-CONFIRMATION": {
|
"DELETE-CONFIRMATION": {
|
||||||
"TITLE": "Atenção",
|
"TITLE": "Atenção",
|
||||||
|
@ -731,8 +735,7 @@
|
||||||
"DATASET-NOT-FOUND": "O Dataset não existe",
|
"DATASET-NOT-FOUND": "O Dataset não existe",
|
||||||
"DATASET-NOT-ALLOWED": "Não tem acesso a este Dataset",
|
"DATASET-NOT-ALLOWED": "Não tem acesso a este Dataset",
|
||||||
"SUCCESS-UPDATE-DATASET-PROFILE": "O Dataset foi atualizado com sucesso",
|
"SUCCESS-UPDATE-DATASET-PROFILE": "O Dataset foi atualizado com sucesso",
|
||||||
"MISSING-FIELDS": "Alguns campos obrigatórios não foram preenchidos. Por favor, verifique o formulário e certifique-se de que todos os campos obrigatórios foram preenchidos. (Os campos ausentes são marcados em vermelho)"
|
"MISSING-FIELDS": "There are some required fields left unfilled. Please check the DMP and make sure that all required questions are answered and URLs are provided with valid input. (Missing fields are marked in red color)" },
|
||||||
},
|
|
||||||
"UPLOAD": {
|
"UPLOAD": {
|
||||||
"UPLOAD-XML": "Importar",
|
"UPLOAD-XML": "Importar",
|
||||||
"UPLOAD-XML-FILE-TITLE": "Importar o Dataset",
|
"UPLOAD-XML-FILE-TITLE": "Importar o Dataset",
|
||||||
|
|
|
@ -3,7 +3,11 @@
|
||||||
"VALIDATION": {
|
"VALIDATION": {
|
||||||
"REQUIRED": "Povinné",
|
"REQUIRED": "Povinné",
|
||||||
"GRANT-START-AFTER-END": "Dátum začatia poskytovania grantu nesmie byť po dátume ukončenia",
|
"GRANT-START-AFTER-END": "Dátum začatia poskytovania grantu nesmie byť po dátume ukončenia",
|
||||||
"PATTERN-_": "Znak \"_\" nie je povolený"
|
"PATTERN-_": "Znak \"_\" nie je povolený",
|
||||||
|
"URL": {
|
||||||
|
"LABEL": "URL",
|
||||||
|
"MESSAGE": "Please provide a valid URL"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"DELETE-CONFIRMATION": {
|
"DELETE-CONFIRMATION": {
|
||||||
"TITLE": "Upozornenie",
|
"TITLE": "Upozornenie",
|
||||||
|
@ -731,7 +735,7 @@
|
||||||
"DATASET-NOT-FOUND": "Súbor dát neexistuje",
|
"DATASET-NOT-FOUND": "Súbor dát neexistuje",
|
||||||
"DATASET-NOT-ALLOWED": "K tomuto súboru dát nemáte prístup",
|
"DATASET-NOT-ALLOWED": "K tomuto súboru dát nemáte prístup",
|
||||||
"SUCCESS-UPDATE-DATASET-PROFILE": "Šablóna súboru dát bola úspešne aktualizovaná",
|
"SUCCESS-UPDATE-DATASET-PROFILE": "Šablóna súboru dát bola úspešne aktualizovaná",
|
||||||
"MISSING-FIELDS": "There are some required fields left unfilled. Please check the form and make sure that all required fields are filled. (Missing fields are marked in red color)"
|
"MISSING-FIELDS": "There are some required fields left unfilled. Please check the DMP and make sure that all required questions are answered and URLs are provided with valid input. (Missing fields are marked in red color.)"
|
||||||
},
|
},
|
||||||
"UPLOAD": {
|
"UPLOAD": {
|
||||||
"UPLOAD-XML": "Importovať",
|
"UPLOAD-XML": "Importovať",
|
||||||
|
|
|
@ -3,7 +3,11 @@
|
||||||
"VALIDATION": {
|
"VALIDATION": {
|
||||||
"REQUIRED": "Obavezno",
|
"REQUIRED": "Obavezno",
|
||||||
"GRANT-START-AFTER-END": "Datum početka ne može biti kasniji od datuma završetka granta.",
|
"GRANT-START-AFTER-END": "Datum početka ne može biti kasniji od datuma završetka granta.",
|
||||||
"PATTERN-_": "Karakter \"_\" nije dozvoljen"
|
"PATTERN-_": "Karakter \"_\" nije dozvoljen",
|
||||||
|
"URL": {
|
||||||
|
"LABEL": "URL",
|
||||||
|
"MESSAGE": "Please provide a valid URL"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"DELETE-CONFIRMATION": {
|
"DELETE-CONFIRMATION": {
|
||||||
"TITLE": "Oprez",
|
"TITLE": "Oprez",
|
||||||
|
@ -731,7 +735,7 @@
|
||||||
"DATASET-NOT-FOUND": "Skup podataka ne postoji",
|
"DATASET-NOT-FOUND": "Skup podataka ne postoji",
|
||||||
"DATASET-NOT-ALLOWED": "Nemate pristup ovom skupu podataka",
|
"DATASET-NOT-ALLOWED": "Nemate pristup ovom skupu podataka",
|
||||||
"SUCCESS-UPDATE-DATASET-PROFILE": "Obrazac skupa podataka je ažuriran uspešno",
|
"SUCCESS-UPDATE-DATASET-PROFILE": "Obrazac skupa podataka je ažuriran uspešno",
|
||||||
"MISSING-FIELDS": "There are some required fields left unfilled. Please check the form and make sure that all required fields are filled. (Missing fields are marked in red color)"
|
"MISSING-FIELDS": "There are some required fields left unfilled. Please check the DMP and make sure that all required questions are answered and URLs are provided with valid input. (Missing fields are marked in red color.)"
|
||||||
},
|
},
|
||||||
"UPLOAD": {
|
"UPLOAD": {
|
||||||
"UPLOAD-XML": "Uvezite",
|
"UPLOAD-XML": "Uvezite",
|
||||||
|
|
|
@ -3,7 +3,11 @@
|
||||||
"VALIDATION": {
|
"VALIDATION": {
|
||||||
"REQUIRED": "Gerekli",
|
"REQUIRED": "Gerekli",
|
||||||
"GRANT-START-AFTER-END": "Hibe başlangıç tarihi bitiş tarihinden sonra olamaz",
|
"GRANT-START-AFTER-END": "Hibe başlangıç tarihi bitiş tarihinden sonra olamaz",
|
||||||
"PATTERN-_": "\"_\" Karakterine izin verilmiyor"
|
"PATTERN-_": "\"_\" Karakterine izin verilmiyor",
|
||||||
|
"URL": {
|
||||||
|
"LABEL": "URL",
|
||||||
|
"MESSAGE": "Please provide a valid URL"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"DELETE-CONFIRMATION": {
|
"DELETE-CONFIRMATION": {
|
||||||
"TITLE": "Uyarı",
|
"TITLE": "Uyarı",
|
||||||
|
@ -731,7 +735,7 @@
|
||||||
"DATASET-NOT-FOUND": "Veri Seti mevcut değildir",
|
"DATASET-NOT-FOUND": "Veri Seti mevcut değildir",
|
||||||
"DATASET-NOT-ALLOWED": "Bu Veri Setine erişiminiz yok",
|
"DATASET-NOT-ALLOWED": "Bu Veri Setine erişiminiz yok",
|
||||||
"SUCCESS-UPDATE-DATASET-PROFILE": "Veri Seti Tanımı başarılı olarak güncellendi",
|
"SUCCESS-UPDATE-DATASET-PROFILE": "Veri Seti Tanımı başarılı olarak güncellendi",
|
||||||
"MISSING-FIELDS": "There are some required fields left unfilled. Please check the form and make sure that all required fields are filled. (Missing fields are marked in red color)"
|
"MISSING-FIELDS": "There are some required fields left unfilled. Please check the DMP and make sure that all required questions are answered and URLs are provided with valid input. (Missing fields are marked in red color.)"
|
||||||
},
|
},
|
||||||
"UPLOAD": {
|
"UPLOAD": {
|
||||||
"UPLOAD-XML": "İçeri Aktar",
|
"UPLOAD-XML": "İçeri Aktar",
|
||||||
|
|
Loading…
Reference in New Issue