remove description template section multiplicity property

This commit is contained in:
amentis 2024-04-08 10:45:32 +03:00
parent 6ffc0a0a10
commit e89bfdf0f4
11 changed files with 6 additions and 52 deletions

View File

@ -28,8 +28,6 @@ public class SectionEntity{
@XmlElementWrapper(name = "fieldSets") @XmlElementWrapper(name = "fieldSets")
@XmlElement(name = "fieldSet") @XmlElement(name = "fieldSet")
private List<FieldSetEntity> fieldSets; private List<FieldSetEntity> fieldSets;
@XmlAttribute(name="multiplicity")
private Boolean multiplicity;
public String getId() { public String getId() {
return id; return id;
@ -103,14 +101,6 @@ public class SectionEntity{
this.numbering = numbering; this.numbering = numbering;
} }
public Boolean getMultiplicity() {
return multiplicity;
}
public void setMultiplicity(Boolean multiplicity) {
this.multiplicity = multiplicity;
}
public List<FieldEntity> getAllField(){ public List<FieldEntity> getAllField(){
List<FieldEntity> fieldEntities = new ArrayList<>(); List<FieldEntity> fieldEntities = new ArrayList<>();
if (this.getFieldSets() != null){ if (this.getFieldSets() != null){

View File

@ -53,7 +53,6 @@ public class SectionCommonModelBuilder extends BaseCommonModelBuilder<SectionMod
m.setDescription(d.getDescription()); m.setDescription(d.getDescription());
m.setOrdinal(d.getOrdinal()); m.setOrdinal(d.getOrdinal());
m.setDefaultVisibility(d.isDefaultVisibility()); m.setDefaultVisibility(d.isDefaultVisibility());
m.setMultiplicity(d.getMultiplicity());
m.setNumbering(d.getNumbering()); m.setNumbering(d.getNumbering());
m.setTitle(d.getTitle()); m.setTitle(d.getTitle());
m.setExtendedDescription(d.getExtendedDescription()); m.setExtendedDescription(d.getExtendedDescription());

View File

@ -54,7 +54,6 @@ public class SectionBuilder extends BaseBuilder<Section, SectionEntity> {
if (fields.hasField(this.asIndexer(Section._description))) m.setDescription(d.getDescription()); if (fields.hasField(this.asIndexer(Section._description))) m.setDescription(d.getDescription());
if (fields.hasField(this.asIndexer(Section._ordinal))) m.setOrdinal(d.getOrdinal()); if (fields.hasField(this.asIndexer(Section._ordinal))) m.setOrdinal(d.getOrdinal());
if (fields.hasField(this.asIndexer(Section._defaultVisibility))) m.setDefaultVisibility(d.isDefaultVisibility()); if (fields.hasField(this.asIndexer(Section._defaultVisibility))) m.setDefaultVisibility(d.isDefaultVisibility());
if (fields.hasField(this.asIndexer(Section._multiplicity))) m.setMultiplicity(d.getMultiplicity());
if (fields.hasField(this.asIndexer(Section._numbering))) m.setNumbering(d.getNumbering()); if (fields.hasField(this.asIndexer(Section._numbering))) m.setNumbering(d.getNumbering());
if (fields.hasField(this.asIndexer(Section._title))) m.setTitle(d.getTitle()); if (fields.hasField(this.asIndexer(Section._title))) m.setTitle(d.getTitle());
if (fields.hasField(this.asIndexer(Section._extendedDescription))) m.setExtendedDescription(d.getExtendedDescription()); if (fields.hasField(this.asIndexer(Section._extendedDescription))) m.setExtendedDescription(d.getExtendedDescription());

View File

@ -14,9 +14,6 @@ public class Section {
public final static String _defaultVisibility = "defaultVisibility"; public final static String _defaultVisibility = "defaultVisibility";
private Boolean defaultVisibility; private Boolean defaultVisibility;
public final static String _multiplicity = "multiplicity";
private Boolean multiplicity;
public final static String _numbering = "numbering"; public final static String _numbering = "numbering";
private String numbering; //TODO maybe remove private String numbering; //TODO maybe remove
@ -59,14 +56,6 @@ public class Section {
this.defaultVisibility = defaultVisibility; this.defaultVisibility = defaultVisibility;
} }
public Boolean getMultiplicity() {
return multiplicity;
}
public void setMultiplicity(Boolean multiplicity) {
this.multiplicity = multiplicity;
}
public String getNumbering() { public String getNumbering() {
return numbering; return numbering;
} }

View File

@ -19,7 +19,6 @@ public class DescriptionSectionToDatasetSectionMapper {
model.setOrdinal(section.getOrdinal()); model.setOrdinal(section.getOrdinal());
model.setTitle(section.getTitle()); model.setTitle(section.getTitle());
model.setSections(section.getSections().stream().map(x-> this.toPublicModel(x, page)).toList()); model.setSections(section.getSections().stream().map(x-> this.toPublicModel(x, page)).toList());
model.setMultiplicity(section.getMultiplicity());
model.setDefaultVisibility(section.getDefaultVisibility()); model.setDefaultVisibility(section.getDefaultVisibility());
model.setNumbering(section.getNumbering()); model.setNumbering(section.getNumbering());
model.setPage("page_" + page); model.setPage("page_" + page);

View File

@ -232,14 +232,6 @@ public class ReferencePersist {
@Override @Override
protected List<Specification> specifications(ReferencePersist item) { protected List<Specification> specifications(ReferencePersist item) {
return Arrays.asList( return Arrays.asList(
this.spec()
.iff(() -> this.isValidGuid(item.getId()))
.must(() -> this.isValidHash(item.getHash()))
.failOn(ReferencePersist._hash).failWith(messageSource.getMessage("Validation_Required", new Object[]{ReferencePersist._hash}, LocaleContextHolder.getLocale())),
this.spec()
.iff(() -> !this.isValidGuid(item.getId()))
.must(() -> !this.isValidHash(item.getHash()))
.failOn(ReferencePersist._hash).failWith(messageSource.getMessage("Validation_OverPosting", new Object[]{}, LocaleContextHolder.getLocale())),
this.spec() this.spec()
.must(() -> !this.isEmpty(item.getLabel())) .must(() -> !this.isEmpty(item.getLabel()))
.failOn(ReferencePersist._label).failWith(messageSource.getMessage("Validation_Required", new Object[]{ReferencePersist._label}, LocaleContextHolder.getLocale())), .failOn(ReferencePersist._label).failWith(messageSource.getMessage("Validation_Required", new Object[]{ReferencePersist._label}, LocaleContextHolder.getLocale())),

View File

@ -28,10 +28,6 @@ public class SectionPersist {
public static final String _defaultVisibility = "defaultVisibility"; public static final String _defaultVisibility = "defaultVisibility";
private Boolean multiplicity = null;
public static final String _multiplicity = "multiplicity";
private String title = null; private String title = null;
public static final String _title = "title"; public static final String _title = "title";
@ -72,13 +68,6 @@ public class SectionPersist {
this.defaultVisibility = defaultVisibility; this.defaultVisibility = defaultVisibility;
} }
public Boolean getMultiplicity() {
return multiplicity;
}
public void setMultiplicity(Boolean multiplicity) {
this.multiplicity = multiplicity;
}
public String getTitle() { public String getTitle() {
return title; return title;
@ -145,9 +134,6 @@ public class SectionPersist {
this.spec() this.spec()
.must(() -> !this.isNull(item.getDefaultVisibility())) .must(() -> !this.isNull(item.getDefaultVisibility()))
.failOn(SectionPersist._defaultVisibility).failWith(messageSource.getMessage("Validation_Required", new Object[]{SectionPersist._defaultVisibility}, LocaleContextHolder.getLocale())), .failOn(SectionPersist._defaultVisibility).failWith(messageSource.getMessage("Validation_Required", new Object[]{SectionPersist._defaultVisibility}, LocaleContextHolder.getLocale())),
this.spec()
.must(() -> !this.isNull(item.getMultiplicity()))
.failOn(SectionPersist._multiplicity).failWith(messageSource.getMessage("Validation_Required", new Object[]{SectionPersist._multiplicity}, LocaleContextHolder.getLocale())),
this.spec() this.spec()
.must(() -> !this.isEmpty(item.getTitle())) .must(() -> !this.isEmpty(item.getTitle()))
.failOn(SectionPersist._title).failWith(messageSource.getMessage("Validation_Required", new Object[]{SectionPersist._title}, LocaleContextHolder.getLocale())), .failOn(SectionPersist._title).failWith(messageSource.getMessage("Validation_Required", new Object[]{SectionPersist._title}, LocaleContextHolder.getLocale())),

View File

@ -560,6 +560,7 @@ public class DescriptionServiceImpl implements DescriptionService {
if (referenceEntity == null){ if (referenceEntity == null){
referenceEntity = new ReferenceEntity(); referenceEntity = new ReferenceEntity();
referenceEntity.setId(UUID.randomUUID()); referenceEntity.setId(UUID.randomUUID());
referenceEntity.setLabel(referencePersist.getLabel());
referenceEntity.setIsActive(IsActive.Active); referenceEntity.setIsActive(IsActive.Active);
referenceEntity.setCreatedAt(Instant.now()); referenceEntity.setCreatedAt(Instant.now());
referenceEntity.setTypeId(fieldEntity.getReferenceTypeId()); referenceEntity.setTypeId(fieldEntity.getReferenceTypeId());

View File

@ -316,7 +316,6 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
data.setDescription(persist.getDescription()); data.setDescription(persist.getDescription());
data.setOrdinal(persist.getOrdinal()); data.setOrdinal(persist.getOrdinal());
data.setDefaultVisibility(persist.getDefaultVisibility()); data.setDefaultVisibility(persist.getDefaultVisibility());
data.setMultiplicity(persist.getMultiplicity());
data.setTitle(persist.getTitle()); data.setTitle(persist.getTitle());
if (!this.conventionService.isListNullOrEmpty(persist.getSections())) { if (!this.conventionService.isListNullOrEmpty(persist.getSections())) {
@ -329,14 +328,14 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
if (!this.conventionService.isListNullOrEmpty(persist.getFieldSets())) { if (!this.conventionService.isListNullOrEmpty(persist.getFieldSets())) {
data.setFieldSets(new ArrayList<>()); data.setFieldSets(new ArrayList<>());
for (FieldSetPersist fieldSetPersist : persist.getFieldSets()) { for (FieldSetPersist fieldSetPersist : persist.getFieldSets()) {
data.getFieldSets().add(this.buildFieldSetEntity(fieldSetPersist, persist.getMultiplicity())); data.getFieldSets().add(this.buildFieldSetEntity(fieldSetPersist));
} }
} }
return data; return data;
} }
private @NotNull FieldSetEntity buildFieldSetEntity(FieldSetPersist persist, Boolean multiplicity) throws InvalidApplicationException { private @NotNull FieldSetEntity buildFieldSetEntity(FieldSetPersist persist) throws InvalidApplicationException {
FieldSetEntity data = new FieldSetEntity(); FieldSetEntity data = new FieldSetEntity();
if (persist == null) if (persist == null)
return data; return data;
@ -348,7 +347,7 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
data.setNumbering(persist.getNumbering()); data.setNumbering(persist.getNumbering());
data.setAdditionalInformation(persist.getAdditionalInformation()); data.setAdditionalInformation(persist.getAdditionalInformation());
data.setExtendedDescription(persist.getExtendedDescription()); data.setExtendedDescription(persist.getExtendedDescription());
if (persist.getMultiplicity() != null && multiplicity) if (persist.getMultiplicity() != null)
data.setMultiplicity(this.buildMultiplicityEntity(persist.getMultiplicity())); data.setMultiplicity(this.buildMultiplicityEntity(persist.getMultiplicity()));
data.setHasCommentField(persist.getHasCommentField()); data.setHasCommentField(persist.getHasCommentField());

View File

@ -166,7 +166,6 @@ public class PublicDatasetsDescriptionDocumentation {
String.join(".", Description._descriptionTemplate, DescriptionTemplate._definition, Definition._pages, Page._sections, Section._description), String.join(".", Description._descriptionTemplate, DescriptionTemplate._definition, Definition._pages, Page._sections, Section._description),
String.join(".", Description._descriptionTemplate, DescriptionTemplate._definition, Definition._pages, Page._sections, Section._extendedDescription), String.join(".", Description._descriptionTemplate, DescriptionTemplate._definition, Definition._pages, Page._sections, Section._extendedDescription),
String.join(".", Description._descriptionTemplate, DescriptionTemplate._definition, Definition._pages, Page._sections, Section._title), String.join(".", Description._descriptionTemplate, DescriptionTemplate._definition, Definition._pages, Page._sections, Section._title),
String.join(".", Description._descriptionTemplate, DescriptionTemplate._definition, Definition._pages, Page._sections, Section._multiplicity),
String.join(".", Description._descriptionTemplate, DescriptionTemplate._definition, Definition._pages, Page._sections, Section._numbering), String.join(".", Description._descriptionTemplate, DescriptionTemplate._definition, Definition._pages, Page._sections, Section._numbering),
String.join(".", Description._descriptionTemplate, DescriptionTemplate._definition, Definition._pages, Page._sections, Section._ordinal), String.join(".", Description._descriptionTemplate, DescriptionTemplate._definition, Definition._pages, Page._sections, Section._ordinal),
String.join(".", Description._descriptionTemplate, DescriptionTemplate._definition, Definition._pages, Page._sections, Section._sections), String.join(".", Description._descriptionTemplate, DescriptionTemplate._definition, Definition._pages, Page._sections, Section._sections),

View File

@ -124,8 +124,9 @@ export class ReferenceService {
filterFn: (searchQuery: string, data?: any) => this.searchWithDefinition(this.buildAutocompleteSearchLookup(typeId, searchQuery)).pipe(map(x => x)), filterFn: (searchQuery: string, data?: any) => this.searchWithDefinition(this.buildAutocompleteSearchLookup(typeId, searchQuery)).pipe(map(x => x)),
getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteSearchSelectedItemsLookup([typeId], null, null, null, [selectedItem])).pipe(map(x => x.items[0])), getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteSearchSelectedItemsLookup([typeId], null, null, null, [selectedItem])).pipe(map(x => x.items[0])),
displayFn: (item: Reference) => item.label, displayFn: (item: Reference) => item.label,
subtitleFn: (item: Reference) => item?.sourceType === ReferenceSourceType.External ? this.language.instant('REFERENCE-FIELD-COMPONENT.EXTERNAL-SOURCE') + ': ' + item.source : this.language.instant('REFERENCE-FIELD-COMPONENT.INTERNAL-SOURCE'),
titleFn: (item: Reference) => item.label, titleFn: (item: Reference) => item.label,
valueAssign: (item: Reference) => item.id, valueAssign: (item: Reference) => item,
}; };
}; };