diff --git a/OMDSServiceDefinition/pom.xml b/OMDSServiceDefinition/pom.xml
index 538e62da..418801f4 100644
--- a/OMDSServiceDefinition/pom.xml
+++ b/OMDSServiceDefinition/pom.xml
@@ -15,7 +15,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
yyyyMMdd
${maven.build.timestamp}
- 17
+ 21
@@ -32,11 +32,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
3.12.1
- org.apache.maven.plugins
- maven-assembly-plugin
- 3.7.1
-
-
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 3.7.1
+
+
org.apache.maven.plugins
maven-javadoc-plugin
3.6.3
@@ -45,123 +45,130 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
-
- org.apache.maven.plugins
- maven-assembly-plugin
-
-
- assembly.xml
-
-
-
-
- make-assembly
- install
-
- single
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- 2.3.1
-
-
- false
-
- true
-
-
-
-
- ${maven.build.timestamp}
- ${maven.compiler.release}
-
-
-
-
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+
+
+ assembly.xml
+
+
+
+
+ make-assembly
+ install
+
+ single
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 2.3.1
+
+
+ false
+
+ true
+
+
+
+
+ ${maven.build.timestamp}
+ ${maven.compiler.release}
+
+
+
+
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 2.19.1
-
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.19.1
+
-
- org.apache.maven.plugins
- maven-source-plugin
-
-
- attach sources
-
- jar
-
-
-
-
+
+ org.apache.maven.plugins
+ maven-source-plugin
+
+
+ attach sources
+
+ jar
+
+
+
+
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
- reference
-
-
-
- attach-javadocs
-
- jar
-
-
-
-
-
-
-
- org.jvnet.jaxb
- jaxb-maven-plugin
- 4.0.0
-
-
-
- generate
-
-
-
-
- true
- en
- XMLSCHEMA
- ${project.basedir}/src/main/resources/def/${currentReleaseDir}
- ${project.basedir}/src/main/resources/def/${currentReleaseDir}
- ${project.basedir}/src/main/resources/def/${currentReleaseDir}
-
- *.xsd
-
-
- *.xjb
-
-
- -Xannotate
- -Xinheritance
-
-
-
- org.jvnet.jaxb
- jaxb-plugins
- 3.0.0
-
-
- org.jvnet.jaxb
- jaxb-plugin-annotate
- 3.0.0
-
-
-
-
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+ reference
+
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+
+ org.jvnet.jaxb
+ jaxb-maven-plugin
+ 4.0.0
+
+
+
+ generate
+
+
+
+
+ true
+ en
+ XMLSCHEMA
+ ${project.basedir}/src/main/resources/def/${currentReleaseDir}
+ ${project.basedir}/src/main/resources/def/${currentReleaseDir}
+ ${project.basedir}/src/main/resources/def/${currentReleaseDir}
+
+ *.xsd
+
+
+ *.xjb
+
+
+ -Xannotate
+ -Xinheritance
+
+
+
+ org.jvnet.jaxb
+ jaxb-plugins
+ 3.0.0
+
+
+ org.jvnet.jaxb
+ jaxb-plugin-annotate
+ 3.0.0
+
+
+
+
+
+ org.openjfx
+ javafx-maven-plugin
+ 0.0.8
+
+ ${project.basedir}/src/main/java/at/vvo/omds/client/gui/AllinOneView.java
+
+
@@ -195,6 +202,15 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
4.0.5
+
+
+
+ org.openjfx
+ javafx-controls
+ 23.0.1
+
+
+
@@ -219,6 +235,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
2.0.16
test
+
+
+ org.slf4j
+ slf4j-simple
+ 2.0.16
+ runtime
+
diff --git a/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/api/CommonRequest.java b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/api/CommonRequest.java
new file mode 100644
index 00000000..a186b716
--- /dev/null
+++ b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/api/CommonRequest.java
@@ -0,0 +1,7 @@
+package at.vvo.omds.client.api;
+
+public interface CommonRequest {
+
+ /// Liefert die KorrelationsId eines Requests
+ String getKorrelationsId();
+}
diff --git a/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/api/ProduktbausteinInterface.java b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/api/ProduktbausteinInterface.java
new file mode 100644
index 00000000..74ded996
--- /dev/null
+++ b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/api/ProduktbausteinInterface.java
@@ -0,0 +1,24 @@
+package at.vvo.omds.client.api;
+
+import javax.xml.datatype.XMLGregorianCalendar;
+
+public interface ProduktbausteinInterface {
+ String getId();
+ void setId(String id);
+
+ String getName();
+ void setName(String name);
+
+ XMLGregorianCalendar getFrom();
+ void setFrom(XMLGregorianCalendar from);
+
+ XMLGregorianCalendar getTo();
+ void setTo(XMLGregorianCalendar to);
+
+ int getMinOccurrences();
+ void setMinOccurrences(int minOccurrences);
+
+ Integer getMaxOccurrences();
+ void setMaxOccurrences(Integer maxOccurrences);
+
+}
diff --git a/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/api/VerkaufsproduktInterface.java b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/api/VerkaufsproduktInterface.java
new file mode 100644
index 00000000..a035d45b
--- /dev/null
+++ b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/api/VerkaufsproduktInterface.java
@@ -0,0 +1,11 @@
+package at.vvo.omds.client.api;
+
+import javax.xml.datatype.XMLGregorianCalendar;
+
+/// Ein Verkaufsprodukt muss a priori liefern können, ab wann es verkauft werden darf.
+public interface VerkaufsproduktInterface extends ProduktbausteinInterface {
+
+// XMLGregorianCalendar getVtgbeg();
+//
+// void setVtgbeg(XMLGregorianCalendar value);
+}
diff --git a/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/AllinOneView.java b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/AllinOneView.java
new file mode 100644
index 00000000..3c456a12
--- /dev/null
+++ b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/AllinOneView.java
@@ -0,0 +1,669 @@
+package at.vvo.omds.client.gui;
+
+import at.vvo.omds.client.gui.api.apriori.AprioriAuskunftService;
+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 javafx.application.Application;
+import javafx.geometry.Insets;
+import javafx.geometry.Pos;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.image.Image;
+import javafx.scene.layout.*;
+import javafx.scene.paint.Paint;
+import javafx.scene.text.*;
+import javafx.stage.Stage;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+import java.math.BigInteger;
+import java.time.LocalDateTime;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicReference;
+
+public class AllinOneView extends Application {
+
+ Map timesItemisIncludedById = new HashMap<>();
+ List> isNotIncluded = new ArrayList<>();
+ Map, Map> infoBoxFromItem = new HashMap<>();
+
+ TextFlow logFlow = new TextFlow();
+ TreeHelper treeHelper = new TreeHelper();
+
+ public static void main(String[] args) {
+ launch(args);
+ }
+
+ @Override
+ public void start(Stage stage) {
+ AprioriAuskunftService s = new AprioriAuskunftService(new SOAPConnector());
+
+ stage.setTitle("OMDS Client");
+ stage.getIcons().add(new Image(AllinOneView.class.getResourceAsStream("/logo/VVO_Logo_2024.png")));
+
+ final VBox[] controlBox = {new VBox()};
+ DatePicker dp = new DatePicker();
+ ChoiceBox vpBox = new ChoiceBox<>();
+
+ vpBox.setValue("Verkaufsprodukt auswählen ");
+ vpBox.setVisible(false);
+ vpBox.setPadding(new Insets(0, 10, 0, 0));
+
+ AtomicReference stichtag = new AtomicReference<>();
+ AtomicReference response = new AtomicReference<>();
+ Button newCalcRequestButton = new Button("Calculate");
+ HBox newCalcRequestControlBox = new HBox();
+ newCalcRequestControlBox.setVisible(false);
+ newCalcRequestControlBox.setPadding(new Insets(10, 10, 10, 10));
+ newCalcRequestControlBox.getChildren().add(newCalcRequestButton);
+ dp.setOnAction(e -> {
+ try {
+ stichtag.set(stichtagEvent(dp));
+ if (stichtagEvent(dp) != null) {
+ try {
+ response.set(s.aprioriAuskunft(stichtag.get(), "042"));
+ } catch (NoSuchElementException ex) {
+ logFlow.getChildren().add(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());
+ }
+ newCalcRequestControlBox.setVisible(true);
+
+ if (response.get().getVerkaufsprodukt().size() > 1) {
+
+ if (!vpBox.getItems().isEmpty()) {
+ vpBox.getItems().clear();
+ }
+ for (APrioriVerkaufsproduktType vp : response.get().getVerkaufsprodukt()) {
+ vpBox.getItems().add(vp.getName());
+ }
+ vpBox.setVisible(true);
+ vpBox.setOnAction(ee -> {
+ for (int i = 0; i < response.get().getVerkaufsprodukt().size(); i++) {
+ if (vpBox.getSelectionModel().getSelectedItem() != null && vpBox.getSelectionModel()
+ .getSelectedItem().equals(response.get().getVerkaufsprodukt().get(i).getName())) {
+ try {
+ controlBox[0] = buttonAuskunft(response.get().getVerkaufsprodukt().get(i),
+ controlBox[0], newCalcRequestButton, stichtag);
+ controlBox[0].getChildren().add(newCalcRequestControlBox);
+
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ }
+ });
+ } else {
+ controlBox[0] = buttonAuskunft(response.get().getVerkaufsprodukt().getFirst(),
+ controlBox[0], newCalcRequestButton, stichtag);
+ }
+ if (!controlBox[0].getChildren().contains(newCalcRequestControlBox)) {
+ controlBox[0].getChildren().add(newCalcRequestControlBox);
+ }
+ } else {
+ Alert alert = new Alert(Alert.AlertType.ERROR);
+ alert.setTitle("Error");
+ alert.setHeaderText("Invalid Date");
+ alert.showAndWait();
+ }
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+
+ });
+
+ VBox.setVgrow(newCalcRequestControlBox, Priority.ALWAYS);
+ newCalcRequestControlBox.setAlignment(Pos.BOTTOM_RIGHT);
+
+ HBox aprioriControlBox = new HBox();
+ aprioriControlBox.setPadding(new Insets(10, 10, 0, 10));
+ aprioriControlBox.getChildren().addAll(dp, vpBox);
+ controlBox[0].getChildren().addAll(aprioriControlBox);
+
+ Scene scene = new Scene(controlBox[0], 900, 700);
+ stage.setScene(scene);
+
+ stage.show();
+ }
+
+
+ public XMLGregorianCalendar stichtagEvent(DatePicker dp) throws DatatypeConfigurationException {
+ if (dp.getValue() == null) {
+ return null;
+ }
+ int day = dp.getValue().getDayOfMonth();
+ int month = dp.getValue().getMonthValue();
+ int year = dp.getValue().getYear();
+
+ return DatatypeFactory.newInstance().newXMLGregorianCalendarDate(year, month, day, 0);
+ }
+
+ public VBox buttonAuskunft(APrioriVerkaufsproduktType verkaufsprodukt, VBox vbox, Button newCalcRequest,
+ AtomicReference stichtag) throws Exception {
+ while (vbox.getChildren().size() > 1) {
+ vbox.getChildren().removeLast();
+ }
+
+ VBox treeBox = new VBox();
+ VBox infoBox = new VBox();
+
+ ScrollPane logPane = new ScrollPane(logFlow);
+
+ if (!logFlow.getChildren().isEmpty()) treeHelper.setLogFlow(logFlow);
+ TreeItem vkp = treeHelper.aprioriItemToCalcItem(new TreeItem<>(verkaufsprodukt));
+ vkp.setExpanded(true);
+
+ treeHelper.messageToTree(verkaufsprodukt, vkp);
+
+ logFlow = treeHelper.getLogFlow();
+
+ TreeView tv = new TreeView<>(vkp);
+
+ tv.getSelectionModel().selectedItemProperty().addListener((obs, oldSelection, newSelection) -> {
+ if (newSelection != null) {
+ if (!infoBox.getChildren().isEmpty()) {
+ infoBox.getChildren().removeAll(infoBox.getChildren());
+ }
+
+ ItemAttribute itemAttribute = new ItemAttribute();
+ if (!infoBoxFromItem.isEmpty()) itemAttribute.setInfoBoxFromItem(infoBoxFromItem);
+ itemAttribute.addItemInfo(newSelection, infoBox);
+ infoBoxFromItem = itemAttribute.getInfoBoxFromItem();
+// addItemInfo(newSelection, infoBox);
+ System.out.println(newSelection.getValue().getClass().getName());
+ }
+
+ });
+
+ final TreeItem originalRoot = treeHelper.cloneTreeItem(tv.getRoot());
+ tv.setCellFactory(tc -> new TreeCell<>() {
+ @Override
+ public void updateItem(Object item, boolean empty) {
+ super.updateItem(item, empty);
+
+ if (item == null || empty) {
+ setText(null);
+ setGraphic(null);
+ } else {
+ HBox cellBox = new HBox();
+ Button include = new Button("+");
+ include.setStyle("-fx-margin: 5;");
+ Label label = new Label(((ProduktbausteinType) item).getBezeichnung() + " ");
+ Button remove = new Button("-");
+
+ remove.setVisible(true);
+ remove.setFont(Font.font("System", FontWeight.BOLD, include.getFont().getSize() + 2));
+ remove.setPadding(new Insets(0, 5, 0, 5));
+
+ include.setFont(Font.font("System", FontWeight.BOLD, include.getFont().getSize() + 2));
+ include.setPadding(new Insets(0, 5, 0, 5));
+
+ if (!shouldBeIncluded(getTreeItem())) {
+ label.setFont(Font.font("System", FontPosture.ITALIC, label.getFont().getSize()));
+ label.setTextFill(Paint.valueOf("#A0A0A0"));
+ if (!isNotIncluded.contains(getTreeItem())) {
+ isNotIncluded.add(getTreeItem());
+ }
+ remove.setDisable(true);
+ remove.setStyle("-fx-background-color: #CCCCCC");
+ } else {
+ label.setTextFill(Paint.valueOf("#000000"));
+ remove.setVisible(true);
+
+ isNotIncluded.remove(getTreeItem());
+ }
+
+ Region spacer = new Region();
+ HBox.setHgrow(spacer, Priority.ALWAYS);
+ Label spacer2 = new Label(" ");
+
+ label.setMaxWidth(Double.MAX_VALUE);
+
+ if (getTreeItem().getValue().getClass().equals(VerkaufsproduktType.class) ||
+ getTreeItem().getValue().getClass().equals(APrioriVerkaufsproduktType.class)) {
+ cellBox.getChildren().addAll(label);
+ } else if (timesItemisIncludedById.get(
+ ((ProduktbausteinType) getTreeItem().getValue()).getId()) != null
+ && ((ProduktbausteinType) getTreeItem().getValue()).getMaxVorkommen() ==
+ timeItemIsIncludedByParent(getTreeItem().getParent(),
+ ((ProduktbausteinType) getTreeItem().getValue()).getId())) {
+ include.setDisable(true);
+ include.setStyle("-fx-background-color: #CCCCCC");
+ cellBox.getChildren().addAll(label, spacer, include, spacer2, remove);
+ } else {
+ cellBox.getChildren().addAll(label, spacer, include, spacer2, remove);
+ }
+
+
+ include.setOnAction(e -> {
+ if (isNotIncluded.contains(getTreeItem())) {
+ label.setFont(Font.font("System", label.getFont().getSize()));
+ label.setTextFill(Paint.valueOf("#000000"));
+ remove.setVisible(true);
+
+ timesItemisIncludedById.put(((ProduktbausteinType) getTreeItem().getValue()).getId(),
+ (timesItemisIncludedById.get(
+ ((ProduktbausteinType) getTreeItem().getValue()).getId()) != null ?
+ timesItemisIncludedById.get(
+ ((ProduktbausteinType) getTreeItem().getValue()).getId()) + 1 : 1));
+
+ isNotIncluded.remove(getTreeItem());
+ includeAddedParent(getTreeItem());
+ includeAddedChildren(getTreeItem());
+ tv.setRoot(treeHelper.sortTree(tv.getRoot()));
+ tv.refresh();
+
+ timesItemisIncludedById.clear();
+ refreshTimesItemisIncludedById(tv.getRoot());
+ } else {
+ TreeItem parent = getTreeItem().getParent();
+ TreeItem clone =
+ null;
+ try {
+ clone = treeHelper.cloneTreeItem(
+ treeHelper.findTreeItem((ProduktbausteinType) item, originalRoot));
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ parent.getChildren().add(clone);
+
+ refreshIsNotIncluded(clone, originalRoot);
+
+ timesItemisIncludedById.clear();
+ refreshTimesItemisIncludedById(tv.getRoot());
+
+ tv.setRoot(treeHelper.sortTree(tv.getRoot()));
+ tv.refresh();
+ }
+ });
+
+ remove.setOnAction(e -> {
+ Map countByParent = new HashMap<>();
+ Map countByAprioriParent = new HashMap<>();
+ timesItemisIncludedById.clear();
+ refreshTimesItemisIncludedById(tv.getRoot());
+ timesItemisIncludedById.replace(((ProduktbausteinType) item).getId(),
+ timesItemisIncludedById.get(((ProduktbausteinType) item).getId()) - 1);
+
+ if (countChildIds(countByParent, getTreeItem().getParent()).get
+ (((ProduktbausteinType) item).getId()).equals(countChildIds(countByAprioriParent,
+ treeHelper.findTreeItem(((ProduktbausteinType) item), originalRoot).getParent()).get(
+ ((ProduktbausteinType) item).getId()))) {
+ label.setFont(Font.font("System", label.getFont().getSize()));
+ label.setTextFill(Paint.valueOf("#A0A0A0"));
+ remove.setVisible(false);
+
+ isNotIncluded.add(getTreeItem());
+ includeAddedChildren(getTreeItem());
+
+ tv.setRoot(treeHelper.sortTree(tv.getRoot()));
+ tv.refresh();
+ } else {
+ getTreeItem().getParent().getChildren().remove((getTreeItem()));
+ }
+ timesItemisIncludedById.clear();
+ refreshTimesItemisIncludedById(tv.getRoot());
+ });
+ setGraphic(cellBox);
+ setText(null);
+ }
+ }
+ });
+
+ newCalcRequest.setOnAction(e -> {
+ try {
+ treeHelper.setIsNotIncluded(isNotIncluded);
+ TreeItem cleanedRoot = treeHelper.cleanTree(tv.getRoot());
+
+ CalculateRequestAuskunftService s = new CalculateRequestAuskunftService(new SOAPConnector());
+ CalculateResponse calcResponse = s.aprioriAuskunft(new TreeView<>(cleanedRoot), stichtag.get());
+ TreeItem newRoot = new TreeItem<>(cleanedRoot.getValue());
+ treeHelper.setTimesItemisIncludedById(timesItemisIncludedById);
+ treeHelper.calcMessageToTree(calcResponse.getBerechnungsantwort().getVerkaufsprodukt(), newRoot);
+ timesItemisIncludedById = treeHelper.getTimesItemisIncludedById();
+ newRoot.setExpanded(true);
+ isNotIncluded.clear();
+ if (calcResponse.getBerechnungsantwort().getVerkaufsprodukt().getMeldungen() == null ||
+ calcResponse.getBerechnungsantwort().getVerkaufsprodukt().getMeldungen().isEmpty()) {
+
+ 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());
+
+ }
+ tv.refresh();
+
+ for (int j = 0; j < calcResponse.getBerechnungsantwort().getVerkaufsprodukt().getMeldungen().size(); j++) {
+ Text text = new Text(LocalDateTime.now() + " :"
+ + calcResponse.getBerechnungsantwort().getVerkaufsprodukt().getMeldungen().get(j).getErrorMsg()
+ + System.lineSeparator());
+
+ if (calcResponse.getBerechnungsantwort().getVerkaufsprodukt().getMeldungen().get(j).getErrorType()
+ .equals(BigInteger.ONE)) {
+ text.setFill(Paint.valueOf("#dd0000"));
+ } else if (calcResponse.getBerechnungsantwort().getVerkaufsprodukt().getMeldungen().get(j).getErrorType()
+ .equals(BigInteger.TWO)) {
+ text.setFill(Paint.valueOf("#bbbb00"));
+ } else {
+ text.setFill(Paint.valueOf("#000000"));
+ }
+
+ logFlow.getChildren().add(text);
+ }
+
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ });
+
+
+ if (!treeBox.getChildren().isEmpty()) {
+ treeBox.getChildren().clear();
+ }
+
+ tv.setRoot(treeHelper.sortTree(tv.getRoot()));
+
+ VBox.setVgrow(tv, Priority.ALWAYS);
+ tv.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
+ tv.setStyle("-fx-border-color: white;");
+
+ treeBox.getChildren().add(tv);
+ treeBox.setPadding(new Insets(10));
+ treeBox.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
+ HBox.setHgrow(treeBox, Priority.ALWAYS);
+ treeBox.setStyle("-fx-border-color: black; -fx-background-color: white");
+
+ infoBox.setStyle("-fx-border-color: black; -fx-background-color: white");
+ infoBox.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
+ HBox.setHgrow(infoBox, Priority.ALWAYS);
+
+ HBox splitBox = new HBox(treeBox, infoBox);
+ splitBox.setSpacing(10);
+ splitBox.setPadding(new Insets(20));
+ splitBox.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
+
+ VBox wrapper = new VBox(splitBox);
+ wrapper.setAlignment(Pos.CENTER);
+ VBox.setVgrow(splitBox, Priority.ALWAYS);
+
+ HBox logWrapper = new HBox();
+ logWrapper.setPadding(new Insets(0, 20, 20, 20)); // Abstand zum Rand unten + Seite
+ logWrapper.setAlignment(Pos.CENTER_LEFT);
+ logWrapper.setMaxWidth(Double.MAX_VALUE);
+
+ logFlow.setDisable(true);
+ logFlow.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
+ logFlow.setPadding(new Insets(20));
+ 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);
+
+ vbox.getChildren().addAll(wrapper, logWrapper);
+ VBox.setVgrow(wrapper, Priority.ALWAYS);
+
+ return vbox;
+ }
+
+// private TreeItem cleanTree(TreeItem original) {
+// if (isNotIncluded.contains(original)) {
+// return null;
+// }
+//
+// TreeItem newItem = new TreeItem<>(original.getValue());
+// for (TreeItem child : original.getChildren()) {
+// TreeItem cleanedChild = cleanTree(child);
+// if (cleanedChild != null) {
+// newItem.getChildren().add(cleanedChild);
+// }
+// }
+// return newItem;
+// }
+
+ private void includeAddedParent(TreeItem treeItem) {
+ if (treeItem.getParent() != null) {
+ isNotIncluded.remove(treeItem.getParent());
+ if (treeItem.getParent().getParent() != null) {
+ includeAddedParent(treeItem.getParent());
+ }
+ }
+ }
+
+ private void includeAddedChildren(TreeItem parent) {
+ for (int i = 0; i < parent.getChildren().size(); i++) {
+ isNotIncluded.remove(parent.getChildren().get(i));
+
+ if (!shouldBeIncluded(parent.getChildren().get(i)) && !isNotIncluded.contains(parent.getChildren().get(i))) {
+ isNotIncluded.add(parent.getChildren().get(i));
+ } else {
+ isNotIncluded.remove(parent.getChildren().get(i));
+ }
+
+ if (!parent.getChildren().get(i).getChildren().isEmpty() && parent.getChildren().get(i).getChildren() != null) {
+ includeAddedChildren(parent.getChildren().get(i));
+ }
+ }
+ }
+
+ private void refreshIsNotIncluded(TreeItem clone, TreeItem originalRoot) {
+ for (int i = 0; i < clone.getChildren().size(); i++) {
+ if (isNotIncluded.contains(treeHelper.findTreeItem(
+ ((ProduktbausteinType) clone.getChildren().get(i).getValue()), originalRoot)) ||
+ ((ProduktbausteinType) clone.getChildren().get(i).getValue()).getMinVorkommen() == 0) {
+ isNotIncluded.add(clone.getChildren().get(i));
+ }
+ if (clone.getChildren().get(i).getChildren() != null || !clone.getChildren().get(i).getChildren().isEmpty()) {
+ refreshIsNotIncluded(clone.getChildren().get(i), originalRoot);
+ }
+ }
+ }
+
+ private boolean shouldBeIncluded(TreeItem treeItem) {
+ return !((isNotIncluded.contains(treeItem.getParent()) || isNotIncluded.contains(treeItem) ||
+ (((ProduktbausteinType) treeItem.getValue()).getMinVorkommen() == 0 &&
+ (timesItemisIncludedById.get(((ProduktbausteinType) treeItem.getValue()).getId()) == null ||
+ timesItemisIncludedById.get(((ProduktbausteinType) treeItem.getValue()).getId()) == 0))) &&
+ !(treeItem.getValue() instanceof VerkaufsproduktType));
+ }
+
+ private Map countChildIds(Map count, TreeItem root) {
+ if (root != null) {
+ for (int i = 0; i < root.getChildren().size(); i++) {
+ TreeItem item = root.getChildren().get(i);
+
+ if (count.get(((ProduktbausteinType) item.getValue()).getId()) == null) {
+ count.put(((ProduktbausteinType) item.getValue()).getId(), 1);
+ } else {
+ count.replace(((ProduktbausteinType) item.getValue()).getId(),
+ count.get(((ProduktbausteinType) item.getValue()).getId()) + 1);
+ }
+
+ if (!item.getChildren().isEmpty()) {
+ countChildIds(count, item);
+ }
+ }
+ }
+ return count;
+
+ }
+
+ private void refreshTimesItemisIncludedById(TreeItem root) {
+ for (int i = 0; i < root.getChildren().size(); i++) {
+ TreeItem item = root.getChildren().get(i);
+ if (!isNotIncluded.contains(item)) {
+ if (timesItemisIncludedById.get(((ProduktbausteinType) item.getValue()).getId()) == null) {
+ timesItemisIncludedById.put(((ProduktbausteinType) item.getValue()).getId(), 1);
+ } else {
+ timesItemisIncludedById.replace(((ProduktbausteinType) item.getValue()).getId(),
+ timesItemisIncludedById.get(((ProduktbausteinType) item.getValue()).getId()) + 1);
+ }
+ }
+ if (!item.getChildren().isEmpty()) {
+ refreshTimesItemisIncludedById(item);
+ }
+ }
+ }
+
+ public int timeItemIsIncludedByParent(TreeItem parent, String itemId) {
+ int erg = 0;
+ for (int i = 0; i < parent.getChildren().size(); i++) {
+ TreeItem item = parent.getChildren().get(i);
+ if (((ProduktbausteinType) item.getValue()).getId().equals(itemId)) {
+ if (!isNotIncluded.contains(item)) {
+ erg++;
+ }
+ }
+
+ }
+
+ return erg;
+ }
+
+// private TreeItem cloneTreeItem(TreeItem original) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
+// Object cloneOriginalValue;
+//
+// cloneOriginalValue = new ObjectFactoryFactory().create(((ProduktbausteinType) original.getValue()).getType());
+//
+// ((ProduktbausteinType) cloneOriginalValue).setId(((ProduktbausteinType) original.getValue()).getId());
+// ((ProduktbausteinType) cloneOriginalValue).setBezeichnung(((ProduktbausteinType) original.getValue()).getBezeichnung());
+// ((ProduktbausteinType) cloneOriginalValue).setFrom(((ProduktbausteinType) original.getValue()).getFrom());
+// ((ProduktbausteinType) cloneOriginalValue).setTo(((ProduktbausteinType) original.getValue()).getTo());
+// ((ProduktbausteinType) cloneOriginalValue).getAttribute().addAll(((ProduktbausteinType) original.getValue()).getAttribute());
+// ((ProduktbausteinType) cloneOriginalValue).getMeldungen().addAll(((ProduktbausteinType) original.getValue()).getMeldungen());
+// ((ProduktbausteinType) cloneOriginalValue).setMinOccurrences(((ProduktbausteinType) original.getValue()).getMinOccurrences());
+// ((ProduktbausteinType) cloneOriginalValue).setMaxOccurrences(((ProduktbausteinType) original.getValue()).getMaxOccurrences());
+// ((ProduktbausteinType) cloneOriginalValue).setType(((ProduktbausteinType) original.getValue()).getType());
+//
+//
+// TreeItem clonedItem = new TreeItem<>(cloneOriginalValue);
+//
+// for (TreeItem child : original.getChildren()) {
+// clonedItem.getChildren().add(cloneTreeItem(child));
+// }
+// return clonedItem;
+// }
+//
+// private TreeItem findTreeItem(ProduktbausteinType item, TreeItem root) {
+// if (((ProduktbausteinType) root.getValue()).getId().equals(item.getId())) {
+// return root;
+// }
+// for (TreeItem child : root.getChildren()) {
+// TreeItem found = findTreeItem(item, child);
+// if (found != null) return found;
+// }
+// return null;
+// }
+//
+// public void messageToTree(APrioriProduktbausteinType produkt, TreeItem treeItem) throws Exception {
+// if (!produkt.getBausteine().isEmpty()) {
+// for (int i = 0; i < produkt.getBausteine().size(); i++) {
+// TreeItem up = aprioriToCalc(new TreeItem<>(produkt.getBausteine().get(i)));
+// up.setExpanded(true);
+// if (!produkt.getBausteine().get(i).getBausteine().isEmpty()) {
+// messageToTree(produkt.getBausteine().get(i), up);
+// }
+// treeItem.getChildren().add(up);
+// }
+// }
+// }
+//
+// public void calcMessageToTree(ProduktbausteinType produkt, TreeItem treeItem) {
+// if (!produkt.getBausteine().isEmpty()) {
+// for (int i = 0; i < produkt.getBausteine().size(); i++) {
+// TreeItem up = new TreeItem<>(produkt.getBausteine().get(i));
+// up.setExpanded(true);
+// if (!produkt.getBausteine().get(i).getBausteine().isEmpty()) {
+// calcMessageToTree(produkt.getBausteine().get(i), up);
+// }
+// treeItem.getChildren().add(up);
+// if (!timesItemisIncludedById.containsKey(((ProduktbausteinType) up.getValue()).getId())) {
+// timesItemisIncludedById.put(((ProduktbausteinType) up.getValue()).getId(), 1);
+// }
+// }
+// }
+// }
+
+// public TreeItem aprioriToCalc(TreeItem produkt) throws Exception {
+//
+// TreeItem ergItem = new TreeItem<>();
+// Object erg = new ObjectFactoryFactory().create(((APrioriProduktbausteinType) produkt.getValue()).getType());
+//
+// if (erg != null) {
+// if (ProduktbausteinType.class.isAssignableFrom(erg.getClass())) {
+// ((ProduktbausteinType) erg).setId(((APrioriProduktbausteinType) produkt.getValue()).getId());
+// ((ProduktbausteinType) erg).setBezeichnung(((APrioriProduktbausteinType) produkt.getValue()).getName());
+// ((ProduktbausteinType) erg).setFrom(((APrioriProduktbausteinType) produkt.getValue()).getFrom());
+// ((ProduktbausteinType) erg).setTo(((APrioriProduktbausteinType) produkt.getValue()).getTo());
+// ((ProduktbausteinType) erg).getMeldungen().addAll(((APrioriProduktbausteinType) produkt.getValue()).getMeldungen());
+// ((ProduktbausteinType) erg).getAttribute().addAll(((APrioriProduktbausteinType) produkt.getValue()).getAttribute());
+// ((ProduktbausteinType) erg).setMinOccurrences(((APrioriProduktbausteinType) produkt.getValue()).getMinOccurrences());
+// ((ProduktbausteinType) erg).setMaxOccurrences(((APrioriProduktbausteinType) produkt.getValue()).getMaxOccurrences());
+// ((ProduktbausteinType) erg).setType(((APrioriProduktbausteinType) produkt.getValue()).getType());
+//
+//
+// for (int i = 0; i < ((APrioriProduktbausteinType) produkt.getValue()).getBausteine().size(); i++) {
+// ((ProduktbausteinType) erg).getBausteine().add((ProduktbausteinType) aprioriToCalc(new TreeItem<>(((APrioriProduktbausteinType) produkt.getValue()).getBausteine().get(i))).getValue());
+// }
+//
+// for (int i = 0; i < produkt.getChildren().size(); i++) {
+// ergItem.getChildren().add(aprioriToCalc(produkt.getChildren().get(i)));
+// }
+// }
+// } else {
+// logFlow.getChildren().add(new Text("Objekt kann nicht erzeugt werden. Unbekannte Klasse " + ((APrioriProduktbausteinType) produkt.getValue()).getType()));
+// throw new Exception("Objekt kann nicht erzeugt werden. Unbekannte Klasse " + ((APrioriProduktbausteinType) produkt.getValue()).getType());
+//
+// }
+// ergItem.setValue(erg);
+// return ergItem;
+// }
+//
+// public TreeItem addAprioriToCalc(TreeItem calcItem, TreeItem aprioriItem) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
+// for (TreeItem aprioriChild : aprioriItem.getChildren()) {
+//
+// List> matchingChildren = calcItem.getChildren().stream()
+// .filter(c -> ((ProduktbausteinType) c.getValue()).getId().equals(((ProduktbausteinType) aprioriChild.getValue()).getId()))
+// .toList();
+//
+// if (matchingChildren.isEmpty()) {
+// TreeItem newChild = cloneTreeItem(aprioriChild);
+// calcItem.getChildren().add(newChild);
+// addAprioriToCalc(newChild, aprioriChild);
+// } else {
+// for (TreeItem matchingChild : matchingChildren) {
+// addAprioriToCalc(matchingChild, aprioriChild);
+// }
+// }
+// }
+// return calcItem;
+// }
+//
+// private void sortTree(TreeItem parent) {
+// FXCollections.sort(parent.getChildren(), Comparator.comparing(
+// item -> ((ProduktbausteinType) item.getValue()).getBezeichnung().toLowerCase()
+// ));
+//
+// for (TreeItem child : parent.getChildren()) {
+// sortTree(child);
+// }
+// }
+
+}
diff --git a/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/FehlerDefinitionen.md b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/FehlerDefinitionen.md
new file mode 100644
index 00000000..8cb3cba8
--- /dev/null
+++ b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/FehlerDefinitionen.md
@@ -0,0 +1,89 @@
+# 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 |
+
+# 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 |
+
+### 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
+
+
+## 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 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
+
+Der Client schickt Bausteine, die sich wiedersprechen. Der Server könnte:
+1) Einen Priorisieren und den anderen Inaktiv setzen.
+2) 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
+
+
+
diff --git a/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/ItemAttribute.java b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/ItemAttribute.java
new file mode 100644
index 00000000..d38bdf06
--- /dev/null
+++ b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/ItemAttribute.java
@@ -0,0 +1,315 @@
+package at.vvo.omds.client.gui;
+
+import at.vvo.omds.types.omds3.r2025_05.common.*;
+import javafx.animation.PauseTransition;
+import javafx.geometry.Insets;
+import javafx.scene.control.CheckBox;
+import javafx.scene.control.Label;
+import javafx.scene.control.TextField;
+import javafx.scene.control.TreeItem;
+import javafx.scene.layout.VBox;
+import javafx.scene.paint.Paint;
+import javafx.util.Duration;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ItemAttribute {
+ Map, Map> infoBoxFromItem = new HashMap<>();
+
+ public Map, Map> getInfoBoxFromItem() {
+ return infoBoxFromItem;
+ }
+ public void setInfoBoxFromItem(Map, Map> infoBoxFromItem) {
+ this.infoBoxFromItem = infoBoxFromItem;
+ }
+
+ public VBox addItemInfo(TreeItem newSelection, VBox attributBox) {
+ for(int j = 0; j < ((ProduktbausteinType)newSelection.getValue()).getAttribute().size(); j++) {
+ VBox singleAttributBox = new VBox();
+ singleAttributBox.setPadding(new Insets(10));
+
+ Label label = new Label(
+ ((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j).getBezeichnung() + ": ");
+ TextField textField = new TextField();
+
+
+ CheckBox checkBox = new CheckBox();
+
+ AttributStringType stringAttribut;
+ AttributBooleanType attributBoolean;
+ AttributDezimalType attributDezimal;
+ AttributIntType attributInt;
+
+ if (((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j).getClass()
+ .equals(AttributBooleanType.class)) {
+ attributDezimal = null;
+ attributInt = null;
+ stringAttribut = null;
+
+ attributBoolean = (AttributBooleanType) (
+ (ProduktbausteinType)newSelection.getValue()).getAttribute().get(j);
+
+ if (infoBoxFromItem.get(newSelection) != null && infoBoxFromItem.get(newSelection).get(attributBoolean)
+ != null && !infoBoxFromItem.get(newSelection).get(attributBoolean).isEmpty()){
+ if (infoBoxFromItem.get(newSelection).get(attributBoolean).equals("false")){
+ checkBox.setSelected(false);
+ }else if(infoBoxFromItem.get(newSelection).get(attributBoolean).equals("true")){
+ checkBox.setSelected(true);
+ }
+ }
+ } else if (((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j).getClass()
+ .equals(AttributStringType.class)) {
+ attributDezimal = null;
+ attributBoolean = null;
+ attributInt = null;
+
+ stringAttribut = (AttributStringType) ((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j);
+
+ if (stringAttribut.isPflichtfeld()) {
+ label.setText(label.getText().substring(0, label.getText().length()-2) + "*: ");
+ }
+ if (stringAttribut.isAenderbar() != null && !stringAttribut.isAenderbar()) {
+ textField.setEditable(false);
+ }
+ if (infoBoxFromItem.get(newSelection) != null
+ && infoBoxFromItem.get(newSelection).get(stringAttribut) != null
+ && !infoBoxFromItem.get(newSelection).get(stringAttribut).isEmpty()){
+ textField.setText(infoBoxFromItem.get(newSelection).get(stringAttribut));
+ } else if (stringAttribut.getValue() != null) {
+ textField.setText(stringAttribut.getValue());
+ } else if (stringAttribut.getValue() == null && stringAttribut.getDefault() != null) {
+ textField.setText(stringAttribut.getDefault());
+ }
+ textField.setPromptText("Text eingeben");
+
+ } else if (((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j).getClass()
+ .equals(AttributDezimalType.class)) {
+ attributBoolean = null;
+ attributInt = null;
+ stringAttribut = null;
+
+ attributDezimal = (AttributDezimalType) ((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j);
+
+ if (attributDezimal.isPflichtfeld()) {
+ label.setText(label.getText().substring(0, label.getText().length()-2) + "*: ");
+ }
+ if (attributDezimal.isAenderbar() != null && !attributDezimal.isAenderbar()) {
+ textField.setEditable(false);
+ }
+ if (infoBoxFromItem.get(newSelection) != null
+ && infoBoxFromItem.get(newSelection).get(attributDezimal) != null
+ && !infoBoxFromItem.get(newSelection).get(attributDezimal).isEmpty()){
+ textField.setText(infoBoxFromItem.get(newSelection).get(attributDezimal));
+ } else if (attributDezimal.getValue() != null) {
+ textField.setText(attributDezimal.getValue().toString());
+ } else if (attributDezimal.getValue() == null && attributDezimal.getDefault() != null) {
+ textField.setText(attributDezimal.getDefault().toString());
+ }
+ textField.setPromptText("Dezimalzahl eingeben");
+ } else {
+ attributDezimal = null;
+ attributBoolean = null;
+ stringAttribut = null;
+
+ attributInt = (AttributIntType) ((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j);
+
+ if (attributInt.isPflichtfeld()) {
+ label.setText(label.getText().substring(0, label.getText().length()-2) + "*: ");
+ }
+ if (attributInt.isAenderbar() != null && !attributInt.isAenderbar()) {
+ textField.setEditable(false);
+ }
+ if (infoBoxFromItem.get(newSelection) != null
+ && infoBoxFromItem.get(newSelection).get(attributInt) != null
+ && !infoBoxFromItem.get(newSelection).get(attributInt).isEmpty()){
+ textField.setText(infoBoxFromItem.get(newSelection).get(attributInt));
+ } else if (attributInt.getValue() != null) {
+ textField.setText(attributInt.getValue().toString());
+ } else if (attributInt.getValue() == null && attributInt.getDefault() != null) {
+ textField.setText(attributInt.getDefault().toString());
+ }
+ textField.setPromptText("Ganzzahl eingeben");
+ }
+
+ if (attributBoolean != null && attributBoolean.isValue() != null) {
+ checkBox.setSelected(attributBoolean.isValue());
+ }else if(attributBoolean != null && attributBoolean.isDefault() != null) {
+ checkBox.setSelected(attributBoolean.isDefault());
+ }
+
+ if (attributBoolean != null && attributBoolean.isAenderbar() != null && !attributBoolean.isAenderbar()) {
+ checkBox.setDisable(true);
+ }
+ if (attributBoolean != null && attributBoolean.isPflichtfeld()) {
+ label.setText(label.getText().substring(0, label.getText().length()-2) + "*: ");
+ }
+
+ int finalJ = j;
+ checkBox.selectedProperty().addListener((obsVal, oldVal, newVal) -> {
+ if (attributBoolean != null) {
+ infoBoxFromItem.computeIfAbsent(newSelection,
+ k -> new HashMap<>()).put(attributBoolean, checkBox.isSelected() ? "true" : "false");
+ attributBoolean.setValue(checkBox.isSelected());
+ ((ProduktbausteinType)newSelection.getValue()).getAttribute().set(finalJ, attributBoolean);
+ }
+ });
+ textField.focusedProperty().addListener((observableValue, oldVal, newVal) -> {
+ if (!newVal) {
+ PauseTransition pause = new PauseTransition(Duration.seconds(3));
+ pause.setOnFinished(ep -> {
+ textField.setStyle("-fx-border-color: #bfbfbf");
+ });
+ if (attributDezimal != null){
+ infoBoxFromItem.computeIfAbsent(newSelection,
+ k -> new HashMap<>()).put(attributDezimal, textField.getText());
+
+ String eingabe = textField.getText().replace(",",".");
+ if (textField.getText().isEmpty()){
+ if (attributDezimal.isPflichtfeld()){
+
+ Label failedCheck = new Label("Es muss ein Wert mitgegeben werden");
+ failedCheck.setVisible(true);
+ failedCheck.setTextFill(Paint.valueOf("#DD0000"));
+
+ textField.setStyle("-fx-border-color: #dd0000");
+
+ pause.play();
+
+ if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
+ singleAttributBox.getChildren().addLast(failedCheck);
+ }
+ } else if(!textField.getText().matches("^-?[0-9]+[,.]?[0-9]*")){
+ Label failedCheck = new Label("Der Wert muss einer Dezimal Zahl entsprechen ");
+ failedCheck.setVisible(true);
+ failedCheck.setTextFill(Paint.valueOf("#DD0000"));
+
+ textField.setStyle("-fx-border-color: #dd0000");
+ pause.play();
+
+ if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
+ singleAttributBox.getChildren().addLast(failedCheck);
+ } else if (new BigDecimal(eingabe).compareTo(attributDezimal.getMin()) < 0 ||
+ new BigDecimal(eingabe).compareTo(attributDezimal.getMax()) > 0) {
+ Label failedCheck = new Label("Der Wert muss zwischen "
+ + attributDezimal.getMin() + " und " + attributDezimal.getMax() + " liegen");
+ failedCheck.setVisible(true);
+ failedCheck.setTextFill(Paint.valueOf("#DD0000"));
+
+ textField.setStyle("-fx-border-color: #dd0000");
+ pause.play();
+
+ if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
+ singleAttributBox.getChildren().addLast(failedCheck);
+ }else {
+ if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
+ attributDezimal.setValue(new BigDecimal(eingabe));
+ ((ProduktbausteinType)newSelection.getValue()).getAttribute().set(finalJ, attributDezimal);
+ }
+ } else if (attributInt != null) {
+ infoBoxFromItem.computeIfAbsent(newSelection,
+ k -> new HashMap<>()).put(attributInt, textField.getText());
+
+ if (textField.getText() == null || textField.getText().isEmpty()
+ || !textField.getText().matches("^-?[0-9]*")) {
+ Label failedCheck = new Label("Es muss ein ganzzahliger Wert eingegeben werden");
+ failedCheck.setVisible(true);
+ failedCheck.setTextFill(Paint.valueOf("#DD0000"));
+
+ textField.setStyle("-fx-border-color: #dd0000");
+ pause.play();
+
+ if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
+ singleAttributBox.getChildren().addLast(failedCheck);
+ }else if (Integer.parseInt(textField.getText()) < attributInt.getMin()
+ || Integer.parseInt(textField.getText()) > attributInt.getMax()) {
+ Label failedCheck = new Label("Der Wert muss zwischen " + attributInt.getMin()
+ + " und " + attributInt.getMax() + " liegen");
+ failedCheck.setVisible(true);
+ failedCheck.setTextFill(Paint.valueOf("#DD0000"));
+
+ textField.setStyle("-fx-border-color: #dd0000");
+ pause.play();
+
+ if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
+ singleAttributBox.getChildren().addLast(failedCheck);
+ }else {
+ if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
+ attributInt.setValue(Integer.parseInt(textField.getText()));
+ ((ProduktbausteinType)newSelection.getValue()).getAttribute().set(finalJ, attributInt);
+ }
+ } else if (stringAttribut != null) {
+ infoBoxFromItem.computeIfAbsent(newSelection,
+ k -> new HashMap<>()).put(stringAttribut, textField.getText());
+
+ if (textField.getText() == null ||
+ (stringAttribut.getMinLaenge() != null
+ && textField.getText().length() < stringAttribut.getMinLaenge()) ||
+ (stringAttribut.getMaxLaenge() != null
+ && textField.getText().length() > stringAttribut.getMaxLaenge()) ||
+ (stringAttribut.getRegex() != null
+ && !textField.getText().matches(stringAttribut.getRegex()))) {
+ Label failedCheck = new Label("Der Wert muss zwischen " +
+ stringAttribut.getMinLaenge() + " und " + stringAttribut.getMaxLaenge() +
+ (stringAttribut.getRegex() != null ? " Buchstaben haben und der Form " +
+ stringAttribut.getRegex() + " entsprechen" : "Buchstaben haben"));
+ failedCheck.setVisible(true);
+ failedCheck.setTextFill(Paint.valueOf("#DD0000"));
+
+ textField.setStyle("-fx-border-color: #dd0000");
+ pause.play();
+
+ if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
+ ((ProduktbausteinType)newSelection.getValue()).getAttribute().set(finalJ, attributInt);
+
+ }else {
+ if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
+ stringAttribut.setValue(textField.getText());
+ ((ProduktbausteinType)newSelection.getValue()).getAttribute().set(finalJ, stringAttribut);
+ }
+ }
+
+ }
+ });
+ if (attributBoolean != null) {
+ singleAttributBox.getChildren().addAll(label, checkBox);
+ }else {
+ singleAttributBox.getChildren().addAll(label, textField);
+ }
+
+ 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);
+ });
+ }
+
+ }
+ return attributBox;
+ }
+}
diff --git a/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/ObjectFactoryFactory.java b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/ObjectFactoryFactory.java
new file mode 100644
index 00000000..46323ac8
--- /dev/null
+++ b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/ObjectFactoryFactory.java
@@ -0,0 +1,37 @@
+package at.vvo.omds.client.gui;
+
+import at.vvo.omds.types.omds3.r2025_05.on2antrag.kfz.ObjectFactory;
+
+public class ObjectFactoryFactory {
+ public Object create(String classPath) {
+ if (classPath != null) {
+ if (classPath.toLowerCase().contains("kfz")){
+ ObjectFactory of = new ObjectFactory();
+ String typeName = classPath.substring(classPath.lastIndexOf(".") + 1);
+
+ return switch (typeName) {
+ case "VerkaufsproduktKfzType" -> of.createVerkaufsproduktKfzType();
+ case "HaftpflichtKfzType" -> of.createHaftpflichtKfzType();
+ case "VollkaskoKfzType" -> of.createVollkaskoKfzType();
+ case "AssistanceKfzType" -> of.createAssistanceKfzType();
+ case "TeilkaskoKfzType" -> of.createTeilkaskoKfzType();
+ case "InsassenUnfallKfzType" -> of.createInsassenUnfallKfzType();
+ default -> null;
+ };
+ } else if (classPath.toLowerCase().contains("sachprivat")){
+ at.vvo.omds.types.omds3.r2025_05.on2antrag.sachPrivat.ObjectFactory of =
+ new at.vvo.omds.types.omds3.r2025_05.on2antrag.sachPrivat.ObjectFactory();
+ String typeName = classPath.substring(classPath.lastIndexOf(".") + 1);
+
+ return switch (typeName) {
+ case "VerkaufsproduktSachPrivatType" -> of.createVerkaufsproduktSachPrivatType();
+ case "ProduktGebaeudeversicherungType" -> of.createProduktGebaeudeversicherungType();
+ case "ProduktSachPrivatType" -> of.createProduktSachPrivatType();
+
+ default -> null;
+ };
+ }
+ }
+ return null;
+ }
+}
diff --git a/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/TreeHelper.java b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/TreeHelper.java
new file mode 100644
index 00000000..29770ef4
--- /dev/null
+++ b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/TreeHelper.java
@@ -0,0 +1,210 @@
+package at.vvo.omds.client.gui;
+
+import at.vvo.omds.types.omds3.r2025_05.common.APrioriProduktbausteinType;
+import at.vvo.omds.types.omds3.r2025_05.common.ProduktbausteinType;
+import javafx.collections.FXCollections;
+import javafx.scene.control.TreeItem;
+import javafx.scene.text.Text;
+import javafx.scene.text.TextFlow;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.*;
+
+public class TreeHelper {
+ Map timesItemisIncludedById = new HashMap<>();
+ List> isNotIncluded = new ArrayList<>();
+ TextFlow logFlow = new TextFlow();
+
+ public Map getTimesItemisIncludedById() {
+ return timesItemisIncludedById;
+ }
+
+ public void setTimesItemisIncludedById(Map timesItemisIncludedById) {
+ this.timesItemisIncludedById = timesItemisIncludedById;
+ }
+
+ public List> getIsNotIncluded() {
+ return isNotIncluded;
+ }
+
+ public void setIsNotIncluded(List> isNotIncluded) {
+ this.isNotIncluded = isNotIncluded;
+ }
+
+ public TextFlow getLogFlow() {
+ return logFlow;
+ }
+
+ public void setLogFlow(TextFlow logFlow) {
+ this.logFlow = logFlow;
+ }
+
+ public TreeItem cleanTree(TreeItem original) {
+ if (isNotIncluded.contains(original)) {
+ return null;
+ }
+
+ TreeItem newItem = new TreeItem<>(original.getValue());
+ for (TreeItem child : original.getChildren()) {
+ TreeItem cleanedChild = cleanTree(child);
+ if (cleanedChild != null) {
+ newItem.getChildren().add(cleanedChild);
+ }
+ }
+ return newItem;
+ }
+
+ public TreeItem cloneTreeItem(TreeItem original) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
+ Object cloneOriginalValue;
+
+ cloneOriginalValue = new ObjectFactoryFactory().create(((ProduktbausteinType) original.getValue()).getTyp());
+
+ ((ProduktbausteinType) cloneOriginalValue).setId(
+ ((ProduktbausteinType) original.getValue()).getId());
+ ((ProduktbausteinType) cloneOriginalValue).setBezeichnung(
+ ((ProduktbausteinType) original.getValue()).getBezeichnung());
+ ((ProduktbausteinType) cloneOriginalValue).setVerkaufsoffenVon(
+ ((ProduktbausteinType) original.getValue()).getVerkaufsoffenVon());
+ ((ProduktbausteinType) cloneOriginalValue).setVerkaufsoffenBis(
+ ((ProduktbausteinType) original.getValue()).getVerkaufsoffenBis());
+ ((ProduktbausteinType) cloneOriginalValue).getAttribute().addAll(
+ ((ProduktbausteinType) original.getValue()).getAttribute());
+ ((ProduktbausteinType) cloneOriginalValue).getMeldungen().addAll(
+ ((ProduktbausteinType) original.getValue()).getMeldungen());
+ ((ProduktbausteinType) cloneOriginalValue).setMinVorkommen(
+ ((ProduktbausteinType) original.getValue()).getMinVorkommen());
+ ((ProduktbausteinType) cloneOriginalValue).setMaxVorkommen(
+ ((ProduktbausteinType) original.getValue()).getMaxVorkommen());
+ ((ProduktbausteinType) cloneOriginalValue).setTyp(
+ ((ProduktbausteinType) original.getValue()).getTyp());
+
+
+ TreeItem clonedItem = new TreeItem<>(cloneOriginalValue);
+
+ for (TreeItem child : original.getChildren()) {
+ clonedItem.getChildren().add(cloneTreeItem(child));
+ }
+ return clonedItem;
+ }
+
+ public TreeItem findTreeItem(ProduktbausteinType item, TreeItem root) {
+ if (((ProduktbausteinType) root.getValue()).getId().equals(item.getId())) {
+ return root;
+ }
+ for (TreeItem child : root.getChildren()) {
+ TreeItem found = findTreeItem(item, child);
+ if (found != null) return found;
+ }
+ return null;
+ }
+
+ public void messageToTree(APrioriProduktbausteinType produkt, TreeItem treeItem) throws Exception {
+ if (!produkt.getBausteine().isEmpty()) {
+ for (int i = 0; i < produkt.getBausteine().size(); i++) {
+ TreeItem up = aprioriItemToCalcItem(new TreeItem<>(produkt.getBausteine().get(i)));
+ up.setExpanded(true);
+ if (!produkt.getBausteine().get(i).getBausteine().isEmpty()) {
+ messageToTree(produkt.getBausteine().get(i), up);
+ }
+ treeItem.getChildren().add(up);
+ }
+ }
+ }
+
+ public void calcMessageToTree(ProduktbausteinType produkt, TreeItem treeItem) {
+ if (!produkt.getBausteine().isEmpty()) {
+ for (int i = 0; i < produkt.getBausteine().size(); i++) {
+ TreeItem up = new TreeItem<>(produkt.getBausteine().get(i));
+ up.setExpanded(true);
+ if (!produkt.getBausteine().get(i).getBausteine().isEmpty()) {
+ calcMessageToTree(produkt.getBausteine().get(i), up);
+ }
+ treeItem.getChildren().add(up);
+ if (!timesItemisIncludedById.containsKey(((ProduktbausteinType) up.getValue()).getId())) {
+ timesItemisIncludedById.put(((ProduktbausteinType) up.getValue()).getId(), 1);
+ }
+ }
+ }
+ }
+
+ public TreeItem aprioriItemToCalcItem(TreeItem produkt) throws Exception {
+
+ TreeItem ergItem = new TreeItem<>();
+ Object erg = new ObjectFactoryFactory().create(((APrioriProduktbausteinType) produkt.getValue()).getType());
+
+ if (erg != null) {
+ if (ProduktbausteinType.class.isAssignableFrom(erg.getClass())) {
+ ((ProduktbausteinType) erg).setId(
+ ((APrioriProduktbausteinType) produkt.getValue()).getId());
+ ((ProduktbausteinType) erg).setBezeichnung(
+ ((APrioriProduktbausteinType) produkt.getValue()).getName());
+ ((ProduktbausteinType) erg).setVerkaufsoffenVon(
+ ((APrioriProduktbausteinType) produkt.getValue()).getFrom());
+ ((ProduktbausteinType) erg).setVerkaufsoffenBis(
+ ((APrioriProduktbausteinType) produkt.getValue()).getTo());
+ ((ProduktbausteinType) erg).getMeldungen().addAll(
+ ((APrioriProduktbausteinType) produkt.getValue()).getMeldungen());
+ ((ProduktbausteinType) erg).getAttribute().addAll(
+ ((APrioriProduktbausteinType) produkt.getValue()).getAttribute());
+ ((ProduktbausteinType) erg).setMinVorkommen(
+ ((APrioriProduktbausteinType) produkt.getValue()).getMinOccurrences());
+ ((ProduktbausteinType) erg).setMaxVorkommen(
+ ((APrioriProduktbausteinType) produkt.getValue()).getMaxOccurrences());
+ ((ProduktbausteinType) erg).setTyp(
+ ((APrioriProduktbausteinType) produkt.getValue()).getType());
+
+
+ for (int i = 0; i < ((APrioriProduktbausteinType) produkt.getValue()).getBausteine().size(); i++) {
+ ((ProduktbausteinType) erg).getBausteine().add((ProduktbausteinType) aprioriItemToCalcItem(
+ new TreeItem<>(((APrioriProduktbausteinType) produkt.getValue())
+ .getBausteine().get(i))).getValue());
+ }
+
+ for (int i = 0; i < produkt.getChildren().size(); i++) {
+ ergItem.getChildren().add(aprioriItemToCalcItem(produkt.getChildren().get(i)));
+ }
+ }
+ } else {
+ logFlow.getChildren().add(new Text("Objekt kann nicht erzeugt werden. Unbekannte Klasse "
+ + ((APrioriProduktbausteinType) produkt.getValue()).getType()));
+ throw new Exception("Objekt kann nicht erzeugt werden. Unbekannte Klasse "
+ + ((APrioriProduktbausteinType) produkt.getValue()).getType());
+
+ }
+ ergItem.setValue(erg);
+ return ergItem;
+ }
+
+ public TreeItem addAprioriToCalc(TreeItem calcItem, TreeItem aprioriItem)
+ throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
+ for (TreeItem aprioriChild : aprioriItem.getChildren()) {
+
+ List> matchingChildren = calcItem.getChildren().stream()
+ .filter(c -> ((ProduktbausteinType) c.getValue()).getId()
+ .equals(((ProduktbausteinType) aprioriChild.getValue()).getId()))
+ .toList();
+
+ if (matchingChildren.isEmpty()) {
+ TreeItem newChild = cloneTreeItem(aprioriChild);
+ calcItem.getChildren().add(newChild);
+ addAprioriToCalc(newChild, aprioriChild);
+ } else {
+ for (TreeItem matchingChild : matchingChildren) {
+ addAprioriToCalc(matchingChild, aprioriChild);
+ }
+ }
+ }
+ return calcItem;
+ }
+
+ public TreeItem sortTree(TreeItem parent) {
+ FXCollections.sort(parent.getChildren(), Comparator.comparing(
+ item -> ((ProduktbausteinType) item.getValue()).getBezeichnung().toLowerCase()
+ ));
+
+ for (TreeItem child : parent.getChildren()) {
+ sortTree(child);
+ }
+ return parent;
+ }
+}
diff --git a/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/SOAPConnector.java b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/SOAPConnector.java
new file mode 100644
index 00000000..426a14e9
--- /dev/null
+++ b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/SOAPConnector.java
@@ -0,0 +1,212 @@
+package at.vvo.omds.client.gui.api;
+
+import at.vvo.omds.types.omds3.r2025_05.common.ProductsRequest;
+import at.vvo.omds.types.omds3.r2025_05.common.ProductsResponse;
+import at.vvo.omds.types.omds3.r2025_05.on2antrag.common.CalculateRequest;
+import at.vvo.omds.types.omds3.r2025_05.on2antrag.common.CalculateResponse;
+import jakarta.xml.bind.JAXBContext;
+import jakarta.xml.bind.JAXBElement;
+import jakarta.xml.bind.Marshaller;
+import jakarta.xml.bind.Unmarshaller;
+import jakarta.xml.soap.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
+import java.io.FileReader;
+
+public class SOAPConnector {
+
+ static Logger logger = LoggerFactory.getLogger(SOAPConnector.class);
+
+ public CalculateResponse calculateRequestAuskunft(String url, JAXBElement request, String token) throws Exception {
+
+ logger.info("Url:" + url);
+ logger.info("Request VUNr:" + request.getValue().getVUNr());
+
+ SOAPConnectionFactory connectionFactory = SOAPConnectionFactory.newInstance();
+ SOAPConnection soapConnection = connectionFactory.createConnection();
+
+ SOAPMessage req = createCalcRequest(request, token);
+
+ SOAPMessage response = soapConnection.call(req, url);
+
+ JAXBContext jaxbContext = JAXBContext.newInstance(at.vvo.omds.types.omds3.r2025_05.on2antrag.common.ObjectFactory.class);
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();;
+
+ System.out.println("-----------------------------------------------------------------------------");
+ printMessage(response);
+ CalculateResponse erg =
+ (CalculateResponse) unmarshaller.unmarshal(response.getSOAPBody().extractContentAsDocument());
+ soapConnection.close();
+
+ return erg;
+ }
+
+ public ProductsResponse aprioriAuskunft(String url, JAXBElement request, String token) throws Exception {
+
+ logger.info("Url:" + url);
+ logger.info("Request VUNr:" + request.getValue().getVUNr());
+
+ SOAPConnectionFactory connectionFactory = SOAPConnectionFactory.newInstance();
+ SOAPConnection soapConnection = connectionFactory.createConnection();
+
+ SOAPMessage req = createRequest(request, token);
+
+ SOAPMessage response = soapConnection.call(req, url);
+
+ JAXBContext jaxbContext = JAXBContext.newInstance(at.vvo.omds.types.omds3.r2025_05.common.ObjectFactory.class, at.vvo.omds.types.omds2.v2_17.ObjectFactory.class, at.vvo.omds.types.omds3.r2025_05.on2antrag.common.ObjectFactory.class);
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+
+ ProductsResponse erg =
+ (ProductsResponse) unmarshaller.unmarshal(response.getSOAPBody().extractContentAsDocument());
+ soapConnection.close();
+
+ return erg;
+ }
+
+ private SOAPMessage createCalcRequest(JAXBElement request, String token) throws Exception {
+ MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+ SOAPMessage soapMessage = messageFactory.createMessage();
+
+ createCalcEnvelope(soapMessage, request, token);
+
+ MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
+ mimeHeaders.addHeader("Content-Type", "application/soap+xml");
+
+ soapMessage.saveChanges();
+
+ return soapMessage;
+ }
+
+ private SOAPMessage createRequest(JAXBElement request, String token) throws Exception {
+ MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+ SOAPMessage soapMessage = messageFactory.createMessage();
+
+ createEnvelope(soapMessage, request, token);
+
+ MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
+ mimeHeaders.addHeader("Content-Type", "application/soap+xml");
+
+ soapMessage.saveChanges();
+
+ return soapMessage;
+ }
+
+ private void createEnvelope(SOAPMessage soapMessage, JAXBElement request, String token) throws Exception {
+ SOAPPart soapPart = soapMessage.getSOAPPart();
+
+ SOAPEnvelope envelope = soapPart.getEnvelope();
+ SOAPHeader soapHeader = envelope.getHeader();
+
+ Name headerElementName = envelope.createName(
+ "Security",
+ "wsse",
+ "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
+ );
+ SOAPHeaderElement soapHeaderElement = soapHeader.addHeaderElement(headerElementName);
+
+ SOAPElement securityContextTokenSOAPElement = soapHeaderElement.addChildElement("SecurityContextToken", "wsc", "http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512");
+ securityContextTokenSOAPElement.addNamespaceDeclaration("wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
+ securityContextTokenSOAPElement.addAttribute(new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", "Id", "wsu"), "authPolicy");
+ SOAPElement identifierSOAPElement = securityContextTokenSOAPElement.addChildElement("Identifier", "wsc");
+// identifierSOAPElement.addTextNode(getToken(request.getValue().getVUNr()));
+ identifierSOAPElement.addTextNode("eintollertoken");
+ JAXBContext jaxbContext = JAXBContext.newInstance("at.vvo.omds.types.omds3.r2025_05.common");
+
+ SOAPBody body = envelope.getBody();
+
+ Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
+ Marshaller marshaller = jaxbContext.createMarshaller();
+
+ marshaller.marshal(request,document);
+
+ body.addDocument(document);
+
+ soapMessage.saveChanges();
+
+ }
+
+ private void createCalcEnvelope(SOAPMessage soapMessage, JAXBElement request, String token) throws Exception {
+ SOAPPart soapPart = soapMessage.getSOAPPart();
+
+ SOAPEnvelope envelope = soapPart.getEnvelope();
+ SOAPHeader soapHeader = envelope.getHeader();
+
+ Name headerElementName = envelope.createName(
+ "Security",
+ "wsse",
+ "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
+ );
+ SOAPHeaderElement soapHeaderElement = soapHeader.addHeaderElement(headerElementName);
+
+ SOAPElement securityContextTokenSOAPElement = soapHeaderElement.addChildElement("SecurityContextToken", "wsc", "http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512");
+ securityContextTokenSOAPElement.addNamespaceDeclaration("wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
+ securityContextTokenSOAPElement.addAttribute(new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", "Id", "wsu"), "authPolicy");
+ SOAPElement identifierSOAPElement = securityContextTokenSOAPElement.addChildElement("Identifier", "wsc");
+// identifierSOAPElement.addTextNode(getToken(request.getValue().getVUNr()));
+ identifierSOAPElement.addTextNode("eintollertoken");
+ JAXBContext jaxbContext = JAXBContext.newInstance(at.vvo.omds.types.omds3.r2025_05.on2antrag.common.ObjectFactory.class);
+
+ SOAPBody body = envelope.getBody();
+
+ Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
+ Marshaller marshaller = jaxbContext.createMarshaller();
+
+ marshaller.marshal(request,document);
+
+ body.addDocument(document);
+
+ soapMessage.saveChanges();
+
+ }
+
+
+ public static void printMessage(SOAPMessage soapMessage) throws Exception {
+ TransformerFactory tff = TransformerFactory.newInstance();
+ Transformer tf = tff.newTransformer();
+
+ tf.setOutputProperty(OutputKeys.INDENT, "yes");
+ tf.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
+
+ Source sc = soapMessage.getSOAPPart().getContent();
+
+ ByteArrayOutputStream streamOut = new ByteArrayOutputStream();
+ StreamResult result = new StreamResult(streamOut);
+ tf.transform(sc, result);
+
+ String strMessage = streamOut.toString();
+
+ logger.atInfo().log("----- SOAPMessage -----");
+ logger.atInfo().log(strMessage);
+ }
+
+ public String getToken(String vunr) throws Exception {
+ BufferedReader br = new BufferedReader(
+ new FileReader(System.getProperty("user.home") + "\\OMDSSchlüssel.txt"));
+
+ String[] tokens = br.lines().toArray(String[]::new);
+ if (tokens.length > 1) {
+ for (String token : tokens) {
+ if (token.contains(vunr)) {
+ if (!(token.replaceAll(".*[=: ]\\s*", "").contains(vunr))){
+ return token.replaceAll(".*[=: ]\\s*","");
+ }
+ throw new Exception("Der Token mit der angegebenen VuNr hat ein ungültiges Format");
+ }
+ }
+ throw new Exception("Kein Token für die angegebene VuNr vorhanden");
+ }else{
+ throw new Exception("Keine Tokens in der Datei");
+ }
+ }
+}
diff --git a/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/apriori/AprioriAuskunftService.java b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/apriori/AprioriAuskunftService.java
new file mode 100644
index 00000000..f600aabf
--- /dev/null
+++ b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/apriori/AprioriAuskunftService.java
@@ -0,0 +1,37 @@
+package at.vvo.omds.client.gui.api.apriori;
+
+import at.vvo.omds.client.gui.api.SOAPConnector;
+import at.vvo.omds.types.omds3.r2025_05.common.ProductsRequest;
+import at.vvo.omds.types.omds3.r2025_05.common.ProductsResponse;
+import jakarta.xml.bind.JAXBElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+public class AprioriAuskunftService {
+
+ Logger log = LoggerFactory.getLogger(AprioriAuskunftService.class);
+
+ private final SOAPConnector soapConnector;
+
+ public AprioriAuskunftService(SOAPConnector soapConnector) {
+ this.soapConnector = soapConnector;
+ }
+
+ public ProductsResponse aprioriAuskunft(XMLGregorianCalendar stichtag, String vuNr) throws Exception {
+
+ String token = "";
+ JAXBElement r = BuildProductsRequest.aprioriRequest(stichtag, vuNr);
+
+ ProductsResponse response =
+ soapConnector.aprioriAuskunft(
+ "http://localhost:9090/ws", r, token
+ );
+ log.info("Got Response As below ========= : ");
+ log.info("Status : {}", response.getVerkaufsprodukt().getFirst().getName());
+
+ return response;
+ }
+}
diff --git a/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/apriori/BuildProductsRequest.java b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/apriori/BuildProductsRequest.java
new file mode 100644
index 00000000..31b628cb
--- /dev/null
+++ b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/apriori/BuildProductsRequest.java
@@ -0,0 +1,38 @@
+package at.vvo.omds.client.gui.api.apriori;
+
+import at.vvo.omds.types.omds3.r2025_05.common.*;
+import jakarta.xml.bind.JAXBElement;
+import jakarta.xml.bind.annotation.XmlElementDecl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.xml.datatype.XMLGregorianCalendar;
+import javax.xml.namespace.QName;
+
+public class BuildProductsRequest {
+
+ private static final Logger LOG = LoggerFactory.getLogger(BuildProductsRequest.class);
+
+ private static final at.vvo.omds.types.omds3.r2025_05.common.ObjectFactory OUOF =
+ new at.vvo.omds.types.omds3.r2025_05.common.ObjectFactory();
+
+ /** Privater default Constructor versteckt den nicht benötigten Default-Constructor. */
+ private BuildProductsRequest() {
+ }
+
+ static public JAXBElement aprioriRequest(XMLGregorianCalendar Stichtag, String vuNr) {
+ LOG.info("VUNr = " + vuNr);
+
+ ProductsRequest request = OUOF.createProductsRequest();
+ request.setKorrelationsId("123456");
+ request.setVUNr(vuNr);
+ request.setStichtag(Stichtag);
+ return createProductsRequest(request);
+ }
+
+ @XmlElementDecl(namespace = "urn:omds3CommonServiceTypes-1-1-0", name = "ProductsRequest")
+ public static JAXBElement createProductsRequest(ProductsRequest value) {
+ return new JAXBElement<>(new QName("urn:omds3CommonServiceTypes-1-1-0","ProductsRequest"),
+ ProductsRequest.class, null, value);
+ }
+}
diff --git a/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/calc/BuildCalculateRequestAuskunft.java b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/calc/BuildCalculateRequestAuskunft.java
new file mode 100644
index 00000000..167fb22d
--- /dev/null
+++ b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/calc/BuildCalculateRequestAuskunft.java
@@ -0,0 +1,76 @@
+package at.vvo.omds.client.gui.api.calc;
+
+import at.vvo.omds.client.gui.ObjectFactoryFactory;
+import at.vvo.omds.types.omds3.r2025_05.common.*;
+import at.vvo.omds.types.omds3.r2025_05.on2antrag.common.*;
+import jakarta.xml.bind.JAXBElement;
+import javafx.scene.control.TreeItem;
+import javafx.scene.control.TreeView;
+
+import javax.xml.datatype.XMLGregorianCalendar;
+import javax.xml.namespace.QName;
+
+public class BuildCalculateRequestAuskunft {
+ private static final at.vvo.omds.types.omds3.r2025_05.on2antrag.common.ObjectFactory OUOF =
+ new at.vvo.omds.types.omds3.r2025_05.on2antrag.common.ObjectFactory();
+
+ private BuildCalculateRequestAuskunft(){}
+
+ static public JAXBElement buildRequestFromTreeView(TreeView treeView, XMLGregorianCalendar vtBeg) {
+ CalculateRequest request = OUOF.createCalculateRequest();
+ VerkaufsproduktType verkaufsprodukt = TreeViewToVerkaufsprodukt(treeView, vtBeg);
+ verkaufsprodukt.setVtgBeg(vtBeg);
+ verkaufsprodukt.setTyp(((ProduktbausteinType)treeView.getRoot().getValue()).getTyp());
+ SpezBerechnungGenType berechnungsanfrage = new SpezBerechnungGenType();
+
+ berechnungsanfrage.setVerkaufsprodukt(verkaufsprodukt);
+ request.setBerechnungsanfrage(berechnungsanfrage);
+ request.setKorrelationsId("12444579");
+ request.setVUNr("042");
+
+ return createCalculateRequest(request);
+ }
+
+ public static JAXBElement createCalculateRequest(CalculateRequest value) {
+ return new JAXBElement<>(new QName("urn:at.vvo.omds.types.omds3types.v1-3-0.on2antrag.common","CalculateRequest"),
+ CalculateRequest.class, null, value);
+ }
+
+ public static ProduktbausteinType TreeItemToBaustein(TreeItem treeItem) {
+ ProduktbausteinType baustein = (ProduktbausteinType) new ObjectFactoryFactory().create(
+ ((ProduktbausteinType)treeItem.getValue()).getTyp());
+
+ baustein.setBezeichnung(((ProduktbausteinType)treeItem.getValue()).getBezeichnung());
+ baustein.setId(((ProduktbausteinType)treeItem.getValue()).getId());
+ baustein.setVerkaufsoffenVon(((ProduktbausteinType)treeItem.getValue()).getVerkaufsoffenVon());
+ baustein.setVerkaufsoffenBis(((ProduktbausteinType)treeItem.getValue()).getVerkaufsoffenBis());
+ baustein.getAttribute().addAll(((ProduktbausteinType)treeItem.getValue()).getAttribute());
+ baustein.setTyp(((ProduktbausteinType)treeItem.getValue()).getTyp());
+
+ return baustein;
+ }
+
+ public static VerkaufsproduktType TreeViewToVerkaufsprodukt(TreeView treeView, XMLGregorianCalendar vtBeg) {
+ VerkaufsproduktType verkaufsprodukt = (VerkaufsproduktType) TreeItemToBaustein(treeView.getRoot());
+ verkaufsprodukt.setVtgBeg(vtBeg);
+
+ if (!treeView.getRoot().getChildren().isEmpty()) {
+ for (int i = 0; i < treeView.getRoot().getChildren().size(); i++) {
+ verkaufsprodukt.getBausteine().add((addUpFromTreeItem(treeView.getRoot().getChildren().get(i))));
+ }
+ }
+
+ return verkaufsprodukt;
+ }
+
+ public static ProduktbausteinType addUpFromTreeItem(TreeItem treeItem) {
+ ProduktbausteinType baustein = (ProduktbausteinType) TreeItemToBaustein(treeItem);
+
+ if (!treeItem.getChildren().isEmpty()) {
+ for (int i = 0; i < treeItem.getChildren().size(); i++) {
+ baustein.getBausteine().add(addUpFromTreeItem(treeItem.getChildren().get(i)));
+ }
+ }
+ return baustein;
+ }
+}
diff --git a/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/calc/CalculateRequestAuskunftService.java b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/calc/CalculateRequestAuskunftService.java
new file mode 100644
index 00000000..b9fe9e69
--- /dev/null
+++ b/OMDSServiceDefinition/src/main/java/at/vvo/omds/client/gui/api/calc/CalculateRequestAuskunftService.java
@@ -0,0 +1,38 @@
+package at.vvo.omds.client.gui.api.calc;
+
+import at.vvo.omds.client.gui.api.SOAPConnector;
+import at.vvo.omds.types.omds3.r2025_05.on2antrag.common.CalculateRequest;
+import at.vvo.omds.types.omds3.r2025_05.on2antrag.common.CalculateResponse;
+import jakarta.xml.bind.JAXBElement;
+import javafx.scene.control.TreeView;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+public class CalculateRequestAuskunftService {
+
+ Logger log = LoggerFactory.getLogger(CalculateRequestAuskunftService.class);
+
+ private final SOAPConnector soapConnector;
+
+ public CalculateRequestAuskunftService(SOAPConnector soapConnector) {
+ this.soapConnector = soapConnector;
+ }
+
+ public CalculateResponse aprioriAuskunft(TreeView treeView, XMLGregorianCalendar vtBeg) throws Exception {
+
+ String token = "";
+ JAXBElement r = BuildCalculateRequestAuskunft.buildRequestFromTreeView(treeView, vtBeg);
+
+ CalculateResponse response =
+ soapConnector.calculateRequestAuskunft(
+ "http://localhost:9090/ws", r, token
+ );
+ log.info("Got Response As below ========= : ");
+ log.info("Status : {}", response.getBerechnungsantwort().getVerkaufsprodukt().getBezeichnung());
+
+ return response;
+ }
+}
diff --git a/OMDSServiceDefinition/src/main/resources/def/r2025_27/binding.xjb b/OMDSServiceDefinition/src/main/resources/def/r2025_27/binding.xjb
index 97f5d9bd..870b0783 100644
--- a/OMDSServiceDefinition/src/main/resources/def/r2025_27/binding.xjb
+++ b/OMDSServiceDefinition/src/main/resources/def/r2025_27/binding.xjb
@@ -4,6 +4,7 @@
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:annox="urn:jaxb.jvnet.org:annox"
+ xmlns:inheritance="urn:jaxb.jvnet.org:plugin:inheritance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jaxb https://jakarta.ee/xml/ns/jaxb/bindingschema_3_0.xsd"
jaxb:extensionBindingPrefixes="xjc annox"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
@@ -62,6 +63,17 @@
+
+
+ Die Klauseln des Deckungsbausteins.
]]>
+
+
+
+
+ Die Klauseln des Deckungsbausteins.]]>
+
+
+
@@ -126,6 +138,20 @@
Die Liste der Meldungen für diesen Deckungsbaustein.]]>
+
+
+ at.vvo.omds.client.api.VerkaufsproduktInterface
+
+
+ at.vvo.omds.client.api.UnterbausteinInterface
+
+
+ at.vvo.omds.client.api.ProduktbausteinInterface
+
+
+
+ at.vvo.omds.client.api.CommonRequest
+
@@ -406,26 +432,37 @@
-
-
- Die Klauseln des Deckungsbausteins.]]>
-
-
-
-
- Die Unterbausteine des Deckungsbausteins.]]>
-
-
-
-
- Die Attribute des Deckungsbausteins.]]>
-
-
-
-
- Die Meldungen des Deckungsbausteins.]]>
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OMDSServiceDefinition/src/main/resources/def/r2025_27/omds3CommonServiceTypes.xsd b/OMDSServiceDefinition/src/main/resources/def/r2025_27/omds3CommonServiceTypes.xsd
index 8166d3e4..7aee83a7 100644
--- a/OMDSServiceDefinition/src/main/resources/def/r2025_27/omds3CommonServiceTypes.xsd
+++ b/OMDSServiceDefinition/src/main/resources/def/r2025_27/omds3CommonServiceTypes.xsd
@@ -1719,7 +1719,13 @@
Deprecated: Das gleichnamige Element in Praemie_Type ist besser geeignet, da es auch verwendet werden kann, wenn mehrere Prämien im Response übertragen werden.
+
+
+
+ Verkaufsoffen von
+ Verkaufsoffen bis
+
@@ -1909,6 +1915,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Basistyp für ein Produkt, 2. Generation
@@ -5032,6 +5052,9 @@
+
+
+
Es gibt zwei Implementierungen für a priori: Verkaufsprodukt und Unterbaustein
@@ -5045,6 +5068,7 @@
+
diff --git a/OMDSServiceDefinition/src/main/resources/def/r2025_27/omds3_ON2_Antrag_Common.xsd b/OMDSServiceDefinition/src/main/resources/def/r2025_27/omds3_ON2_Antrag_Common.xsd
index 04c67b38..f8af73a0 100644
--- a/OMDSServiceDefinition/src/main/resources/def/r2025_27/omds3_ON2_Antrag_Common.xsd
+++ b/OMDSServiceDefinition/src/main/resources/def/r2025_27/omds3_ON2_Antrag_Common.xsd
@@ -796,7 +796,7 @@
-
+
@@ -835,48 +835,51 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Ob der Baustein optional ist. Diese Information muss vom Provider im Response zwingend zur Verfügung gestellt werden.
- Der Client muss diese Information im Request nicht schicken.
-
-
-
- Bei optionalen Bausteinen, ob es sich aus Sicht des Providers um ein Default-Element des Produktbaums handelt.
- Default-Elemente sind optionale Elemente, welche beim Vorschlag immer als inkludiert zurückgegeben werden.
-
-
- Ob der Baustein inkludiert ist. Ist vom Serviceprovider im Response immer zu befüllen. Der Client muss es nicht
- befüllen. Wenn der Client das Attribut nicht schickt, wird es als true interpretiert.
-
-
-
-
-
- Oberste Ebene von Produktbausteinen
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OMDSServiceDefinition/src/main/resources/def/r2025_27/omds3_ON2_Antrag_Kfz.xsd b/OMDSServiceDefinition/src/main/resources/def/r2025_27/omds3_ON2_Antrag_Kfz.xsd
index 8d12391a..daa8cb46 100644
--- a/OMDSServiceDefinition/src/main/resources/def/r2025_27/omds3_ON2_Antrag_Kfz.xsd
+++ b/OMDSServiceDefinition/src/main/resources/def/r2025_27/omds3_ON2_Antrag_Kfz.xsd
@@ -15,7 +15,7 @@
Typ für ein Kfz-Produktbündel, welches einem Vertrag entspricht
-
+
@@ -54,7 +54,7 @@
Typ für ein Kfz-Produkt, welches einer Vertragssparte entspricht
-
+
diff --git a/OMDSServiceDefinition/src/main/resources/logo/VVO_Logo_2024.svg b/OMDSServiceDefinition/src/main/resources/logo/VVO_Logo_2024.svg
new file mode 100644
index 00000000..2baa4613
--- /dev/null
+++ b/OMDSServiceDefinition/src/main/resources/logo/VVO_Logo_2024.svg
@@ -0,0 +1 @@
+
\ No newline at end of file