remove rda property from models

This commit is contained in:
Bernaldo Mihasi 2023-03-27 14:52:37 +03:00
parent e2505039df
commit c35bc2efed
16 changed files with 6 additions and 90 deletions

View File

@ -190,10 +190,6 @@ public class Admin extends BaseController {
.status(ApiMessageCode.SUCCESS_MESSAGE).message("")); .status(ApiMessageCode.SUCCESS_MESSAGE).message(""));
} }
@RequestMapping(method = RequestMethod.GET, value = {"/getRDACommonStandards"}, produces = "application/json")
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") @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) { public ResponseEntity<ResponseItem<List<String>>> getSchematics(@RequestParam(value = "query", required = false) String query, @ClaimedAuthorities(claims = {ADMIN, DATASET_PROFILE_MANAGER}) Principal principal) {

View File

@ -10,7 +10,6 @@ import java.util.Map;
public interface ConfigLoader { public interface ConfigLoader {
ExternalUrls getExternalUrls(); ExternalUrls getExternalUrls();
List<String> getRdaProperties();
List<Schematic> getSchematics(); List<Schematic> getSchematics();
XWPFDocument getDocument(); XWPFDocument getDocument();
XWPFDocument getDatasetDocument(); XWPFDocument getDatasetDocument();

View File

@ -164,11 +164,6 @@ 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.getSchematics() != null) { if (field.getSchematics() != null) {
Element schematics = element.createElement("schematics"); Element schematics = element.createElement("schematics");
field.getSchematics().forEach(schematic -> { field.getSchematics().forEach(schematic -> {

View File

@ -29,8 +29,6 @@ public class Field {
private Object data; private Object data;
private String rdaProperty;
private Schematics schematics; private Schematics schematics;
@XmlAttribute(name = "id") @XmlAttribute(name = "id")
@ -105,15 +103,6 @@ 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;
}
@XmlElement(name = "schematics") @XmlElement(name = "schematics")
public Schematics getSchematics() { public Schematics getSchematics() {
return schematics; return schematics;
@ -141,7 +130,6 @@ 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);
List<String> schematicsList = new LinkedList<>(); List<String> schematicsList = new LinkedList<>();
if (this.schematics != null && this.schematics.getSchematics() != null) { if (this.schematics != null && this.schematics.getSchematics() != null) {
for (Schematic schematic : this.schematics.getSchematics()) { for (Schematic schematic : this.schematics.getSchematics()) {

View File

@ -45,7 +45,6 @@ public class Field implements ViewStyleDefinition<eu.eudat.models.data.entities.
private String id; private String id;
private Integer ordinal; private Integer ordinal;
private String rdaCommonStandard;
private List<String> schematics; private List<String> schematics;
private String value; private String value;
private ViewStyle viewStyle; private ViewStyle viewStyle;
@ -71,12 +70,6 @@ public class Field implements ViewStyleDefinition<eu.eudat.models.data.entities.
this.ordinal = ordinal; this.ordinal = ordinal;
} }
public String getRdaCommonStandard() {
return rdaCommonStandard;
}
public void setRdaCommonStandard(String rdaCommonStandard) {
this.rdaCommonStandard = rdaCommonStandard;
}
public List<String> getSchematics() { public List<String> getSchematics() {
return schematics; return schematics;
@ -160,7 +153,6 @@ public class Field implements ViewStyleDefinition<eu.eudat.models.data.entities.
field.setVisible(this.visible); field.setVisible(this.visible);
field.setDefaultValue(this.defaultValue); field.setDefaultValue(this.defaultValue);
field.setValidations(this.validations); field.setValidations(this.validations);
field.setRdaCommonStandard(this.rdaCommonStandard);
field.setSchematics(this.schematics); field.setSchematics(this.schematics);
field.setExport(this.export); field.setExport(this.export);
return field; return field;
@ -175,7 +167,6 @@ public class Field implements ViewStyleDefinition<eu.eudat.models.data.entities.
this.visible = item.getVisible(); this.visible = item.getVisible();
this.defaultValue = item.getDefaultValue(); this.defaultValue = item.getDefaultValue();
this.validations = item.getValidations(); this.validations = item.getValidations();
this.rdaCommonStandard = item.getRdaCommonStandard();
this.schematics = item.getSchematics(); this.schematics = item.getSchematics();
this.export = item.getExport(); this.export = item.getExport();
} }

View File

@ -18,7 +18,6 @@ import java.util.List;
public class Field implements DatabaseViewStyleDefinition, XmlSerializable<Field> { public class Field implements DatabaseViewStyleDefinition, XmlSerializable<Field> {
private String id; private String id;
private int ordinal; private int ordinal;
private String rdaCommonStandard;
private List<String> schematics; private List<String> schematics;
private String numbering; private String numbering;
private ViewStyle viewStyle; private ViewStyle viewStyle;
@ -43,13 +42,6 @@ public class Field implements DatabaseViewStyleDefinition, XmlSerializable<Field
this.ordinal = ordinal; this.ordinal = ordinal;
} }
public String getRdaCommonStandard() {
return rdaCommonStandard;
}
public void setRdaCommonStandard(String rdaCommonStandard) {
this.rdaCommonStandard = rdaCommonStandard;
}
public List<String> getSchematics() { public List<String> getSchematics() {
return schematics; return schematics;
} }
@ -113,15 +105,14 @@ public class Field implements DatabaseViewStyleDefinition, XmlSerializable<Field
rootElement.setAttribute("id", this.id); rootElement.setAttribute("id", this.id);
rootElement.setAttribute("ordinal", "" + this.ordinal); rootElement.setAttribute("ordinal", "" + this.ordinal);
Element rdaCommonStandard = doc.createElement("rdaCommonStandard");
rdaCommonStandard.setTextContent(this.rdaCommonStandard);
Element schematics = doc.createElement("schematics"); Element schematics = doc.createElement("schematics");
for(String s : this.schematics){ if (this.schematics != null) {
for (String s : this.schematics) {
Element schematic = doc.createElement("schematic"); Element schematic = doc.createElement("schematic");
schematic.setTextContent(s); schematic.setTextContent(s);
schematics.appendChild(schematic); schematics.appendChild(schematic);
} }
}
Element viewStyle = doc.createElement("viewStyle"); Element viewStyle = doc.createElement("viewStyle");
viewStyle.setAttribute("renderstyle", this.viewStyle.getRenderStyle()); viewStyle.setAttribute("renderstyle", this.viewStyle.getRenderStyle());
@ -143,7 +134,6 @@ public class Field implements DatabaseViewStyleDefinition, XmlSerializable<Field
Element numbering = doc.createElement("numbering"); Element numbering = doc.createElement("numbering");
numbering.setTextContent(this.numbering); numbering.setTextContent(this.numbering);
rootElement.appendChild(rdaCommonStandard);
rootElement.appendChild(schematics); rootElement.appendChild(schematics);
rootElement.appendChild(numbering); rootElement.appendChild(numbering);
rootElement.appendChild(validations); rootElement.appendChild(validations);
@ -174,9 +164,6 @@ public class Field implements DatabaseViewStyleDefinition, XmlSerializable<Field
Element numbering = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "numbering"); Element numbering = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "numbering");
if (numbering != null) this.numbering = numbering.getTextContent(); if (numbering != null) this.numbering = numbering.getTextContent();
Element rdaCommonStandard = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "rdaCommonStandard");
if (rdaCommonStandard != null) this.rdaCommonStandard = rdaCommonStandard.getTextContent();
this.schematics = new LinkedList<>(); this.schematics = new LinkedList<>();
Element schematics = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "schematics"); Element schematics = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "schematics");
if(schematics != null){ if(schematics != null){

View File

@ -39,7 +39,6 @@ public class Field implements Comparable, PropertiesModelBuilder, ViewStyleDefin
private List<Field> multiplicityItems; private List<Field> multiplicityItems;
private List<eu.eudat.models.data.admin.components.datasetprofile.Field.ValidationType> validations; private List<eu.eudat.models.data.admin.components.datasetprofile.Field.ValidationType> validations;
private Visibility visible; private Visibility visible;
private String rdaProperty;
private List<String> schematics; private List<String> schematics;
private Boolean export; private Boolean export;
@ -155,14 +154,6 @@ public class Field implements Comparable, PropertiesModelBuilder, ViewStyleDefin
this.numbering = numbering; this.numbering = numbering;
} }
public String getRdaProperty() {
return rdaProperty;
}
public void setRdaProperty(String rdaProperty) {
this.rdaProperty = rdaProperty;
}
public List<String> getSchematics() { public List<String> getSchematics() {
return schematics; return schematics;
} }
@ -190,7 +181,6 @@ public class Field implements Comparable, PropertiesModelBuilder, ViewStyleDefin
newField.defaultValue = this.defaultValue; newField.defaultValue = this.defaultValue;
newField.data = this.data; newField.data = this.data;
newField.validations = this.validations; newField.validations = this.validations;
newField.rdaProperty = this.rdaProperty;
newField.schematics = this.schematics; newField.schematics = this.schematics;
newField.numbering = "mult" + index + "_" + this.numbering; newField.numbering = "mult" + index + "_" + this.numbering;
newField.export = this.export; newField.export = this.export;
@ -206,7 +196,6 @@ public class Field implements Comparable, PropertiesModelBuilder, ViewStyleDefin
field.setDefaultValue(this.defaultValue); field.setDefaultValue(this.defaultValue);
field.setVisible(this.visible); field.setVisible(this.visible);
field.setValidations(this.validations); field.setValidations(this.validations);
field.setRdaCommonStandard(this.rdaProperty);
field.setSchematics(this.schematics); field.setSchematics(this.schematics);
field.setExport(this.export); field.setExport(this.export);
return field; return field;
@ -222,7 +211,6 @@ public class Field implements Comparable, PropertiesModelBuilder, ViewStyleDefin
this.defaultValue = item.getDefaultValue(); this.defaultValue = item.getDefaultValue();
this.visible = item.getVisible(); this.visible = item.getVisible();
this.validations = item.getValidations(); this.validations = item.getValidations();
this.rdaProperty = item.getRdaCommonStandard();
this.schematics = item.getSchematics(); this.schematics = item.getSchematics();
this.export = item.getExport(); this.export = item.getExport();
} }

View File

@ -23,7 +23,6 @@ pdf.converter.url=http://localhost:3000/
####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## ####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS##########
configuration.externalUrls=externalUrls/ExternalUrls.xml configuration.externalUrls=externalUrls/ExternalUrls.xml
configuration.rda=RDACommonStandards.txt
configuration.schematics=Schematics.json configuration.schematics=Schematics.json
configuration.h2020template=documents/h2020.docx configuration.h2020template=documents/h2020.docx
configuration.h2020datasettemplate=documents/h2020_dataset.docx configuration.h2020datasettemplate=documents/h2020_dataset.docx

View File

@ -23,7 +23,6 @@ pdf.converter.url=http://opendmp-pdf:3000/
####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## ####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS##########
configuration.externalUrls=externalUrls/ExternalUrls.xml configuration.externalUrls=externalUrls/ExternalUrls.xml
configuration.rda=RDACommonStandards.txt
configuration.h2020template=documents/h2020.docx configuration.h2020template=documents/h2020.docx
configuration.h2020datasettemplate=documents/h2020_dataset.docx configuration.h2020datasettemplate=documents/h2020_dataset.docx
configuration.configurable_login_providers=configurableLoginProviders.json configuration.configurable_login_providers=configurableLoginProviders.json

View File

@ -17,7 +17,6 @@ pdf.converter.url=http://docsbox-web/
####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## ####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS##########
configuration.externalUrls=externalUrls/ExternalUrls.xml configuration.externalUrls=externalUrls/ExternalUrls.xml
configuration.rda=RDACommonStandards.txt
configuration.h2020template=documents/h2020.docx configuration.h2020template=documents/h2020.docx
configuration.h2020datasettemplate=documents/h2020_dataset.docx configuration.h2020datasettemplate=documents/h2020_dataset.docx
configuration.configurable_login_providers=ConfigurableLoginProviders.json configuration.configurable_login_providers=ConfigurableLoginProviders.json

View File

@ -49,7 +49,6 @@ elasticsearch.certKey=
####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## ####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS##########
configuration.externalUrls=externalUrls/ExternalUrls.xml configuration.externalUrls=externalUrls/ExternalUrls.xml
configuration.rda=RDACommonStandards.txt
configuration.schematics=Schematics.json configuration.schematics=Schematics.json
configuration.h2020template=documents/h2020.docx configuration.h2020template=documents/h2020.docx
configuration.h2020datasettemplate=documents/h2020_dataset.docx configuration.h2020datasettemplate=documents/h2020_dataset.docx

View File

@ -59,7 +59,6 @@ export interface Field {
data: any; data: any;
visible: Visibility; visible: Visibility;
validations: ValidationType[]; validations: ValidationType[];
rdaCommonStandard: string;
schematics: string[]; schematics: string[];
export: boolean; export: boolean;
} }

View File

@ -19,9 +19,6 @@ import { ConfigurationService } from '../configuration/configuration.service';
@Injectable() @Injectable()
export class DatasetProfileService extends BaseService { export class DatasetProfileService extends BaseService {
private rdaCommonStandards: String[];
private rdaCommonStandardsLoading: boolean;
private actionUrl: string; private actionUrl: string;
private headers = new HttpHeaders(); private headers = new HttpHeaders();
@ -78,19 +75,6 @@ export class DatasetProfileService extends BaseService {
return this.http.post(this.actionUrl + "upload", formData, { params: params }); return this.http.post(this.actionUrl + "upload", formData, { params: params });
} }
getRDACommonStandards(): String[] {
if (!this.rdaCommonStandards && !this.rdaCommonStandardsLoading) { this.getRDACommonStandardsInternal(); }
return this.rdaCommonStandards;
}
private getRDACommonStandardsInternal() {
this.rdaCommonStandardsLoading = true;
return this.http.get<String[]>(this.actionUrl + "getRDACommonStandards").pipe(takeUntil(this._destroyed)).subscribe(x => {
this.rdaCommonStandards = x;
this.rdaCommonStandardsLoading = false;
});
}
searchSchematics(like: string): Observable<String[]> { searchSchematics(like: string): Observable<String[]> {
return this.http.get<String[]>(this.actionUrl + "getSchematics?query=" + like); return this.http.get<String[]>(this.actionUrl + "getSchematics?query=" + like);
} }

View File

@ -47,7 +47,6 @@ export class FieldEditorModel extends BaseFormModel {
public visible: VisibilityEditorModel = new VisibilityEditorModel(); public visible: VisibilityEditorModel = new VisibilityEditorModel();
public data: FieldDataEditorModel<any>; public data: FieldDataEditorModel<any>;
public validations: ValidationType[] = []; public validations: ValidationType[] = [];
public rdaCommonStandard: string;
public schematics: string[]; public schematics: string[];
public export: boolean = true; public export: boolean = true;
@ -59,7 +58,6 @@ export class FieldEditorModel extends BaseFormModel {
this.validations = item.validations; this.validations = item.validations;
this.viewStyle = new ViewStyleEditorModel().fromModel(item.viewStyle); this.viewStyle = new ViewStyleEditorModel().fromModel(item.viewStyle);
this.visible = new VisibilityEditorModel().fromModel(item.visible); this.visible = new VisibilityEditorModel().fromModel(item.visible);
this.rdaCommonStandard = item.rdaCommonStandard;
this.schematics = item.schematics; this.schematics = item.schematics;
this.export = item.export; this.export = item.export;
@ -107,7 +105,6 @@ export class FieldEditorModel extends BaseFormModel {
page: [{ value: this.page, disabled: (disabled && !skipDisable.includes('FieldEditorModel.page')) }], page: [{ value: this.page, disabled: (disabled && !skipDisable.includes('FieldEditorModel.page')) }],
ordinal: [{ value: this.ordinal, disabled: (disabled && !skipDisable.includes('FieldEditorModel.ordinal')) }], ordinal: [{ value: this.ordinal, disabled: (disabled && !skipDisable.includes('FieldEditorModel.ordinal')) }],
validations: [{ value: this.validations, disabled: (disabled && !skipDisable.includes('FieldEditorModel.validations')) }], 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')) }], schematics: [{ value: this.schematics, disabled: (disabled && !skipDisable.includes('FieldEditorModel.schematics')) }],
export: [{value: this.export, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.export'))}] export: [{value: this.export, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.export'))}]
}); });

View File

@ -72,9 +72,6 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
@Output() delete = new EventEmitter<void>(); @Output() delete = new EventEmitter<void>();
//rdaCommonStandards = this.datasetProfileService.getRDACommonStandards(); //GK: Don't do that again. The service has a weird async behaviour.
schematicsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = { schematicsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
filterFn: this.filterSchematics.bind(this), filterFn: this.filterSchematics.bind(this),
initialItems: (excludedItems: any[]) => this.filterSchematics('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x !== resultItem)))), initialItems: (excludedItems: any[]) => this.filterSchematics('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x !== resultItem)))),

View File

@ -11,7 +11,6 @@
"FreeTextFieldDataEditorModel.label", "FreeTextFieldDataEditorModel.label",
"WordListFieldDataEditorModel.label", "WordListFieldDataEditorModel.label",
"FieldDataOptionEditorModel.label", "FieldDataOptionEditorModel.label",
"FieldSetEditorModel.rdaCommonStandard",
"FieldSetEditorModel.schematics", "FieldSetEditorModel.schematics",
"FieldSetEditorModel.export" "FieldSetEditorModel.export"
] ]