Client funktionalität mit GUI hinzugefügt. Ebene von KFZ Produkten angepasst.
This commit is contained in:
@@ -15,7 +15,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
|
||||
<maven.build.timestamp.format>yyyyMMdd</maven.build.timestamp.format>
|
||||
<timestamp>${maven.build.timestamp}</timestamp>
|
||||
|
||||
<maven.compiler.release>17</maven.compiler.release>
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
@@ -32,11 +32,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
|
||||
<version>3.12.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.7.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.7.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.6.3</version>
|
||||
@@ -45,123 +45,130 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
|
||||
</pluginManagement>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id> <!-- this is used for inheritance merges -->
|
||||
<phase>install</phase> <!-- bind to the install phase, damit source-jar und javadoc-jar mit eingepackt werden -->
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.3.1</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<addMavenDescriptor>false</addMavenDescriptor>
|
||||
<manifest>
|
||||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||
</manifest>
|
||||
<manifestEntries>
|
||||
<!-- <Revision>${SVN_REVISION}</Revision>-->
|
||||
<!-- <BuildTag>${BUILD_TAG}</BuildTag>-->
|
||||
<BuildTimestamp>${maven.build.timestamp}</BuildTimestamp>
|
||||
<JDKVersion>${maven.compiler.release}</JDKVersion>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id> <!-- this is used for inheritance merges -->
|
||||
<phase>install</phase> <!-- bind to the install phase, damit source-jar und javadoc-jar mit eingepackt werden -->
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.3.1</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<addMavenDescriptor>false</addMavenDescriptor>
|
||||
<manifest>
|
||||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||
</manifest>
|
||||
<manifestEntries>
|
||||
<!-- <Revision>${SVN_REVISION}</Revision>-->
|
||||
<!-- <BuildTag>${BUILD_TAG}</BuildTag>-->
|
||||
<BuildTimestamp>${maven.build.timestamp}</BuildTimestamp>
|
||||
<JDKVersion>${maven.compiler.release}</JDKVersion>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.19.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.19.1</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<doclint>reference</doclint>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<!-- Lizenz: Berkeley Software Distribution, frei -->
|
||||
<groupId>org.jvnet.jaxb</groupId>
|
||||
<artifactId>jaxb-maven-plugin</artifactId>
|
||||
<version>4.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<extension>true</extension>
|
||||
<locale>en</locale>
|
||||
<schemaLanguage>XMLSCHEMA</schemaLanguage>
|
||||
<schemaDirectory >${project.basedir}/src/main/resources/def/${currentReleaseDir}</schemaDirectory>
|
||||
<schemaDirectory >${project.basedir}/src/main/resources/def/${currentReleaseDir}</schemaDirectory>
|
||||
<bindingDirectory>${project.basedir}/src/main/resources/def/${currentReleaseDir}</bindingDirectory>
|
||||
<schemaIncludes>
|
||||
<include>*.xsd</include>
|
||||
</schemaIncludes>
|
||||
<bindingIncludes>
|
||||
<include>*.xjb</include>
|
||||
</bindingIncludes>
|
||||
<args>
|
||||
<arg>-Xannotate</arg>
|
||||
<arg>-Xinheritance</arg>
|
||||
</args>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jvnet.jaxb</groupId>
|
||||
<artifactId>jaxb-plugins</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jvnet.jaxb</groupId>
|
||||
<artifactId>jaxb-plugin-annotate</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<doclint>reference</doclint>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<!-- Lizenz: Berkeley Software Distribution, frei -->
|
||||
<groupId>org.jvnet.jaxb</groupId>
|
||||
<artifactId>jaxb-maven-plugin</artifactId>
|
||||
<version>4.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<extension>true</extension>
|
||||
<locale>en</locale>
|
||||
<schemaLanguage>XMLSCHEMA</schemaLanguage>
|
||||
<schemaDirectory >${project.basedir}/src/main/resources/def/${currentReleaseDir}</schemaDirectory>
|
||||
<schemaDirectory >${project.basedir}/src/main/resources/def/${currentReleaseDir}</schemaDirectory>
|
||||
<bindingDirectory>${project.basedir}/src/main/resources/def/${currentReleaseDir}</bindingDirectory>
|
||||
<schemaIncludes>
|
||||
<include>*.xsd</include>
|
||||
</schemaIncludes>
|
||||
<bindingIncludes>
|
||||
<include>*.xjb</include>
|
||||
</bindingIncludes>
|
||||
<args>
|
||||
<arg>-Xannotate</arg>
|
||||
<arg>-Xinheritance</arg>
|
||||
</args>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jvnet.jaxb</groupId>
|
||||
<artifactId>jaxb-plugins</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jvnet.jaxb</groupId>
|
||||
<artifactId>jaxb-plugin-annotate</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-maven-plugin</artifactId>
|
||||
<version>0.0.8</version>
|
||||
<configuration>
|
||||
<mainClass>${project.basedir}/src/main/java/at/vvo/omds/client/gui/AllinOneView.java</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@@ -195,6 +202,15 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
|
||||
<version>4.0.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-controls -->
|
||||
<!-- MIT License https://openjdk.java.net/legal/gplv2+ce.html-->
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-controls</artifactId>
|
||||
<version>23.0.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter -->
|
||||
<!-- MIT License https://www.eclipse.org/legal/epl-v20.html -->
|
||||
@@ -219,6 +235,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
|
||||
<version>2.0.16</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-log4j12 -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
<version>2.0.16</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- Zielordner fuer Deploy unter OMDS-Entwicklung -->
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package at.vvo.omds.client.api;
|
||||
|
||||
public interface CommonRequest {
|
||||
|
||||
/// Liefert die KorrelationsId eines Requests
|
||||
String getKorrelationsId();
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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<String, Integer> timesItemisIncludedById = new HashMap<>();
|
||||
List<TreeItem<Object>> isNotIncluded = new ArrayList<>();
|
||||
Map<TreeItem<Object>, Map<AttributType, String>> 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<String> vpBox = new ChoiceBox<>();
|
||||
|
||||
vpBox.setValue("Verkaufsprodukt auswählen ");
|
||||
vpBox.setVisible(false);
|
||||
vpBox.setPadding(new Insets(0, 10, 0, 0));
|
||||
|
||||
AtomicReference<XMLGregorianCalendar> stichtag = new AtomicReference<>();
|
||||
AtomicReference<ProductsResponse> 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<XMLGregorianCalendar> 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<Object> vkp = treeHelper.aprioriItemToCalcItem(new TreeItem<>(verkaufsprodukt));
|
||||
vkp.setExpanded(true);
|
||||
|
||||
treeHelper.messageToTree(verkaufsprodukt, vkp);
|
||||
|
||||
logFlow = treeHelper.getLogFlow();
|
||||
|
||||
TreeView<Object> 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<Object> 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<Object> parent = getTreeItem().getParent();
|
||||
TreeItem<Object> 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<String, Integer> countByParent = new HashMap<>();
|
||||
Map<String, Integer> 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<Object> cleanedRoot = treeHelper.cleanTree(tv.getRoot());
|
||||
|
||||
CalculateRequestAuskunftService s = new CalculateRequestAuskunftService(new SOAPConnector());
|
||||
CalculateResponse calcResponse = s.aprioriAuskunft(new TreeView<>(cleanedRoot), stichtag.get());
|
||||
TreeItem<Object> 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<Object> cleanTree(TreeItem<Object> original) {
|
||||
// if (isNotIncluded.contains(original)) {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// 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);
|
||||
// }
|
||||
// }
|
||||
// return newItem;
|
||||
// }
|
||||
|
||||
private void includeAddedParent(TreeItem<Object> treeItem) {
|
||||
if (treeItem.getParent() != null) {
|
||||
isNotIncluded.remove(treeItem.getParent());
|
||||
if (treeItem.getParent().getParent() != null) {
|
||||
includeAddedParent(treeItem.getParent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void includeAddedChildren(TreeItem<Object> 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<Object> clone, TreeItem<Object> 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<Object> 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<String, Integer> countChildIds(Map<String, Integer> count, TreeItem<Object> root) {
|
||||
if (root != null) {
|
||||
for (int i = 0; i < root.getChildren().size(); i++) {
|
||||
TreeItem<Object> 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<Object> root) {
|
||||
for (int i = 0; i < root.getChildren().size(); i++) {
|
||||
TreeItem<Object> 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<Object> parent, String itemId) {
|
||||
int erg = 0;
|
||||
for (int i = 0; i < parent.getChildren().size(); i++) {
|
||||
TreeItem<Object> item = parent.getChildren().get(i);
|
||||
if (((ProduktbausteinType) item.getValue()).getId().equals(itemId)) {
|
||||
if (!isNotIncluded.contains(item)) {
|
||||
erg++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return erg;
|
||||
}
|
||||
|
||||
// private TreeItem<Object> cloneTreeItem(TreeItem<Object> 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<Object> clonedItem = new TreeItem<>(cloneOriginalValue);
|
||||
//
|
||||
// for (TreeItem<Object> child : original.getChildren()) {
|
||||
// clonedItem.getChildren().add(cloneTreeItem(child));
|
||||
// }
|
||||
// return clonedItem;
|
||||
// }
|
||||
//
|
||||
// private TreeItem<Object> findTreeItem(ProduktbausteinType item, TreeItem<Object> root) {
|
||||
// if (((ProduktbausteinType) root.getValue()).getId().equals(item.getId())) {
|
||||
// return root;
|
||||
// }
|
||||
// for (TreeItem<Object> child : root.getChildren()) {
|
||||
// TreeItem<Object> found = findTreeItem(item, child);
|
||||
// if (found != null) return found;
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// public void messageToTree(APrioriProduktbausteinType produkt, TreeItem<Object> treeItem) throws Exception {
|
||||
// if (!produkt.getBausteine().isEmpty()) {
|
||||
// for (int i = 0; i < produkt.getBausteine().size(); i++) {
|
||||
// TreeItem<Object> 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<Object> treeItem) {
|
||||
// if (!produkt.getBausteine().isEmpty()) {
|
||||
// for (int i = 0; i < produkt.getBausteine().size(); i++) {
|
||||
// TreeItem<Object> 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<Object> aprioriToCalc(TreeItem<Object> produkt) throws Exception {
|
||||
//
|
||||
// TreeItem<Object> 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<Object> addAprioriToCalc(TreeItem<Object> calcItem, TreeItem<Object> aprioriItem) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
|
||||
// for (TreeItem<Object> aprioriChild : aprioriItem.getChildren()) {
|
||||
//
|
||||
// List<TreeItem<Object>> matchingChildren = calcItem.getChildren().stream()
|
||||
// .filter(c -> ((ProduktbausteinType) c.getValue()).getId().equals(((ProduktbausteinType) aprioriChild.getValue()).getId()))
|
||||
// .toList();
|
||||
//
|
||||
// if (matchingChildren.isEmpty()) {
|
||||
// TreeItem<Object> newChild = cloneTreeItem(aprioriChild);
|
||||
// calcItem.getChildren().add(newChild);
|
||||
// addAprioriToCalc(newChild, aprioriChild);
|
||||
// } else {
|
||||
// for (TreeItem<Object> matchingChild : matchingChildren) {
|
||||
// addAprioriToCalc(matchingChild, aprioriChild);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return calcItem;
|
||||
// }
|
||||
//
|
||||
// private void sortTree(TreeItem<Object> parent) {
|
||||
// FXCollections.sort(parent.getChildren(), Comparator.comparing(
|
||||
// item -> ((ProduktbausteinType) item.getValue()).getBezeichnung().toLowerCase()
|
||||
// ));
|
||||
//
|
||||
// for (TreeItem<Object> child : parent.getChildren()) {
|
||||
// sortTree(child);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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<TreeItem<Object>, Map<AttributType, String>> infoBoxFromItem = new HashMap<>();
|
||||
|
||||
public Map<TreeItem<Object>, Map<AttributType, String>> getInfoBoxFromItem() {
|
||||
return infoBoxFromItem;
|
||||
}
|
||||
public void setInfoBoxFromItem(Map<TreeItem<Object>, Map<AttributType, String>> infoBoxFromItem) {
|
||||
this.infoBoxFromItem = infoBoxFromItem;
|
||||
}
|
||||
|
||||
public VBox addItemInfo(TreeItem<Object> 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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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<String, Integer> timesItemisIncludedById = new HashMap<>();
|
||||
List<TreeItem<Object>> isNotIncluded = new ArrayList<>();
|
||||
TextFlow logFlow = new TextFlow();
|
||||
|
||||
public Map<String, Integer> getTimesItemisIncludedById() {
|
||||
return timesItemisIncludedById;
|
||||
}
|
||||
|
||||
public void setTimesItemisIncludedById(Map<String, Integer> timesItemisIncludedById) {
|
||||
this.timesItemisIncludedById = timesItemisIncludedById;
|
||||
}
|
||||
|
||||
public List<TreeItem<Object>> getIsNotIncluded() {
|
||||
return isNotIncluded;
|
||||
}
|
||||
|
||||
public void setIsNotIncluded(List<TreeItem<Object>> isNotIncluded) {
|
||||
this.isNotIncluded = isNotIncluded;
|
||||
}
|
||||
|
||||
public TextFlow getLogFlow() {
|
||||
return logFlow;
|
||||
}
|
||||
|
||||
public void setLogFlow(TextFlow logFlow) {
|
||||
this.logFlow = logFlow;
|
||||
}
|
||||
|
||||
public TreeItem<Object> cleanTree(TreeItem<Object> original) {
|
||||
if (isNotIncluded.contains(original)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
return newItem;
|
||||
}
|
||||
|
||||
public TreeItem<Object> cloneTreeItem(TreeItem<Object> 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<Object> clonedItem = new TreeItem<>(cloneOriginalValue);
|
||||
|
||||
for (TreeItem<Object> child : original.getChildren()) {
|
||||
clonedItem.getChildren().add(cloneTreeItem(child));
|
||||
}
|
||||
return clonedItem;
|
||||
}
|
||||
|
||||
public TreeItem<Object> findTreeItem(ProduktbausteinType item, TreeItem<Object> root) {
|
||||
if (((ProduktbausteinType) root.getValue()).getId().equals(item.getId())) {
|
||||
return root;
|
||||
}
|
||||
for (TreeItem<Object> child : root.getChildren()) {
|
||||
TreeItem<Object> found = findTreeItem(item, child);
|
||||
if (found != null) return found;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void messageToTree(APrioriProduktbausteinType produkt, TreeItem<Object> treeItem) throws Exception {
|
||||
if (!produkt.getBausteine().isEmpty()) {
|
||||
for (int i = 0; i < produkt.getBausteine().size(); i++) {
|
||||
TreeItem<Object> 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<Object> treeItem) {
|
||||
if (!produkt.getBausteine().isEmpty()) {
|
||||
for (int i = 0; i < produkt.getBausteine().size(); i++) {
|
||||
TreeItem<Object> 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<Object> aprioriItemToCalcItem(TreeItem<Object> produkt) throws Exception {
|
||||
|
||||
TreeItem<Object> 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<Object> addAprioriToCalc(TreeItem<Object> calcItem, TreeItem<Object> aprioriItem)
|
||||
throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
|
||||
for (TreeItem<Object> aprioriChild : aprioriItem.getChildren()) {
|
||||
|
||||
List<TreeItem<Object>> matchingChildren = calcItem.getChildren().stream()
|
||||
.filter(c -> ((ProduktbausteinType) c.getValue()).getId()
|
||||
.equals(((ProduktbausteinType) aprioriChild.getValue()).getId()))
|
||||
.toList();
|
||||
|
||||
if (matchingChildren.isEmpty()) {
|
||||
TreeItem<Object> newChild = cloneTreeItem(aprioriChild);
|
||||
calcItem.getChildren().add(newChild);
|
||||
addAprioriToCalc(newChild, aprioriChild);
|
||||
} else {
|
||||
for (TreeItem<Object> matchingChild : matchingChildren) {
|
||||
addAprioriToCalc(matchingChild, aprioriChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
return calcItem;
|
||||
}
|
||||
|
||||
public TreeItem<Object> sortTree(TreeItem<Object> parent) {
|
||||
FXCollections.sort(parent.getChildren(), Comparator.comparing(
|
||||
item -> ((ProduktbausteinType) item.getValue()).getBezeichnung().toLowerCase()
|
||||
));
|
||||
|
||||
for (TreeItem<Object> child : parent.getChildren()) {
|
||||
sortTree(child);
|
||||
}
|
||||
return parent;
|
||||
}
|
||||
}
|
||||
@@ -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<CalculateRequest> 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<ProductsRequest> 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<CalculateRequest> 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<ProductsRequest> 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<ProductsRequest> 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<CalculateRequest> 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 = "<KEY>";
|
||||
JAXBElement<ProductsRequest> 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;
|
||||
}
|
||||
}
|
||||
@@ -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<ProductsRequest> 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<ProductsRequest> createProductsRequest(ProductsRequest value) {
|
||||
return new JAXBElement<>(new QName("urn:omds3CommonServiceTypes-1-1-0","ProductsRequest"),
|
||||
ProductsRequest.class, null, value);
|
||||
}
|
||||
}
|
||||
@@ -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<CalculateRequest> buildRequestFromTreeView(TreeView<Object> 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<CalculateRequest> 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<Object> 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<Object> 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<Object> 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;
|
||||
}
|
||||
}
|
||||
@@ -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<Object> treeView, XMLGregorianCalendar vtBeg) throws Exception {
|
||||
|
||||
String token = "<KEY>";
|
||||
JAXBElement<CalculateRequest> 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;
|
||||
}
|
||||
}
|
||||
@@ -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 @@
|
||||
</jaxb:property>
|
||||
</jaxb:bindings>
|
||||
|
||||
<jaxb:bindings node="//xs:complexType[@name='BasisProduktbaustein_Type']//xs:element[@name='Attribut']">
|
||||
<jaxb:property name="Attribute">
|
||||
<jaxb:javadoc><![CDATA[<p>Die Klauseln des Deckungsbausteins.</p>]]></jaxb:javadoc>
|
||||
</jaxb:property>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xs:complexType[@name='Produktbaustein_Type']//xs:element[@name='Baustein']">
|
||||
<jaxb:property name="Bausteine">
|
||||
<jaxb:javadoc><![CDATA[<p>Die Klauseln des Deckungsbausteins.</p>]]></jaxb:javadoc>
|
||||
</jaxb:property>
|
||||
</jaxb:bindings>
|
||||
|
||||
<!-- Arrays in Envelope_Type -->
|
||||
<jaxb:bindings node="//xs:complexType[@name='Envelope_Type']//xs:element[@name='Dokument']">
|
||||
<jaxb:property name="Dokumente">
|
||||
@@ -126,6 +138,20 @@
|
||||
<jaxb:javadoc><![CDATA[<p>Die Liste der Meldungen für diesen Deckungsbaustein.</p>]]></jaxb:javadoc>
|
||||
</jaxb:property>
|
||||
</jaxb:bindings>
|
||||
|
||||
<jaxb:bindings node="//xs:complexType[@name='APrioriVerkaufsprodukt_Type']">
|
||||
<inheritance:implements>at.vvo.omds.client.api.VerkaufsproduktInterface</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xs:complexType[@name='APrioriUnterbaustein_Type']">
|
||||
<inheritance:implements>at.vvo.omds.client.api.UnterbausteinInterface</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xs:complexType[@name='APrioriProduktbaustein_Type']">
|
||||
<inheritance:implements>at.vvo.omds.client.api.ProduktbausteinInterface</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
|
||||
<jaxb:bindings node="//xs:element[@name='ProductsRequest']">
|
||||
<inheritance:implements>at.vvo.omds.client.api.CommonRequest</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
</jaxb:bindings><!-- Ende omds3CommonServiceTypes -->
|
||||
|
||||
<!-- "Quick-wins" Namespace http://omds.vvo.at/types/omds3types/v1_4_0/servicetypes -->
|
||||
@@ -406,26 +432,37 @@
|
||||
</annox:annotate>
|
||||
</bindings>
|
||||
|
||||
<jaxb:bindings node="//xs:complexType[@name='ProduktbausteinAuskunft_Type']//xs:element[@name='Klausel']">
|
||||
<jaxb:property name="Klauseln">
|
||||
<jaxb:javadoc><![CDATA[<p>Die Klauseln des Deckungsbausteins.</p>]]></jaxb:javadoc>
|
||||
</jaxb:property>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xs:complexType[@name='ProduktbausteinAuskunft_Type']//xs:element[@name='Baustein']">
|
||||
<jaxb:property name="Bausteine">
|
||||
<jaxb:javadoc><![CDATA[<p>Die Unterbausteine des Deckungsbausteins.</p>]]></jaxb:javadoc>
|
||||
</jaxb:property>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xs:complexType[@name='ProduktbausteinAuskunft_Type']//xs:element[@name='Attribut']">
|
||||
<jaxb:property name="Attribute">
|
||||
<jaxb:javadoc><![CDATA[<p>Die Attribute des Deckungsbausteins.</p>]]></jaxb:javadoc>
|
||||
</jaxb:property>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xs:complexType[@name='ProduktbausteinAuskunft_Type']//xs:element[@name='Meldung']">
|
||||
<jaxb:property name="Meldungen">
|
||||
<jaxb:javadoc><![CDATA[<p>Die Meldungen des Deckungsbausteins.</p>]]></jaxb:javadoc>
|
||||
</jaxb:property>
|
||||
</jaxb:bindings>
|
||||
<!-- <jaxb:bindings node="//xs:complexType[@name='ProduktbausteinAuskunft_Type']//xs:element[@name='Klausel']">-->
|
||||
<!-- <jaxb:property name="Klauseln">-->
|
||||
<!-- <jaxb:javadoc><![CDATA[<p>Die Klauseln des Deckungsbausteins.</p>]]></jaxb:javadoc>-->
|
||||
<!-- </jaxb:property>-->
|
||||
<!-- </jaxb:bindings>-->
|
||||
<!-- <jaxb:bindings node="//xs:complexType[@name='ProduktbausteinAuskunft_Type']//xs:element[@name='Baustein']">-->
|
||||
<!-- <jaxb:property name="Bausteine">-->
|
||||
<!-- <jaxb:javadoc><![CDATA[<p>Die Unterbausteine des Deckungsbausteins.</p>]]></jaxb:javadoc>-->
|
||||
<!-- </jaxb:property>-->
|
||||
<!-- </jaxb:bindings>-->
|
||||
<!-- <jaxb:bindings node="//xs:complexType[@name='ProduktbausteinAuskunft_Type']//xs:element[@name='Attribut']">-->
|
||||
<!-- <jaxb:property name="Attribute">-->
|
||||
<!-- <jaxb:javadoc><![CDATA[<p>Die Attribute des Deckungsbausteins.</p>]]></jaxb:javadoc>-->
|
||||
<!-- </jaxb:property>-->
|
||||
<!-- </jaxb:bindings>-->
|
||||
<!-- <jaxb:bindings node="//xs:complexType[@name='ProduktbausteinAuskunft_Type']//xs:element[@name='Meldung']">-->
|
||||
<!-- <jaxb:property name="Meldungen">-->
|
||||
<!-- <jaxb:javadoc><![CDATA[<p>Die Meldungen des Deckungsbausteins.</p>]]></jaxb:javadoc>-->
|
||||
<!-- </jaxb:property>-->
|
||||
<!-- </jaxb:bindings>-->
|
||||
|
||||
<!-- <jaxb:bindings node="//xs:complexType[@name='VerkaufsproduktAuskunft_Type']">-->
|
||||
<!-- <inheritance:implements>at.vvo.omds.client.api.VerkaufsproduktInterface</inheritance:implements>-->
|
||||
<!-- </jaxb:bindings>-->
|
||||
<!-- <jaxb:bindings node="//xs:complexType[@name='UnterbausteinAuskunft_Type']">-->
|
||||
<!-- <inheritance:implements>at.vvo.omds.client.api.UnterbausteinInterface</inheritance:implements>-->
|
||||
<!-- </jaxb:bindings>-->
|
||||
<!-- <jaxb:bindings node="//xs:complexType[@name='ProduktbausteinAuskunft_Type']">-->
|
||||
<!-- <inheritance:implements>at.vvo.omds.client.api.ProduktbausteinInterface</inheritance:implements>-->
|
||||
<!-- </jaxb:bindings>-->
|
||||
|
||||
</jaxb:bindings><!-- Ende Antrag Common -->
|
||||
|
||||
<!-- Antrag Kfz -->
|
||||
|
||||
@@ -1719,7 +1719,13 @@
|
||||
<xsd:documentation>Deprecated: Das gleichnamige Element in Praemie_Type ist besser geeignet, da es auch verwendet werden kann, wenn mehrere Prämien im Response übertragen werden.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="Baustein" type="Produktbaustein_Type" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="MinVorkommen" type="xsd:int" />
|
||||
<xsd:attribute name="MaxVorkommen" type="xsd:int" />
|
||||
<xsd:attribute name="VerkaufsoffenVon" type="xsd:date" ><xsd:annotation><xsd:documentation>Verkaufsoffen von</xsd:documentation></xsd:annotation></xsd:attribute>
|
||||
<xsd:attribute name="VerkaufsoffenBis" type="xsd:date" ><xsd:annotation><xsd:documentation>Verkaufsoffen bis</xsd:documentation></xsd:annotation></xsd:attribute>
|
||||
<xsd:attribute name="Typ" type="xsd:string" />
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
@@ -1909,6 +1915,20 @@
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="VerkaufsproduktAllgemein_Type">
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="VerkaufsproduktGenerisch_Type"/>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ProduktAllgemein_Type">
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="ProduktGenerisch_Type"/>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="ProduktGenerisch_Type" abstract="true">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>Basistyp für ein Produkt, 2. Generation</xsd:documentation>
|
||||
@@ -5032,6 +5052,9 @@
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="from" type="xsd:date" use="required" />
|
||||
<xsd:attribute name="to" type="xsd:date" />
|
||||
<xsd:attribute name="minOccurrences" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="maxOccurrences" type="xsd:int" />
|
||||
<xsd:attribute name="type" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
<xsd:annotation><xsd:documentation>Es gibt zwei Implementierungen für a priori: Verkaufsprodukt und Unterbaustein</xsd:documentation></xsd:annotation>
|
||||
<xsd:complexType name="APrioriUnterbaustein_Type">
|
||||
@@ -5045,6 +5068,7 @@
|
||||
<xsd:complexType name="APrioriVerkaufsprodukt_Type">
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="APrioriProduktbaustein_Type">
|
||||
<!-- <xsd:attribute name="vtgbeg" type="xsd:date" use="required"/>-->
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
@@ -796,7 +796,7 @@
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="SpezBerechnung_Type">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Verkaufsprodukt" type="VerkaufsproduktAuskunft_Type"/>
|
||||
<xsd:element name="Verkaufsprodukt" type="cst:Verkaufsprodukt_Type"/>
|
||||
</xsd:sequence>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
@@ -835,48 +835,51 @@
|
||||
<!-- <xsd:documentation>Responseobjekt für die Berechnung</xsd:documentation>-->
|
||||
<!-- </xsd:annotation>-->
|
||||
<!-- </xsd:element>-->
|
||||
<xsd:complexType name="ProduktbausteinAuskunft_Type" abstract="true">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Klausel" type="omds:KLAUSEL_Type" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xsd:element name="Baustein" type="UnterbausteinAuskunft_Type" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element name="Attribut" type="cst:Attribut_Type" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xsd:element name="Meldung" type="cst:ServiceFault" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="id" type="xsd:unsignedLong" />
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="from" type="xsd:date" />
|
||||
<xsd:attribute name="to" type="xsd:date" />
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="UnterbausteinAuskunft_Type">
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="ProduktbausteinAuskunft_Type">
|
||||
<xsd:attribute name="optional" type="xsd:boolean" >
|
||||
<xsd:annotation><xsd:documentation>
|
||||
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.
|
||||
</xsd:documentation></xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="default" type="xsd:boolean" ><xsd:annotation><xsd:documentation>
|
||||
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.
|
||||
</xsd:documentation></xsd:annotation></xsd:attribute>
|
||||
<xsd:attribute name="included" type="xsd:boolean" ><xsd:annotation><xsd:documentation>
|
||||
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.
|
||||
</xsd:documentation></xsd:annotation></xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="VerkaufsproduktAuskunft_Type">
|
||||
<xsd:annotation><xsd:documentation>Oberste Ebene von Produktbausteinen</xsd:documentation></xsd:annotation>
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="ProduktbausteinAuskunft_Type">
|
||||
<xsd:sequence>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="vtgbeg" type="xsd:date" use="required"/>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
<!-- <xsd:complexType name="ProduktbausteinAuskunft_Type" abstract="true">-->
|
||||
<!-- <xsd:sequence>-->
|
||||
<!-- <xsd:element name="Klausel" type="omds:KLAUSEL_Type" minOccurs="0" maxOccurs="unbounded" />-->
|
||||
<!-- <xsd:element name="Baustein" type="UnterbausteinAuskunft_Type" minOccurs="0" maxOccurs="unbounded"/>-->
|
||||
<!-- <xsd:element name="Attribut" type="cst:Attribut_Type" minOccurs="0" maxOccurs="unbounded" />-->
|
||||
<!-- <xsd:element name="Meldung" type="cst:ServiceFault" minOccurs="0" maxOccurs="unbounded" />-->
|
||||
<!-- </xsd:sequence>-->
|
||||
<!-- <xsd:attribute name="id" type="xsd:string" />-->
|
||||
<!-- <xsd:attribute name="name" type="xsd:string" use="required" />-->
|
||||
<!-- <xsd:attribute name="from" type="xsd:date" />-->
|
||||
<!-- <xsd:attribute name="to" type="xsd:date" />-->
|
||||
<!-- <xsd:attribute name="minOccurrences" type="xsd:int" use="required"/>-->
|
||||
<!-- <xsd:attribute name="maxOccurrences" type="xsd:int" />-->
|
||||
<!-- <xsd:attribute name="type" type="xsd:string" />-->
|
||||
<!-- </xsd:complexType>-->
|
||||
<!-- <xsd:complexType name="UnterbausteinAuskunft_Type">-->
|
||||
<!-- <xsd:complexContent>-->
|
||||
<!-- <xsd:extension base="ProduktbausteinAuskunft_Type">-->
|
||||
<!-- <xsd:attribute name="optional" type="xsd:boolean" >-->
|
||||
<!-- <xsd:annotation><xsd:documentation>-->
|
||||
<!-- 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.-->
|
||||
<!-- </xsd:documentation></xsd:annotation>-->
|
||||
<!-- </xsd:attribute>-->
|
||||
<!-- <xsd:attribute name="default" type="xsd:boolean" ><xsd:annotation><xsd:documentation>-->
|
||||
<!-- 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.-->
|
||||
<!-- </xsd:documentation></xsd:annotation></xsd:attribute>-->
|
||||
<!-- <xsd:attribute name="included" type="xsd:boolean" ><xsd:annotation><xsd:documentation>-->
|
||||
<!-- 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.-->
|
||||
<!-- </xsd:documentation></xsd:annotation></xsd:attribute>-->
|
||||
<!-- </xsd:extension>-->
|
||||
<!-- </xsd:complexContent>-->
|
||||
<!-- </xsd:complexType>-->
|
||||
<!-- <xsd:complexType name="VerkaufsproduktAuskunft_Type">-->
|
||||
<!-- <xsd:annotation><xsd:documentation>Oberste Ebene von Produktbausteinen</xsd:documentation></xsd:annotation>-->
|
||||
<!-- <xsd:complexContent>-->
|
||||
<!-- <xsd:extension base="ProduktbausteinAuskunft_Type">-->
|
||||
<!-- <xsd:sequence>-->
|
||||
<!-- </xsd:sequence>-->
|
||||
<!-- <xsd:attribute name="vtgbeg" type="xsd:date" use="required"/>-->
|
||||
<!-- </xsd:extension>-->
|
||||
<!-- </xsd:complexContent>-->
|
||||
<!-- </xsd:complexType>-->
|
||||
|
||||
|
||||
</xsd:schema>
|
||||
@@ -15,7 +15,7 @@
|
||||
<xsd:documentation>Typ für ein Kfz-Produktbündel, welches einem Vertrag entspricht</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="cst:Verkaufsprodukt_Type">
|
||||
<xsd:extension base="cst:VerkaufsproduktGenerisch_Type">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Gebdat" type="xsd:date" minOccurs="0">
|
||||
<xsd:annotation>
|
||||
@@ -54,7 +54,7 @@
|
||||
<xsd:documentation>Typ für ein Kfz-Produkt, welches einer Vertragssparte entspricht</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="cst:Produkt_Type">
|
||||
<xsd:extension base="cst:ProduktGenerisch_Type">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Haftpflicht" type="HaftpflichtKfz_Type" minOccurs="0"/>
|
||||
<xsd:choice>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg width="1144" height="388" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" overflow="hidden"><g transform="translate(-68 -166)"><path d="M326.308 12.6085 220.397 224.936 113.477 12.6085 12.6085 12.6085 172.989 344.465C180.554 360.603 196.693 371.195 213.336 371.195 229.979 371.195 246.118 360.603 253.683 344.465L416.081 12.6085 326.308 12.6085Z" fill="#101820" transform="matrix(1.00014 0 0 1 68 167.09)"/><path d="M778.702 12.6085 672.286 224.936 565.366 12.6085 464.498 12.6085 624.878 344.465C632.443 360.603 648.582 371.195 665.225 371.195 682.373 371.195 698.007 360.603 705.572 344.465L867.97 12.6085 778.702 12.6085 778.702 12.6085Z" fill="#101820" transform="matrix(1.00014 0 0 1 68 167.09)"/><path d="M1062.14 114.99C1018.26 114.99 993.551 149.285 993.551 191.649 993.551 234.014 1018.26 268.309 1062.14 268.309 1106.02 268.309 1131.24 234.014 1131.24 191.649 1131.24 149.285 1106.02 114.99 1062.14 114.99Z" fill="#80BC00" transform="matrix(1.00014 0 0 1 68 167.09)"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
Reference in New Issue
Block a user