Commit b597d480 authored by Adrien's avatar Adrien
Browse files

[EVSCLT-872] FIX adding referenced standard

parent 86581758
Pipeline #274234 failed with stages
in 4 minutes and 13 seconds
......@@ -2,6 +2,7 @@ package net.ihe.gazelle.evs.client.adapter.serviceconf.gui;
import net.ihe.gazelle.evs.client.adapter.serviceconf.dto.ValidationServiceDto;
import net.ihe.gazelle.evs.client.application.serviceconf.ServiceConfManager;
import net.ihe.gazelle.evs.client.business.reports.NamedStylesheet;
import net.ihe.gazelle.evs.client.business.serviceconf.AbstractValidationServiceConf;
import net.ihe.gazelle.evs.client.business.serviceconf.ReferencedStandard;
import net.ihe.gazelle.evs.client.business.reports.Stylesheet;
......@@ -19,7 +20,7 @@ public class ReferencedStandardBeanGui {
private ReferencedStandard selectedReferencedStandard;
private Boolean creation;
private Stylesheet selectedStylesheet;
private NamedStylesheet selectedStylesheet;
private int stylesheetIndex;
......@@ -50,7 +51,7 @@ public class ReferencedStandardBeanGui {
return selectedStylesheet;
}
public void setSelectedStylesheet(Stylesheet selectedStylesheet) {
public void setSelectedStylesheet(NamedStylesheet selectedStylesheet) {
this.selectedStylesheet = selectedStylesheet;
}
......@@ -113,11 +114,11 @@ public class ReferencedStandardBeanGui {
}
public void initSelectedStyleSheet() {
this.selectedStylesheet = new Stylesheet();
this.selectedStylesheet = new NamedStylesheet();
}
public void saveSelectedStylesheet() {
List<Stylesheet> objectStylesheets = selectedReferencedStandard.getObjectStylesheets();
List<NamedStylesheet> objectStylesheets = selectedReferencedStandard.getObjectStylesheets();
int index = objectStylesheets.indexOf(selectedStylesheet);
if (index < 0) {
selectedReferencedStandard.getObjectStylesheets().add(selectedStylesheet);
......
package net.ihe.gazelle.evs.client.business.reports;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;
@Entity
@Table(name = "evsc_named_stylesheet", schema = "public")
public class NamedStylesheet extends Stylesheet {
@Column(name = "name")
private String name;
public NamedStylesheet() {
}
public NamedStylesheet(String location, String name) {
super(location);
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
......@@ -6,6 +6,7 @@ import java.io.Serializable;
import java.util.Objects;
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "evsc_stylesheet", schema = "public")
@SequenceGenerator(name = "evsc_stylesheet_sequence", sequenceName = "evsc_stylesheet_id_seq", allocationSize = 1)
public class Stylesheet implements Serializable {
......
......@@ -20,6 +20,7 @@
*/
package net.ihe.gazelle.evs.client.business.serviceconf;
import net.ihe.gazelle.evs.client.business.reports.NamedStylesheet;
import net.ihe.gazelle.evs.client.business.reports.Stylesheet;
import org.hibernate.annotations.Type;
......@@ -85,7 +86,7 @@ public class ReferencedStandard implements Serializable, Comparable<ReferencedSt
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
@JoinColumn(name = "referenced_standard_id")
private List<Stylesheet> objectStylesheets = new ArrayList<>();
private List<NamedStylesheet> objectStylesheets = new ArrayList<>();
@ManyToMany
@JoinTable(name = "evsc_referenced_standard_validation_service",
......@@ -149,11 +150,11 @@ public class ReferencedStandard implements Serializable, Comparable<ReferencedSt
this.iconStyleClass = iconStyleClass;
}
public List<Stylesheet> getObjectStylesheets() {
public List<NamedStylesheet> getObjectStylesheets() {
return objectStylesheets;
}
public void setObjectStylesheets(List<Stylesheet> objectStylesheets) {
public void setObjectStylesheets(List<NamedStylesheet> objectStylesheets) {
this.objectStylesheets = objectStylesheets;
}
......
......@@ -131,9 +131,9 @@
rendered="#{!referencedStandardBeanGui.selectedReferencedStandard.objectStylesheets.isEmpty()}"
var="currentStyleSheet"
iterationStatusVar="it">
<g:column sortBy="#{currentStyleSheet.keyword}" sortOrder="ascending">
<g:column sortBy="#{currentStyleSheet.name}" sortOrder="ascending">
<ui:define name="header">#{messages['net.ihe.gazelle.evs.Name']}</ui:define>
<h:outputText value="#{currentStyleSheet.keyword}"/>
<h:outputText value="#{currentStyleSheet.name}"/>
</g:column>
<g:column sortBy="#{currentStyleSheet.location}" sortOrder="ascending">
<ui:define name="header">#{messages['net.ihe.gazelle.evs.Path']}</ui:define>
......@@ -254,7 +254,7 @@
<ui:define name="label">#{messages['gazelle.evs.client.Name']}</ui:define>
<h:inputText id="label2Id" maxlength="250" required="true"
requiredMessage="You need to provide a name"
value="#{referencedStandardBeanGui.selectedStylesheet.keyword}" styleClass="form-control">
value="#{referencedStandardBeanGui.selectedStylesheet.name}" styleClass="form-control">
<a4j:ajax event="blur" render="nameDecoration" execute="@this"/>
</h:inputText>
......@@ -289,7 +289,7 @@
<h:outputText value="#{messages['net.ihe.gazelle.evs.DeleteStylesheet']}"/>
</ui:define>
<h:outputText
value="#{messages['net.ihe.gazelle.evs.AreYouSureYouWantToDeleteTheStylesheet']} #{referencedStandardBeanGui.selectedStylesheet.keyword} ?"/>
value="#{messages['net.ihe.gazelle.evs.AreYouSureYouWantToDeleteTheStylesheet']} #{referencedStandardBeanGui.selectedStylesheet.name} ?"/>
<ui:define name="popup_footer">
<a4j:commandButton value="#{messages['net.ihe.gazelle.evs.Cancel']}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment