GUI Meldungen Ausgabe
This commit is contained in:
@@ -5,6 +5,8 @@ import at.vvo.omds.client.gui.api.calc.CalculateRequestAuskunftService;
|
||||
import at.vvo.omds.client.gui.api.SOAPConnector;
|
||||
import at.vvo.omds.types.omds3.r2025_05.common.*;
|
||||
import at.vvo.omds.types.omds3.r2025_05.on2antrag.common.*;
|
||||
import com.sun.xml.messaging.saaj.SOAPExceptionImpl;
|
||||
import javafx.animation.PauseTransition;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.geometry.Pos;
|
||||
@@ -15,6 +17,7 @@ import javafx.scene.layout.*;
|
||||
import javafx.scene.paint.Paint;
|
||||
import javafx.scene.text.*;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.util.Duration;
|
||||
|
||||
import javax.xml.datatype.DatatypeConfigurationException;
|
||||
import javax.xml.datatype.DatatypeFactory;
|
||||
@@ -22,6 +25,7 @@ import javax.xml.datatype.XMLGregorianCalendar;
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
public class AllinOneView extends Application {
|
||||
@@ -66,10 +70,23 @@ public class AllinOneView extends Application {
|
||||
try {
|
||||
response.set(s.aprioriAuskunft(stichtag.get(), "042"));
|
||||
} catch (NoSuchElementException ex) {
|
||||
logFlow.getChildren().add(new Text("Kein Verkaufsoffenes Produkt an dem Datum: " +
|
||||
controlBox[0].getChildren().clear();
|
||||
controlBox[0].getChildren().add(dp);
|
||||
vpBox.getItems().clear();
|
||||
|
||||
Text text = new Text("Kein Verkaufsoffenes Produkt an dem Datum: " +
|
||||
stichtag.get().toString().substring(0, stichtag.get().toString().length() - 1) +
|
||||
System.lineSeparator()));
|
||||
throw new NoSuchElementException("Kein Verkaufsoffenes Produkt an dem Datum: " + stichtag.get());
|
||||
System.lineSeparator());
|
||||
text.setFill(Paint.valueOf("#dd0000"));
|
||||
logFlow.getChildren().add(text);
|
||||
throw new NoSuchElementException(ex.getMessage());
|
||||
} catch (SOAPExceptionImpl ex) {
|
||||
HBox errorBox = new HBox();
|
||||
errorBox.setAlignment(Pos.CENTER);
|
||||
errorBox.setPadding(new Insets(10, 10, 10, 10));
|
||||
errorBox.getChildren().add(new Text("Keine Verbindung zum Server möglich!"));
|
||||
|
||||
controlBox[0].getChildren().add(errorBox);
|
||||
}
|
||||
newCalcRequestControlBox.setVisible(true);
|
||||
|
||||
@@ -174,7 +191,8 @@ public class AllinOneView extends Application {
|
||||
itemAttribute.addItemInfo(newSelection, infoBox);
|
||||
infoBoxFromItem = itemAttribute.getInfoBoxFromItem();
|
||||
// addItemInfo(newSelection, infoBox);
|
||||
System.out.println(newSelection.getValue().getClass().getName());
|
||||
}else{
|
||||
infoBox.getChildren().removeAll(infoBox.getChildren());
|
||||
}
|
||||
|
||||
});
|
||||
@@ -188,6 +206,7 @@ public class AllinOneView extends Application {
|
||||
if (item == null || empty) {
|
||||
setText(null);
|
||||
setGraphic(null);
|
||||
setStyle("");
|
||||
} else {
|
||||
HBox cellBox = new HBox();
|
||||
Button include = new Button("+");
|
||||
@@ -223,12 +242,29 @@ public class AllinOneView extends Application {
|
||||
|
||||
label.setMaxWidth(Double.MAX_VALUE);
|
||||
|
||||
if (getTreeItem().getValue().getClass().equals(VerkaufsproduktType.class) ||
|
||||
if (!(getTreeItem().getValue() instanceof VerkaufsproduktType)) {
|
||||
System.out.println(((ProduktbausteinType) getTreeItem().getValue()).getBezeichnung());
|
||||
System.out.println(timesItemisIncludedById.get(
|
||||
((ProduktbausteinType) getTreeItem().getValue()).getId()) != null);
|
||||
System.out.println("...");
|
||||
System.out.println(((ProduktbausteinType) getTreeItem().getValue()).getMaxVorkommen() != null
|
||||
&& ((ProduktbausteinType) getTreeItem().getValue()).getMaxVorkommen() >=
|
||||
timeItemIsIncludedByParent(getTreeItem().getParent(),
|
||||
((ProduktbausteinType) getTreeItem().getValue()).getId()));
|
||||
System.out.println("...");
|
||||
System.out.println(timeItemIsIncludedByParent(getTreeItem().getParent(),
|
||||
((ProduktbausteinType) getTreeItem().getValue()).getId()));
|
||||
System.out.println("...");
|
||||
System.out.println(((ProduktbausteinType) getTreeItem().getValue()).getMaxVorkommen() != null);
|
||||
System.out.println("-----------------------------------------------------------------------------");
|
||||
}
|
||||
if (getTreeItem().getValue() instanceof VerkaufsproduktType ||
|
||||
getTreeItem().getValue().getClass().equals(APrioriVerkaufsproduktType.class)) {
|
||||
cellBox.getChildren().addAll(label);
|
||||
} else if (timesItemisIncludedById.get(
|
||||
((ProduktbausteinType) getTreeItem().getValue()).getId()) != null
|
||||
&& ((ProduktbausteinType) getTreeItem().getValue()).getMaxVorkommen() ==
|
||||
&& ((ProduktbausteinType) getTreeItem().getValue()).getMaxVorkommen() != null
|
||||
&& ((ProduktbausteinType) getTreeItem().getValue()).getMaxVorkommen() <=
|
||||
timeItemIsIncludedByParent(getTreeItem().getParent(),
|
||||
((ProduktbausteinType) getTreeItem().getValue()).getId())) {
|
||||
include.setDisable(true);
|
||||
@@ -238,7 +274,6 @@ public class AllinOneView extends Application {
|
||||
cellBox.getChildren().addAll(label, spacer, include, spacer2, remove);
|
||||
}
|
||||
|
||||
|
||||
include.setOnAction(e -> {
|
||||
if (isNotIncluded.contains(getTreeItem())) {
|
||||
label.setFont(Font.font("System", label.getFont().getSize()));
|
||||
@@ -261,8 +296,7 @@ public class AllinOneView extends Application {
|
||||
refreshTimesItemisIncludedById(tv.getRoot());
|
||||
} else {
|
||||
TreeItem<Object> parent = getTreeItem().getParent();
|
||||
TreeItem<Object> clone =
|
||||
null;
|
||||
TreeItem<Object> clone = null;
|
||||
try {
|
||||
clone = treeHelper.cloneTreeItem(
|
||||
treeHelper.findTreeItem((ProduktbausteinType) item, originalRoot));
|
||||
@@ -308,6 +342,28 @@ public class AllinOneView extends Application {
|
||||
timesItemisIncludedById.clear();
|
||||
refreshTimesItemisIncludedById(tv.getRoot());
|
||||
});
|
||||
|
||||
if(((ProduktbausteinType) item).getMeldungen() != null && !((ProduktbausteinType) item).getMeldungen().isEmpty()) {
|
||||
AtomicBoolean symboleAdded = new AtomicBoolean(false);
|
||||
Text symbole = new Text("\u26A0 ");
|
||||
symbole.setFont(Font.font("System", FontWeight.BOLD, symbole.getFont().getSize() + 2));
|
||||
|
||||
|
||||
((ProduktbausteinType) item).getMeldungen().forEach(m -> {
|
||||
if(m.getErrorType().equals(BigInteger.ONE)) {
|
||||
symbole.setFill(Paint.valueOf("#aa3333"));
|
||||
symboleAdded.set(true);
|
||||
}
|
||||
if (m.getErrorType().equals(BigInteger.TWO) && !symboleAdded.get()) {
|
||||
symbole.setFill(Paint.valueOf("#ccbb00"));
|
||||
}
|
||||
});
|
||||
cellBox.getChildren().addFirst(symbole);
|
||||
}else {
|
||||
if (cellBox.getChildren().getFirst() instanceof Text && ((Text)cellBox.getChildren().getFirst()).getText().equals("\u26A0")) {
|
||||
cellBox.getChildren().removeFirst();
|
||||
}
|
||||
}
|
||||
setGraphic(cellBox);
|
||||
setText(null);
|
||||
}
|
||||
@@ -327,22 +383,31 @@ public class AllinOneView extends Application {
|
||||
timesItemisIncludedById = treeHelper.getTimesItemisIncludedById();
|
||||
newRoot.setExpanded(true);
|
||||
isNotIncluded.clear();
|
||||
if (calcResponse.getBerechnungsantwort().getVerkaufsprodukt().getMeldungen() == null ||
|
||||
calcResponse.getBerechnungsantwort().getVerkaufsprodukt().getMeldungen().isEmpty()) {
|
||||
if (!isMeldungVorhanden(calcResponse.getBerechnungsantwort().getVerkaufsprodukt())) {
|
||||
|
||||
Text text = new Text(LocalDateTime.now() + ": Gültiges Verkaufsprodukt " + System.lineSeparator());
|
||||
text.setFill(Paint.valueOf("#00bb33"));
|
||||
logFlow.getChildren().add(text);
|
||||
treeBox.setStyle("-fx-border-color: #00bb33");
|
||||
|
||||
} else {
|
||||
newRoot = treeHelper.addAprioriToCalc(newRoot, originalRoot);
|
||||
newRoot = treeHelper.sortTree(newRoot);
|
||||
tv.setRoot(treeHelper.addAprioriToCalc(newRoot, originalRoot));
|
||||
timesItemisIncludedById.clear();
|
||||
refreshTimesItemisIncludedById(tv.getRoot());
|
||||
PauseTransition pause = new PauseTransition(Duration.seconds(3));
|
||||
pause.setOnFinished(ep -> treeBox.setStyle("-fx-border-color: #000000"));
|
||||
pause.play();
|
||||
|
||||
}else {
|
||||
Text text = new Text(LocalDateTime.now() + ": Kein Gültiges Verkaufsprodukt " + System.lineSeparator());
|
||||
text.setFill(Paint.valueOf("#aa3333"));
|
||||
logFlow.getChildren().add(text);
|
||||
|
||||
}
|
||||
|
||||
newRoot = treeHelper.addAprioriToCalc(newRoot, originalRoot);
|
||||
newRoot = treeHelper.sortTree(newRoot);
|
||||
tv.setRoot(newRoot);
|
||||
timesItemisIncludedById.clear();
|
||||
|
||||
refreshTimesItemisIncludedById(tv.getRoot());
|
||||
|
||||
tv.refresh();
|
||||
|
||||
for (int j = 0; j < calcResponse.getBerechnungsantwort().getVerkaufsprodukt().getMeldungen().size(); j++) {
|
||||
@@ -406,13 +471,13 @@ public class AllinOneView extends Application {
|
||||
logFlow.setDisable(true);
|
||||
logFlow.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
|
||||
logFlow.setPadding(new Insets(20));
|
||||
logFlow.setStyle("-fx-border-color: black; -fx-background-color: white;");
|
||||
HBox.setMargin(logFlow, new Insets(10, 20, 10, 20));
|
||||
|
||||
logPane.setContent(logFlow);
|
||||
logPane.setFitToWidth(true);
|
||||
logPane.setFitToHeight(true);
|
||||
logPane.setMaxHeight(200);
|
||||
logPane.setStyle("-fx-border-color: black; -fx-background-color: white;");
|
||||
|
||||
HBox.setHgrow(logPane, Priority.ALWAYS);
|
||||
logWrapper.getChildren().add(logPane);
|
||||
@@ -423,19 +488,33 @@ public class AllinOneView extends Application {
|
||||
return vbox;
|
||||
}
|
||||
|
||||
// private TreeItem<Object> cleanTree(TreeItem<Object> original) {
|
||||
// if (isNotIncluded.contains(original)) {
|
||||
// return null;
|
||||
// }
|
||||
private boolean isMeldungVorhanden(ProduktbausteinType produkt) {
|
||||
if (produkt != null && produkt.getMeldungen() != null && !produkt.getMeldungen().isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
for (ProduktbausteinType child : produkt.getBausteine()){
|
||||
if(isMeldungVorhanden(child)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// private void addMeldungen(TreeItem<Object> newRoot, TextFlow logFlow, Node tv) {
|
||||
// if (!((ProduktbausteinType)newRoot.getValue()).getMeldungen().isEmpty()) {
|
||||
// PauseTransition pause = new PauseTransition(Duration.seconds(5));
|
||||
//
|
||||
// TreeItem<Object> newItem = new TreeItem<>(original.getValue());
|
||||
// for (TreeItem<Object> child : original.getChildren()) {
|
||||
// TreeItem<Object> cleanedChild = cleanTree(child);
|
||||
// if (cleanedChild != null) {
|
||||
// newItem.getChildren().add(cleanedChild);
|
||||
// pause.play();
|
||||
//
|
||||
// for (ServiceFault s : ((ProduktbausteinType)newRoot.getValue()).getMeldungen()) {
|
||||
// logFlow.getChildren().add(new Text(s.getErrorMsg() + System.lineSeparator()));
|
||||
//
|
||||
// if (tv != null) tv.setStyle("-fx-background-color: #aa3333");
|
||||
// }
|
||||
// }
|
||||
// if (!newRoot.getChildren().isEmpty()) {
|
||||
// for (TreeItem<Object> child : newRoot.getChildren()) {
|
||||
// addMeldungen(child, logFlow, child.getGraphic());
|
||||
// }
|
||||
// }
|
||||
// return newItem;
|
||||
// }
|
||||
|
||||
private void includeAddedParent(TreeItem<Object> treeItem) {
|
||||
@@ -478,7 +557,7 @@ public class AllinOneView extends Application {
|
||||
|
||||
private boolean shouldBeIncluded(TreeItem<Object> treeItem) {
|
||||
return !((isNotIncluded.contains(treeItem.getParent()) || isNotIncluded.contains(treeItem) ||
|
||||
(((ProduktbausteinType) treeItem.getValue()).getMinVorkommen() == 0 &&
|
||||
(((ProduktbausteinType) treeItem.getValue()).getMinVorkommen() != null && ((ProduktbausteinType) treeItem.getValue()).getMinVorkommen() == 0 &&
|
||||
(timesItemisIncludedById.get(((ProduktbausteinType) treeItem.getValue()).getId()) == null ||
|
||||
timesItemisIncludedById.get(((ProduktbausteinType) treeItem.getValue()).getId()) == 0))) &&
|
||||
!(treeItem.getValue() instanceof VerkaufsproduktType));
|
||||
|
||||
@@ -1,89 +1,70 @@
|
||||
# Server
|
||||
| Fehlercode | Fehler level | Beschreibung | Reaktion |
|
||||
|------------|--------------|------------------------------------------------------|----------|
|
||||
| SA0000 | 2 | Ungültiger Stichtag | react |
|
||||
| SA0100 | 2 | Ungültige VUNr | react |
|
||||
| SC0000 | 2 | Ungültiger Baustein | react |
|
||||
| SC0001 | 2 | Baustein kommt zu oft vor | react |
|
||||
| SC0002 | 2 | Baustein kommt nicht oft genug vor | react |
|
||||
| SC0003 | 2 | Baustein ist nicht verkaufsoffen | react |
|
||||
| SC0004 | 2 | Baustein namespace passt nicht | react |
|
||||
| SC0005 | 2 | Baustein ID stimmt nicht | react |
|
||||
| SC0006 | 2 | Baustein kann in der Datenbank nicht gefunden werden | react |
|
||||
| SC0100 | 2 | Ungültiges Attribut | react |
|
||||
| SC0101 | 2 | Attribut dem falschen Baustein zugeordnet | react |
|
||||
| SC0102 | 2 | Attribut value hat einen falschen wert | react |
|
||||
| SC0103 | 2 | Attribut value ist required aber nicht angegeben | react |
|
||||
| SC0104 | 2 | Attribut ID stimmt nicht | react |
|
||||
| SC0105 | 2 | Attribut nicht in der Datenbank vorhanden | react |
|
||||
# Verhalten Server und Client
|
||||
|
||||
# Client
|
||||
| Fehlercode | Fehler level | Beschreibung | Reaktion |
|
||||
|------------|--------------|------------------------------------|----------|
|
||||
| CX0000 | 2 | Ungültiger Response Type | react |
|
||||
| CA0000 | 2 | Ungültiges Verkaufsprodukt | react |
|
||||
| CA0001 | 2 | Verkaufsprodukt falscher typ | react |
|
||||
| CA0002 | 2 | Verkaufsprodukt falsche ID | react |
|
||||
| CA0003 | 2 | Verkaufsprodukt falscher namespace | react |
|
||||
| CA0100 | 2 | Ungültiger Baustein | react |
|
||||
| CA0101 | 2 | Baustein kommt zu oft vor | react |
|
||||
| CA0102 | 2 | Baustein falscher namespace | react |
|
||||
| CA0103 | 2 | Baustein falsche ID | react |
|
||||
| CA0104 | 2 | Baustein falscher Typ | react |
|
||||
| CC0000 | 2 | Ungültige Berechnungsantwort | react |
|
||||
| CC0100 | 2 | Ungültiges Verkaufsprodukt | react |
|
||||
| CC0101 | 2 | Verkaufsprodukt falscher typ | react |
|
||||
| CC0102 | 2 | Verkaufsprodukt falsche ID | react |
|
||||
| CC0103 | 2 | Verkaufsprodukt falscher namespace | react |
|
||||
| CC0200 | 2 | Ungültiger Baustein | react |
|
||||
| CC0200 | 2 | Baustein falsche ID | react |
|
||||
| CC0200 | 2 | Baustein falscher Typ | react |
|
||||
| CC0200 | 2 | Baustein falscher Namespace | react |
|
||||
### Prämissen
|
||||
* Request kann immer vollkommen "dirty" sein, über Kaskade von Prüfungen muss dies validiert werden.
|
||||
* Immer gültiges XML
|
||||
* Aufbau des Requests entspricht dem a priori Produktwissen. Wenn dagegen verstoßen wird (Baustein oder Attribut), gibt es
|
||||
möglichst sprechende Fehlermeldungen. Es ist aber ein Fehler zur Entwicklungszeit, d.h. es darf aber es muss keinen Produktbaum im
|
||||
Response geben, einfache Fehlermeldung genügt. Es ist kein inhaltlicher Konfigurationsfehler, der über einen "schönen"
|
||||
Response an den Client zur Korrektur gegeben werden muss.
|
||||
* Response darf teilweise "dirty" sein, damit gute Fehlerhinweise möglich sind und der User leicht korrigieren kann.
|
||||
* Client zeigt den Response an und keine Mischung aus seinem Request und dem Response. Damit
|
||||
Client und Server wieder synchron sind.
|
||||
* Das Verhalten könnte Context-gesteuert sein, z.B.:
|
||||
* Im Context "Produktvergleich" werden immer nur Fehlermeldungen geworfen
|
||||
* Im Context "Antrag", "Vertragsänderung" oder "Einzelkonfiguration" werden Empfehlungen abgegeben.
|
||||
* Das Verhalten des Servers könnte sogar Produktabhängig definiert sein: An manchen Bausteinen Variante 1 an
|
||||
anderen Variante 2 des Verhaltens.(?)
|
||||
* Berechnung nur, wenn die Instanz (Antrag, Vertrag) erfolgreich plausibilisiert.
|
||||
* Unterstützung für "Actions"?
|
||||
* Verhaltenssteuerung: Im Request kann ein Profil vorgegeben werden. Im Response wird angegeben, ob es berücksichtigt werden konnte, oder Fallbackverhalten.
|
||||
* Basic - nur Fehlermeldungen, Baum wird nie verändert
|
||||
* Advanced - Fehlermeldungen und Änderungen im Baum (z.B. Anlage von Default-Elementen). Das Verhalten im Baum ist normiert.
|
||||
* Freestyle - Server reagiert innerhalb der vorgegebenen Möglichkeiten, wie er es an der Stelle für richtig hält. Sprich der
|
||||
Produktentwickler legt dies fest und kann das für Bausteine und Attribute festlegen.
|
||||
* Actions - es werden Actions angeboten, um Korrekturen im Baum vorzunehmen.
|
||||
|
||||
## Fälle Bausteine
|
||||
|
||||
### Fehler Code
|
||||
+ 1: Wo ist der Fehler aufgetreten (C → Client)
|
||||
+ 1: Anfangsbuchstabe der operation (Fehler bei Calculate → Code beginnt mit C)
|
||||
+ 2: Fehler Art (0 → XML Fehler)
|
||||
+ 3: Fehler Kategorie (0 → Ungültiger Baustein)
|
||||
+ 4 & 5: Spezifischer Fehler (01 → Baustein kommt zu häufig vor)
|
||||
### Fehler Level
|
||||
+ 1: FATAL
|
||||
+ 2: ERROR
|
||||
+ 3: WARNING
|
||||
Der Client schickt einen Unbekannten Baustein. Der Server gibt eine Fehlermeldung zurück.
|
||||
Der Client schickt einen Baustein mit einem fehlerhaften Attribut. Der Server gibt eine Fehlermeldung zurück.
|
||||
Der Server schickt einen ungültigen Baustein. Der Server gibt eine Fehlermeldung zurück.
|
||||
|
||||
|
||||
## Verhalten
|
||||
Der Client schickt zu viele von einem Baustein. Der Server könnte:
|
||||
1) Den Baustein Inaktiv setzen
|
||||
2) Den Baustein ausbessern
|
||||
3) Den Baustein entfernen
|
||||
Der Client schickt zu viele von einem Baustein. A priori erstmal ausgeschlossen, da der
|
||||
Client über Produktwissen verfügt. Über Plausis in der Instanz kann der Fall trotzdem eintreten.
|
||||
Der Server könnte:
|
||||
1) Fehlermeldung in Oberbaustein senden
|
||||
2) Die überzähligen Bausteine auf Inaktiv setzen und mit Fehler markieren
|
||||
3) Den überzähligen Baustein / die überzähligen Bausteine entfernen
|
||||
|
||||
Der Client schickt zu wenig von einem Baustein. Der Server könnte:
|
||||
1) Einen Default Baustein hinzufügen
|
||||
2) Eine Meldung über den Parent mitgeben
|
||||
|
||||
Der Client schickt einen Unbekannten Baustein. Der Server könnte:
|
||||
1) Den Unbekannten Baustein Inaktiv wieder mitgeben
|
||||
2) Den Unbekannten Baustein entfernen
|
||||
3) Einen ähnlichen Baustein suchen und hinzufügen
|
||||
|
||||
Der Client schickt einen Baustein mit einem fehlerhaften Attribut. Der Server könnte:
|
||||
1) Das Default Attribut hinzufügen
|
||||
2) Den Baustein inaktiv setzen
|
||||
3) Das Attribut entfernen
|
||||
1) Einen Default Baustein (mehrere Default-Bausteine) hinzufügen (er kann dabei die Daten des Requests in den
|
||||
Vorschlag einfließen lassen, was der Client nicht kann)
|
||||
2) Eine Meldung über den Parent mitgeben, der Client ist dann zuständig den Baustein anzulegen.
|
||||
|
||||
Der Client schickt Bausteine, die sich wiedersprechen. Der Server könnte:
|
||||
1) Einen Priorisieren und den anderen Inaktiv setzen.
|
||||
2) Beide Inaktiv setzen
|
||||
1) Fehlermeldung und beide belassen
|
||||
2) Fehlermeldung und einen priorisieren und den anderen inaktiv setzen.
|
||||
3) Fehlermeldung und beide inaktiv setzen
|
||||
|
||||
Der Client schickt einen Baustein in einem falschen Kontext. Der Server könnte:
|
||||
1) Den Baustein dem richtigen Kontext zuordnen
|
||||
2) Den Baustein Inaktiv setzen
|
||||
|
||||
Der Server schickt einen ungültigen Baustein. Der Client könnte:
|
||||
1) Den Tree Inaktiv setzen
|
||||
2) Den Baustein Inaktiv setzen
|
||||
3) Den Baustein weglassen
|
||||
2) Den Baustein inaktiv setzen
|
||||
|
||||
|
||||
## Fälle Attribute
|
||||
|
||||
Attribut unbekannt - sollte gar nicht auftreten, muss nicht inhaltlich behandelt werden
|
||||
|
||||
Wert in Attribut ungültig - Attribut behält den falschen Wert, wird aber mit Fehlermeldung zurückgegeben.
|
||||
|
||||
Kardinalität Attribut überschritten:
|
||||
1) Fehler an Baustein
|
||||
2) Fehler an überzähligen Attributen
|
||||
|
||||
Kardinalität Attribut unterschritten:
|
||||
1) Fehler an Baustein aber keine automatische Ergänzung
|
||||
2) Hinweis an Baustein, Ergänzen der fehlenden Attribute mit Defaultwerten.
|
||||
|
||||
|
||||
|
||||
@@ -7,8 +7,12 @@ import javafx.scene.control.CheckBox;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.TreeItem;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.paint.Paint;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.scene.text.FontWeight;
|
||||
import javafx.scene.text.Text;
|
||||
import javafx.util.Duration;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -27,6 +31,32 @@ public class ItemAttribute {
|
||||
}
|
||||
|
||||
public VBox addItemInfo(TreeItem<Object> newSelection, VBox attributBox) {
|
||||
if (((ProduktbausteinType)newSelection.getValue()).getMeldungen() != null && !((ProduktbausteinType)newSelection.getValue()).getMeldungen().isEmpty()){
|
||||
attributBox.getChildren().removeIf(n -> n.getId().equals("faultsbox"));
|
||||
|
||||
VBox faultsBox = new VBox();
|
||||
for (ServiceFault sf : ((ProduktbausteinType)newSelection.getValue()).getMeldungen()) {
|
||||
HBox singleFaultBox = new HBox();
|
||||
singleFaultBox.setPadding(new Insets(10));
|
||||
|
||||
Text symbole = new Text("\u26A0 ");
|
||||
symbole.setFont(Font.font("System", FontWeight.BOLD, symbole.getFont().getSize() + 2));
|
||||
|
||||
|
||||
if (sf.getErrorType().equals(BigInteger.ONE)){
|
||||
symbole.setFill(Paint.valueOf("#aa3333"));
|
||||
} else if (sf.getErrorType().equals(BigInteger.TWO)) {
|
||||
symbole.setFill(Paint.valueOf("#ccbb00"));
|
||||
}
|
||||
Label errorText = new Label(sf.getErrorMsg() + System.lineSeparator());
|
||||
|
||||
singleFaultBox.getChildren().addAll(symbole, errorText);
|
||||
faultsBox.getChildren().add(singleFaultBox);
|
||||
}
|
||||
|
||||
attributBox.getChildren().addFirst(faultsBox);
|
||||
}
|
||||
|
||||
for(int j = 0; j < ((ProduktbausteinType)newSelection.getValue()).getAttribute().size(); j++) {
|
||||
VBox singleAttributBox = new VBox();
|
||||
singleAttributBox.setPadding(new Insets(10));
|
||||
@@ -281,33 +311,33 @@ public class ItemAttribute {
|
||||
|
||||
attributBox.getChildren().add(singleAttributBox);
|
||||
|
||||
if (((ProduktbausteinType)newSelection.getValue()).getMeldungen() != null
|
||||
&& !((ProduktbausteinType)newSelection.getValue()).getMeldungen().isEmpty()) {
|
||||
((ProduktbausteinType)newSelection.getValue()).getMeldungen().forEach(n -> {
|
||||
VBox meldung = new VBox();
|
||||
|
||||
Label code = new Label();
|
||||
Label text = new Label();
|
||||
Label ref = new Label();
|
||||
|
||||
if (n.getErrorCode() != null) {code = new Label("Error Code: " + n.getErrorCode().toString());}
|
||||
if (n.getErrorMsg() != null) {text = new Label(n.getErrorMsg());}
|
||||
if (n.getElementReference() != null) {ref = new Label(n.getElementReference());}
|
||||
|
||||
if (n.getErrorType().equals(BigInteger.ONE)){
|
||||
code.setStyle("-fx-text-fill: red;");
|
||||
text.setStyle("-fx-text-fill: red;");
|
||||
ref.setStyle("-fx-text-fill: red;");
|
||||
}else if (n.getErrorType().equals(BigInteger.TWO)){
|
||||
code.setStyle("-fx-text-fill: #bbbb00;");
|
||||
text.setStyle("-fx-text-fill: #bbbb00;");
|
||||
ref.setStyle("-fx-text-fill: #bbbb00;");
|
||||
}
|
||||
|
||||
meldung.getChildren().addAll(code, text, ref);
|
||||
attributBox.getChildren().add(meldung);
|
||||
});
|
||||
}
|
||||
// if (((ProduktbausteinType)newSelection.getValue()).getMeldungen() != null
|
||||
// && !((ProduktbausteinType)newSelection.getValue()).getMeldungen().isEmpty()) {
|
||||
// ((ProduktbausteinType)newSelection.getValue()).getMeldungen().forEach(n -> {
|
||||
// VBox meldung = new VBox();
|
||||
//
|
||||
// Label code = new Label();
|
||||
// Label text = new Label();
|
||||
// Label ref = new Label();
|
||||
//
|
||||
// if (n.getErrorCode() != null) {code = new Label("Error Code: " + n.getErrorCode().toString());}
|
||||
// if (n.getErrorMsg() != null) {text = new Label(n.getErrorMsg());}
|
||||
// if (n.getElementReference() != null) {ref = new Label(n.getElementReference());}
|
||||
//
|
||||
// if (n.getErrorType().equals(BigInteger.ONE)){
|
||||
// code.setStyle("-fx-text-fill: red;");
|
||||
// text.setStyle("-fx-text-fill: red;");
|
||||
// ref.setStyle("-fx-text-fill: red;");
|
||||
// }else if (n.getErrorType().equals(BigInteger.TWO)){
|
||||
// code.setStyle("-fx-text-fill: #bbbb00;");
|
||||
// text.setStyle("-fx-text-fill: #bbbb00;");
|
||||
// ref.setStyle("-fx-text-fill: #bbbb00;");
|
||||
// }
|
||||
//
|
||||
// meldung.getChildren().addAll(code, text, ref);
|
||||
// attributBox.getChildren().add(meldung);
|
||||
// });
|
||||
// }
|
||||
|
||||
}
|
||||
return attributBox;
|
||||
|
||||
@@ -46,6 +46,8 @@ public class BuildCalculateRequestAuskunft {
|
||||
baustein.setVerkaufsoffenBis(((ProduktbausteinType)treeItem.getValue()).getVerkaufsoffenBis());
|
||||
baustein.getAttribute().addAll(((ProduktbausteinType)treeItem.getValue()).getAttribute());
|
||||
baustein.setTyp(((ProduktbausteinType)treeItem.getValue()).getTyp());
|
||||
baustein.setMinVorkommen(((ProduktbausteinType)treeItem.getValue()).getMinVorkommen());
|
||||
baustein.setMaxVorkommen(((ProduktbausteinType)treeItem.getValue()).getMaxVorkommen());
|
||||
|
||||
return baustein;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user