Plausi verarbeitung hinzugefügt. IsNotIncluded Liste durch GUIProdukt Klasse ersetzt. View um Risikoobjekte hinzuzufügen erstellt.
This commit is contained in:
@@ -118,48 +118,90 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
|
||||
</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>
|
||||
<!-- Lizenz: Berkeley Software Distribution, frei -->
|
||||
<groupId>org.jvnet.jaxb</groupId>
|
||||
<artifactId>jaxb-maven-plugin</artifactId>
|
||||
<version>4.0.0</version>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-codegen-plugin</artifactId>
|
||||
<version>4.1.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-sources</id>
|
||||
<phase>generate-sources</phase>
|
||||
<configuration>
|
||||
<sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
|
||||
<wsdlOptions>
|
||||
<wsdlOption>
|
||||
<wsdl>${project.basedir}/src/main/resources/def/${currentReleaseDir}/omds3Services.wsdl</wsdl>
|
||||
<extraargs>
|
||||
<extraarg>-xjc-Xannotate</extraarg>
|
||||
<extraarg>-client</extraarg>
|
||||
<extraarg>-impl</extraarg>
|
||||
<extraarg>-server</extraarg>
|
||||
<extraarg>-p</extraarg>
|
||||
<extraarg>at.vvo.omds.services</extraarg>
|
||||
</extraargs>
|
||||
<bindingFiles>
|
||||
<bindingFile>${project.basedir}/src/main/resources/def/${currentReleaseDir}/binding.xjb</bindingFile>
|
||||
</bindingFiles>
|
||||
</wsdlOption>
|
||||
</wsdlOptions>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
<goal>wsdl2java</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>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jvnet.jaxb</groupId>
|
||||
<artifactId>jaxb-plugin-annotate</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
@@ -167,7 +209,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
|
||||
<artifactId>javafx-maven-plugin</artifactId>
|
||||
<version>0.0.8</version>
|
||||
<configuration>
|
||||
<mainClass>at.vvo.omds.client.gui.AllinOneView</mainClass>
|
||||
<mainClass>at.vvo.omds.client.gui.AllinOneView</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
@@ -205,12 +247,77 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
|
||||
|
||||
<dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-controls -->
|
||||
<!-- MIT License https://openjdk.java.net/legal/gplv2+ce.html-->
|
||||
<!-- GPLv2+CE 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.controlsfx/controlsfx -->
|
||||
<!-- The 3-Clause BSD License http://www.opensource.org/licenses/bsd-license.php -->
|
||||
<groupId>org.controlsfx</groupId>
|
||||
<artifactId>controlsfx</artifactId>
|
||||
<version>11.2.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.jvnet.jaxb2_commons/jaxb2-basics-annotate -->
|
||||
<!-- BSD 2-Clause License http://opensource.org/licenses/BSD-2-Clause-->
|
||||
<groupId>org.jvnet.jaxb2_commons</groupId>
|
||||
<artifactId>jaxb2-basics-annotate</artifactId>
|
||||
<version>1.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.sun.xml.ws/jaxws-maven-plugin -->
|
||||
<!-- The Apache Software License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.txt -->
|
||||
<groupId>com.sun.xml.ws</groupId>
|
||||
<artifactId>jaxws-maven-plugin</artifactId>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-restclient -->
|
||||
<!-- The Apache Software License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.txt -->
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-restclient</artifactId>
|
||||
<version>4.0.0-M3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
|
||||
<!-- The Apache Software License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.txt -->
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.eclipse.rdf4j/rdf4j-model -->
|
||||
<!-- Eclipse Distribution License v1.0 https://eclipse.org/org/documents/edl-v10.php-->
|
||||
<groupId>org.eclipse.rdf4j</groupId>
|
||||
<artifactId>rdf4j-model</artifactId>
|
||||
<version>5.1.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.eclipse.rdf4j/rdf4j-rio-turtle -->
|
||||
<!-- Eclipse Distribution License v1.0 https://eclipse.org/org/documents/edl-v10.php-->
|
||||
<groupId>org.eclipse.rdf4j</groupId>
|
||||
<artifactId>rdf4j-rio-turtle</artifactId>
|
||||
<version>5.1.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.eclipse.rdf4j/rdf4j-shacl -->
|
||||
<!-- Eclipse Distribution License v1.0 https://eclipse.org/org/documents/edl-v10.php-->
|
||||
<groupId>org.eclipse.rdf4j</groupId>
|
||||
<artifactId>rdf4j-shacl</artifactId>
|
||||
<version>5.1.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.eclipse.rdf4j/rdf4j-rio-jsonld -->
|
||||
<!-- Eclipse Distribution License v1.0 https://eclipse.org/org/documents/edl-v10.php-->
|
||||
<groupId>org.eclipse.rdf4j</groupId>
|
||||
<artifactId>rdf4j-rio-jsonld</artifactId>
|
||||
<version>5.1.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter -->
|
||||
|
||||
@@ -37,8 +37,6 @@ public class BuildRequestHelper {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static XMLGregorianCalendar aktuellesDatum() {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("uuuu-MM-dd'T'HH:mm:ss");
|
||||
try {
|
||||
|
||||
@@ -18,10 +18,22 @@ import javafx.scene.layout.*;
|
||||
import javafx.scene.paint.Paint;
|
||||
import javafx.scene.text.*;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.util.Pair;
|
||||
import org.controlsfx.control.ToggleSwitch;
|
||||
import org.eclipse.rdf4j.model.Model;
|
||||
import org.eclipse.rdf4j.query.GraphQuery;
|
||||
import org.eclipse.rdf4j.query.QueryResults;
|
||||
import org.eclipse.rdf4j.repository.Repository;
|
||||
import org.eclipse.rdf4j.repository.RepositoryConnection;
|
||||
import org.eclipse.rdf4j.repository.sail.SailRepository;
|
||||
import org.eclipse.rdf4j.rio.RDFFormat;
|
||||
import org.eclipse.rdf4j.rio.Rio;
|
||||
import org.eclipse.rdf4j.sail.memory.MemoryStore;
|
||||
|
||||
import javax.xml.datatype.DatatypeConfigurationException;
|
||||
import javax.xml.datatype.DatatypeFactory;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
@@ -31,10 +43,12 @@ 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<>();
|
||||
Map<TreeItem<GuiProdukt>, Map<AttributType, String>> infoBoxFromItem = new HashMap<>();
|
||||
List<Plausi> plausiList = new ArrayList<>();
|
||||
|
||||
RisikoobjektView risikoobjektView = new RisikoobjektView();
|
||||
TreeHelper treeHelper = new TreeHelper();
|
||||
RDFHelper rdfHelper = new RDFHelper();
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
@@ -42,11 +56,50 @@ public class AllinOneView extends Application {
|
||||
|
||||
@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")));
|
||||
|
||||
TabPane tabPane = new TabPane();
|
||||
Tab baumView = new Tab("Deckungsbaum");
|
||||
Tab risikoView = new Tab("Risikoobjekte");
|
||||
|
||||
baumView.setClosable(false);
|
||||
risikoView.setClosable(false);
|
||||
|
||||
tabPane.getTabs().addAll(baumView, risikoView);
|
||||
|
||||
BorderPane content = new BorderPane();
|
||||
StackPane view = new StackPane();
|
||||
GridPane risikoobjekt = risikoobjektView.risikoobjekte();
|
||||
VBox deckungsbaum = deckungsbaum();
|
||||
|
||||
content.setTop(tabPane);
|
||||
content.setCenter(view);
|
||||
|
||||
view.getChildren().addAll(risikoobjekt ,deckungsbaum);
|
||||
risikoobjekt.setVisible(false);
|
||||
|
||||
|
||||
tabPane.getSelectionModel().selectedItemProperty().addListener((obs, oldTab, newTab) -> {
|
||||
if (newTab == risikoView) {
|
||||
risikoobjekt.setVisible(true);
|
||||
deckungsbaum.setVisible(false);
|
||||
} else if (newTab == baumView) {
|
||||
risikoobjekt.setVisible(false);
|
||||
deckungsbaum.setVisible(true);
|
||||
}
|
||||
});
|
||||
|
||||
Scene scene = new Scene(content, 900, 600);
|
||||
stage.setScene(scene);
|
||||
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public VBox deckungsbaum(){
|
||||
AprioriAuskunftService s = new AprioriAuskunftService(new SOAPConnector());
|
||||
|
||||
final VBox[] controlBox = {new VBox()};
|
||||
DatePicker dp = new DatePicker();
|
||||
ChoiceBox<String> vpBox = new ChoiceBox<>();
|
||||
@@ -62,60 +115,107 @@ public class AllinOneView extends Application {
|
||||
newCalcRequestControlBox.setVisible(false);
|
||||
newCalcRequestControlBox.setPadding(new Insets(10, 10, 10, 10));
|
||||
newCalcRequestControlBox.getChildren().add(newCalcRequestButton);
|
||||
|
||||
HBox servBox = new HBox();
|
||||
ToggleSwitch serverBtn = new ToggleSwitch("Benutze RDF Messaging");
|
||||
serverBtn.setSelected(true);
|
||||
serverBtn.setDisable(true);
|
||||
|
||||
AtomicReference<List<APrioriVerkaufsproduktType>> responseproduct = new AtomicReference<>(new ArrayList<>());
|
||||
|
||||
dp.setOnAction(e -> {
|
||||
try {
|
||||
stichtag.set(stichtagEvent(dp));
|
||||
if (stichtagEvent(dp) != null) {
|
||||
try {
|
||||
response.set(s.aprioriAuskunft(stichtag.get(), "042"));
|
||||
} catch (NoSuchElementException ex) {
|
||||
controlBox[0].getChildren().clear();
|
||||
controlBox[0].getChildren().add(dp);
|
||||
vpBox.getItems().clear();
|
||||
Pair<List<APrioriVerkaufsproduktType>, List<Plausi>> aprioriPair = s.aprioriRDFAuskunft(stichtag.get(), "042");
|
||||
responseproduct.set(aprioriPair.getKey());
|
||||
plausiList = aprioriPair.getValue();
|
||||
|
||||
Label label = new Label("Kein Verkaufsoffenes Produkt an dem Datum: " +
|
||||
stichtag.get().toString().substring(0, stichtag.get().toString().length() - 1) +
|
||||
System.lineSeparator());
|
||||
controlBox[0].getChildren().add(3, label);
|
||||
throw new NoSuchElementException(ex.getMessage());
|
||||
} catch (SOAPExceptionImpl ex) {
|
||||
HBox errorBox = new HBox();
|
||||
errorBox.setAlignment(Pos.CENTER);
|
||||
errorBox.setPadding(new Insets(10, 10, 10, 10));
|
||||
errorBox.getChildren().add(new Text("Keine Verbindung zum Server möglich!"));
|
||||
newCalcRequestControlBox.setVisible(true);
|
||||
|
||||
controlBox[0].getChildren().add(errorBox);
|
||||
}
|
||||
newCalcRequestControlBox.setVisible(true);
|
||||
if (responseproduct.get().size() > 1) {
|
||||
if (!vpBox.getItems().isEmpty()) {
|
||||
vpBox.getItems().clear();
|
||||
}
|
||||
for (APrioriVerkaufsproduktType vp : responseproduct.get()) {
|
||||
vpBox.getItems().add(vp.getName());
|
||||
}
|
||||
vpBox.setVisible(true);
|
||||
vpBox.setOnAction(ee -> {
|
||||
for (int i = 0; i < responseproduct.get().size(); i++) {
|
||||
if (vpBox.getSelectionModel().getSelectedItem() != null && vpBox.getSelectionModel()
|
||||
.getSelectedItem().equals(responseproduct.get().get(i).getName())) {
|
||||
try {
|
||||
controlBox[0] = buttonAuskunft(responseproduct.get().get(i),
|
||||
controlBox[0], newCalcRequestButton, stichtag, serverBtn);
|
||||
controlBox[0].getChildren().add(newCalcRequestControlBox);
|
||||
|
||||
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);
|
||||
} catch (Exception ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
controlBox[0] = buttonAuskunft(responseproduct.get().getFirst(),
|
||||
controlBox[0], newCalcRequestButton, stichtag, serverBtn);
|
||||
}
|
||||
} catch (Exception rdfex) {
|
||||
serverBtn.setSelected(false);
|
||||
|
||||
try {
|
||||
response.set(s.aprioriAuskunft(stichtag.get(), "042"));
|
||||
|
||||
newCalcRequestControlBox.setVisible(true);
|
||||
if (response.get() != null && 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, serverBtn);
|
||||
controlBox[0].getChildren().add(newCalcRequestControlBox);
|
||||
|
||||
} catch (Exception ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
controlBox[0] = buttonAuskunft(response.get().getVerkaufsprodukt().getFirst(),
|
||||
controlBox[0], newCalcRequestButton, stichtag, serverBtn);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
controlBox[0] = buttonAuskunft(response.get().getVerkaufsprodukt().getFirst(),
|
||||
controlBox[0], newCalcRequestButton, stichtag);
|
||||
} catch (NoSuchElementException ex) {
|
||||
controlBox[0].getChildren().clear();
|
||||
controlBox[0].getChildren().add(dp);
|
||||
vpBox.getItems().clear();
|
||||
|
||||
Label label = new Label("Kein Verkaufsoffenes Produkt an dem Datum: " +
|
||||
stichtag.get().toString().substring(0, stichtag.get().toString().length() - 1) +
|
||||
System.lineSeparator());
|
||||
controlBox[0].getChildren().add(3, label);
|
||||
throw new NoSuchElementException(ex.getMessage());
|
||||
} catch (SOAPExceptionImpl ex) {
|
||||
HBox errorBox = new HBox();
|
||||
errorBox.setAlignment(Pos.CENTER);
|
||||
errorBox.setPadding(new Insets(10, 10, 10, 10));
|
||||
errorBox.getChildren().add(new Text("Keine Verbindung zu einer Rdf oder SOAP Schnittstelle möglich!"));
|
||||
|
||||
controlBox[0].getChildren().add(errorBox);
|
||||
}
|
||||
}
|
||||
|
||||
if (!controlBox[0].getChildren().contains(newCalcRequestControlBox)) {
|
||||
controlBox[0].getChildren().add(newCalcRequestControlBox);
|
||||
}
|
||||
@@ -139,19 +239,22 @@ public class AllinOneView extends Application {
|
||||
|
||||
VBox.setVgrow(newCalcRequestControlBox, Priority.ALWAYS);
|
||||
newCalcRequestControlBox.setAlignment(Pos.BOTTOM_RIGHT);
|
||||
newCalcRequestControlBox.setId("newCalcRequestControlBox");
|
||||
|
||||
servBox.getChildren().add(serverBtn);
|
||||
servBox.setAlignment(Pos.TOP_RIGHT);
|
||||
|
||||
HBox aprioriControlBox = new HBox();
|
||||
Region region = new Region();
|
||||
HBox.setHgrow(region, Priority.ALWAYS);
|
||||
aprioriControlBox.setPadding(new Insets(10, 10, 0, 10));
|
||||
aprioriControlBox.getChildren().addAll(dp, vpBox);
|
||||
aprioriControlBox.getChildren().addAll(dp, vpBox, region, servBox);
|
||||
|
||||
controlBox[0].getChildren().addAll(aprioriControlBox);
|
||||
|
||||
Scene scene = new Scene(controlBox[0], 900, 600);
|
||||
stage.setScene(scene);
|
||||
|
||||
stage.show();
|
||||
return controlBox[0];
|
||||
}
|
||||
|
||||
|
||||
public XMLGregorianCalendar stichtagEvent(DatePicker dp) throws DatatypeConfigurationException {
|
||||
if (dp.getValue() == null) {
|
||||
return null;
|
||||
@@ -164,7 +267,7 @@ public class AllinOneView extends Application {
|
||||
}
|
||||
|
||||
public VBox buttonAuskunft(APrioriVerkaufsproduktType verkaufsprodukt, VBox vbox, Button newCalcRequest,
|
||||
AtomicReference<XMLGregorianCalendar> stichtag) throws Exception {
|
||||
AtomicReference<XMLGregorianCalendar> stichtag, ToggleSwitch serverBtn) throws Exception {
|
||||
while (vbox.getChildren().size() > 1) {
|
||||
vbox.getChildren().removeLast();
|
||||
}
|
||||
@@ -172,24 +275,28 @@ public class AllinOneView extends Application {
|
||||
VBox treeBox = new VBox();
|
||||
VBox infoBox = new VBox();
|
||||
|
||||
TreeItem<Object> vkp = treeHelper.aprioriItemToCalcItem(new TreeItem<>(verkaufsprodukt));
|
||||
TreeItem<GuiProdukt> vkp = treeHelper.aprioriItemToCalcItem(new TreeItem<>(new GuiProdukt(verkaufsprodukt)));
|
||||
vkp.setExpanded(true);
|
||||
|
||||
treeHelper.messageToTree(verkaufsprodukt, vkp);
|
||||
treeHelper.aprioriProduktToTree(verkaufsprodukt, vkp);
|
||||
|
||||
TreeView<Object> tv = new TreeView<>(vkp);
|
||||
TreeView<GuiProdukt> 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();
|
||||
itemAttribute.setRisikoobjekte(risikoobjektView.getRisikoobjekte());
|
||||
if (!infoBoxFromItem.isEmpty()) itemAttribute.setInfoBoxFromItem(infoBoxFromItem);
|
||||
|
||||
itemAttribute.addItemInfo(newSelection, infoBox);
|
||||
if (newSelection.getValue() instanceof VerkaufsproduktType){
|
||||
itemAttribute.addVpInfo(infoBox, isMeldungVorhanden((ProduktbausteinType) newSelection.getValue(), tv), (VerkaufsproduktType) newSelection.getValue());
|
||||
if (newSelection.getValue().getProdukt() instanceof VerkaufsproduktType){
|
||||
itemAttribute.addVpInfo(infoBox, isMeldungVorhanden((ProduktbausteinType) newSelection.getValue().getProdukt(), tv), (VerkaufsproduktType) newSelection.getValue().getProdukt());
|
||||
}
|
||||
infoBoxFromItem = itemAttribute.getInfoBoxFromItem();
|
||||
}else{
|
||||
@@ -197,10 +304,10 @@ public class AllinOneView extends Application {
|
||||
}
|
||||
});
|
||||
|
||||
final TreeItem<Object> originalRoot = treeHelper.cloneTreeItem(tv.getRoot());
|
||||
final TreeItem<GuiProdukt> originalRoot = treeHelper.cloneTreeItem(tv.getRoot());
|
||||
tv.setCellFactory(tc -> new TreeCell<>() {
|
||||
@Override
|
||||
public void updateItem(Object item, boolean empty) {
|
||||
public void updateItem(GuiProdukt item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
|
||||
if (item == null || empty) {
|
||||
@@ -211,7 +318,7 @@ public class AllinOneView extends Application {
|
||||
HBox cellBox = new HBox();
|
||||
Button include = new Button("+");
|
||||
include.setStyle("-fx-margin: 5;");
|
||||
Label label = new Label(((ProduktbausteinType) item).getBezeichnung() + " ");
|
||||
Label label = new Label(((ProduktbausteinType) item.getProdukt()).getBezeichnung() + " ");
|
||||
Button remove = new Button("-");
|
||||
|
||||
remove.setVisible(true);
|
||||
@@ -224,8 +331,8 @@ public class AllinOneView extends Application {
|
||||
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());
|
||||
if (!(getTreeItem().getValue().isNotIncluded())) {
|
||||
getTreeItem().getValue().setNotIncluded(true);
|
||||
}
|
||||
remove.setDisable(true);
|
||||
remove.setStyle("-fx-background-color: #CCCCCC");
|
||||
@@ -233,7 +340,7 @@ public class AllinOneView extends Application {
|
||||
label.setTextFill(Paint.valueOf("#000000"));
|
||||
remove.setVisible(true);
|
||||
|
||||
isNotIncluded.remove(getTreeItem());
|
||||
getTreeItem().getValue().setNotIncluded(false);
|
||||
}
|
||||
|
||||
Region spacer = new Region();
|
||||
@@ -242,15 +349,15 @@ public class AllinOneView extends Application {
|
||||
|
||||
label.setMaxWidth(Double.MAX_VALUE);
|
||||
|
||||
if (getTreeItem().getValue() instanceof VerkaufsproduktType ||
|
||||
if (getTreeItem().getValue().getProdukt() instanceof VerkaufsproduktType ||
|
||||
getTreeItem().getValue().getClass().equals(APrioriVerkaufsproduktType.class)) {
|
||||
cellBox.getChildren().addAll(label);
|
||||
} else if (timesItemisIncludedById.get(
|
||||
((ProduktbausteinType) getTreeItem().getValue()).getId()) != null
|
||||
&& ((ProduktbausteinType) getTreeItem().getValue()).getMaxVorkommen() != null
|
||||
&& ((ProduktbausteinType) getTreeItem().getValue()).getMaxVorkommen() <=
|
||||
((ProduktbausteinType) getTreeItem().getValue().getProdukt()).getId()) != null
|
||||
&& ((ProduktbausteinType) getTreeItem().getValue().getProdukt()).getMaxVorkommen() != null
|
||||
&& ((ProduktbausteinType) getTreeItem().getValue().getProdukt()).getMaxVorkommen() <=
|
||||
timeItemIsIncludedByParent(getTreeItem().getParent(),
|
||||
((ProduktbausteinType) getTreeItem().getValue()).getId())) {
|
||||
((ProduktbausteinType) getTreeItem().getValue().getProdukt()).getId())) {
|
||||
include.setDisable(true);
|
||||
include.setStyle("-fx-background-color: #CCCCCC");
|
||||
cellBox.getChildren().addAll(label, spacer, include, spacer2, remove);
|
||||
@@ -259,18 +366,18 @@ public class AllinOneView extends Application {
|
||||
}
|
||||
|
||||
include.setOnAction(e -> {
|
||||
if (isNotIncluded.contains(getTreeItem())) {
|
||||
if (getTreeItem().getValue().isNotIncluded()) {
|
||||
label.setFont(Font.font("System", label.getFont().getSize()));
|
||||
label.setTextFill(Paint.valueOf("#000000"));
|
||||
remove.setVisible(true);
|
||||
|
||||
timesItemisIncludedById.put(((ProduktbausteinType) getTreeItem().getValue()).getId(),
|
||||
timesItemisIncludedById.put(((ProduktbausteinType) getTreeItem().getValue().getProdukt()).getId(),
|
||||
(timesItemisIncludedById.get(
|
||||
((ProduktbausteinType) getTreeItem().getValue()).getId()) != null ?
|
||||
((ProduktbausteinType) getTreeItem().getValue().getProdukt()).getId()) != null ?
|
||||
timesItemisIncludedById.get(
|
||||
((ProduktbausteinType) getTreeItem().getValue()).getId()) + 1 : 1));
|
||||
((ProduktbausteinType) getTreeItem().getValue().getProdukt()).getId()) + 1 : 1));
|
||||
|
||||
isNotIncluded.remove(getTreeItem());
|
||||
getTreeItem().getValue().setNotIncluded(false);
|
||||
includeAddedParent(getTreeItem());
|
||||
includeAddedChildren(getTreeItem());
|
||||
tv.setRoot(treeHelper.sortTree(tv.getRoot()));
|
||||
@@ -278,24 +385,40 @@ public class AllinOneView extends Application {
|
||||
timesItemisIncludedById.clear();
|
||||
refreshTimesItemisIncludedById(tv.getRoot());
|
||||
} else {
|
||||
TreeItem<Object> parent = getTreeItem().getParent();
|
||||
TreeItem<Object> clone = null;
|
||||
TreeItem<GuiProdukt> parent = getTreeItem().getParent();
|
||||
TreeItem<GuiProdukt> clone = null;
|
||||
try {
|
||||
clone = treeHelper.cloneTreeItem(
|
||||
treeHelper.findTreeItem((ProduktbausteinType) item, originalRoot));
|
||||
treeHelper.findTreeItem((ProduktbausteinType) item.getProdukt(), 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();
|
||||
}
|
||||
|
||||
VerkaufsproduktType neuRoot = checkPlausis(plausiList, tv.getRoot());
|
||||
TreeItem<GuiProdukt> newRoot = new TreeItem<>(new GuiProdukt(neuRoot));
|
||||
newRoot.setExpanded(true);
|
||||
|
||||
try {
|
||||
treeHelper.produktToTree(neuRoot, newRoot);
|
||||
|
||||
TreeItem<GuiProdukt> abc = new TreeItem<>();
|
||||
|
||||
treeHelper.aprioriProduktToTree(verkaufsprodukt, abc);
|
||||
|
||||
tv.setRoot(treeHelper.sortTree(treeHelper.addAprioriToCalc(newRoot, abc)));
|
||||
// tv.setRoot(treeHelper.sortTree(newRoot));
|
||||
tv.refresh();
|
||||
} catch (Exception ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
});
|
||||
|
||||
remove.setOnAction(e -> {
|
||||
@@ -303,18 +426,18 @@ public class AllinOneView extends Application {
|
||||
Map<String, Integer> countByAprioriParent = new HashMap<>();
|
||||
timesItemisIncludedById.clear();
|
||||
refreshTimesItemisIncludedById(tv.getRoot());
|
||||
timesItemisIncludedById.replace(((ProduktbausteinType) item).getId(),
|
||||
timesItemisIncludedById.get(((ProduktbausteinType) item).getId()) - 1);
|
||||
timesItemisIncludedById.replace(((ProduktbausteinType) item.getProdukt()).getId(),
|
||||
timesItemisIncludedById.get(((ProduktbausteinType) item.getProdukt()).getId()) - 1);
|
||||
|
||||
if (countChildIds(countByParent, getTreeItem().getParent()).get
|
||||
(((ProduktbausteinType) item).getId()).equals(countChildIds(countByAprioriParent,
|
||||
treeHelper.findTreeItem(((ProduktbausteinType) item), originalRoot).getParent()).get(
|
||||
((ProduktbausteinType) item).getId()))) {
|
||||
(((ProduktbausteinType) item.getProdukt()).getId()).equals(countChildIds(countByAprioriParent,
|
||||
treeHelper.findTreeItem(((ProduktbausteinType) item.getProdukt()), originalRoot).getParent()).get(
|
||||
((ProduktbausteinType) item.getProdukt()).getId()))) {
|
||||
label.setFont(Font.font("System", label.getFont().getSize()));
|
||||
label.setTextFill(Paint.valueOf("#A0A0A0"));
|
||||
remove.setVisible(false);
|
||||
|
||||
isNotIncluded.add(getTreeItem());
|
||||
getTreeItem().getValue().setNotIncluded(true);
|
||||
includeAddedChildren(getTreeItem());
|
||||
|
||||
tv.setRoot(treeHelper.sortTree(tv.getRoot()));
|
||||
@@ -326,13 +449,13 @@ public class AllinOneView extends Application {
|
||||
refreshTimesItemisIncludedById(tv.getRoot());
|
||||
});
|
||||
|
||||
if(((ProduktbausteinType) item).getMeldungen() != null && !((ProduktbausteinType) item).getMeldungen().isEmpty()) {
|
||||
if(((ProduktbausteinType) item.getProdukt()).getMeldungen() != null && !((ProduktbausteinType) item.getProdukt()).getMeldungen().isEmpty()) {
|
||||
AtomicBoolean symboleAdded = new AtomicBoolean(false);
|
||||
Text symbole = new Text("\u26A0 ");
|
||||
symbole.setFont(Font.font("System", FontWeight.BOLD, symbole.getFont().getSize() + 2));
|
||||
|
||||
|
||||
((ProduktbausteinType) item).getMeldungen().forEach(m -> {
|
||||
((ProduktbausteinType) item.getProdukt()).getMeldungen().forEach(m -> {
|
||||
if(m.getErrorType().equals(BigInteger.ONE)) {
|
||||
symbole.setFill(Paint.valueOf("#aa3333"));
|
||||
symboleAdded.set(true);
|
||||
@@ -355,14 +478,21 @@ public class AllinOneView extends Application {
|
||||
|
||||
newCalcRequest.setOnAction(e -> {
|
||||
try {
|
||||
treeHelper.setIsNotIncluded(isNotIncluded);
|
||||
TreeItem<Object> cleanedRoot = treeHelper.cleanTree(tv.getRoot());
|
||||
TreeItem<GuiProdukt> 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());
|
||||
TreeItem<GuiProdukt> newRoot = new TreeItem<>(cleanedRoot.getValue());
|
||||
treeHelper.setTimesItemisIncludedById(timesItemisIncludedById);
|
||||
treeHelper.calcMessageToTree(calcResponse.getBerechnungsantwort().getVerkaufsprodukt(), newRoot);
|
||||
if (serverBtn.isSelected()) {
|
||||
VerkaufsproduktType calcResponse = s.calculateRDFAuskunft(new TreeView<>(cleanedRoot), stichtag.get());
|
||||
treeHelper.produktToTree(calcResponse, newRoot);
|
||||
|
||||
}else {
|
||||
CalculateResponse calcResponse = s.calculateAuskunft(new TreeView<>(cleanedRoot), stichtag.get());
|
||||
treeHelper.produktToTree(calcResponse.getBerechnungsantwort().getVerkaufsprodukt(), newRoot);
|
||||
}
|
||||
|
||||
timesItemisIncludedById = treeHelper.getTimesItemisIncludedById();
|
||||
newRoot.setExpanded(true);
|
||||
|
||||
@@ -400,6 +530,7 @@ public class AllinOneView extends Application {
|
||||
HBox.setHgrow(infoBox, Priority.ALWAYS);
|
||||
|
||||
HBox splitBox = new HBox(treeBox, infoBox);
|
||||
splitBox.setId("splitBox");
|
||||
splitBox.setSpacing(10);
|
||||
splitBox.setPadding(new Insets(20));
|
||||
splitBox.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
|
||||
@@ -419,23 +550,22 @@ public class AllinOneView extends Application {
|
||||
return vbox;
|
||||
}
|
||||
|
||||
private void includeAddedParent(TreeItem<Object> treeItem) {
|
||||
private void includeAddedParent(TreeItem<GuiProdukt> treeItem) {
|
||||
if (treeItem.getParent() != null) {
|
||||
isNotIncluded.remove(treeItem.getParent());
|
||||
treeItem.getParent().getValue().setNotIncluded(false);
|
||||
if (treeItem.getParent().getParent() != null) {
|
||||
includeAddedParent(treeItem.getParent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void includeAddedChildren(TreeItem<Object> parent) {
|
||||
private void includeAddedChildren(TreeItem<GuiProdukt> 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));
|
||||
parent.getChildren().get(i).getValue().setNotIncluded(false);
|
||||
if (!shouldBeIncluded(parent.getChildren().get(i)) && !(parent.getChildren().get(i).getValue().isNotIncluded())) {
|
||||
parent.getChildren().get(i).getValue().setNotIncluded(true);
|
||||
} else {
|
||||
isNotIncluded.remove(parent.getChildren().get(i));
|
||||
parent.getChildren().get(i).getValue().setNotIncluded(false);
|
||||
}
|
||||
|
||||
if (!parent.getChildren().get(i).getChildren().isEmpty() && parent.getChildren().get(i).getChildren() != null) {
|
||||
@@ -444,37 +574,24 @@ public class AllinOneView extends Application {
|
||||
}
|
||||
}
|
||||
|
||||
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<GuiProdukt> treeItem) {
|
||||
return !(((treeItem.getParent() != null && treeItem.getParent().getValue().isNotIncluded()) || treeItem.getValue().isNotIncluded() ||
|
||||
(((ProduktbausteinType) treeItem.getValue().getProdukt()).getMinVorkommen() != null && ((ProduktbausteinType) treeItem.getValue().getProdukt()).getMinVorkommen() == 0 &&
|
||||
(timesItemisIncludedById.get(((ProduktbausteinType) treeItem.getValue().getProdukt()).getId()) == null ||
|
||||
timesItemisIncludedById.get(((ProduktbausteinType) treeItem.getValue().getProdukt()).getId()) == 0))) &&
|
||||
!(treeItem.getValue().getProdukt() instanceof VerkaufsproduktType));
|
||||
}
|
||||
|
||||
private boolean shouldBeIncluded(TreeItem<Object> treeItem) {
|
||||
return !((isNotIncluded.contains(treeItem.getParent()) || isNotIncluded.contains(treeItem) ||
|
||||
(((ProduktbausteinType) treeItem.getValue()).getMinVorkommen() != null && ((ProduktbausteinType) treeItem.getValue()).getMinVorkommen() == 0 &&
|
||||
(timesItemisIncludedById.get(((ProduktbausteinType) treeItem.getValue()).getId()) == null ||
|
||||
timesItemisIncludedById.get(((ProduktbausteinType) treeItem.getValue()).getId()) == 0))) &&
|
||||
!(treeItem.getValue() instanceof VerkaufsproduktType));
|
||||
}
|
||||
|
||||
private Map<String, Integer> countChildIds(Map<String, Integer> count, TreeItem<Object> root) {
|
||||
private Map<String, Integer> countChildIds(Map<String, Integer> count, TreeItem<GuiProdukt> root) {
|
||||
if (root != null) {
|
||||
for (int i = 0; i < root.getChildren().size(); i++) {
|
||||
TreeItem<Object> item = root.getChildren().get(i);
|
||||
TreeItem<GuiProdukt> item = root.getChildren().get(i);
|
||||
|
||||
if (count.get(((ProduktbausteinType) item.getValue()).getId()) == null) {
|
||||
count.put(((ProduktbausteinType) item.getValue()).getId(), 1);
|
||||
if (count.get(((ProduktbausteinType) item.getValue().getProdukt()).getId()) == null) {
|
||||
count.put(((ProduktbausteinType) item.getValue().getProdukt()).getId(), 1);
|
||||
} else {
|
||||
count.replace(((ProduktbausteinType) item.getValue()).getId(),
|
||||
count.get(((ProduktbausteinType) item.getValue()).getId()) + 1);
|
||||
count.replace(((ProduktbausteinType) item.getValue().getProdukt()).getId(),
|
||||
count.get(((ProduktbausteinType) item.getValue().getProdukt()).getId()) + 1);
|
||||
}
|
||||
|
||||
if (!item.getChildren().isEmpty()) {
|
||||
@@ -486,15 +603,15 @@ public class AllinOneView extends Application {
|
||||
|
||||
}
|
||||
|
||||
private void refreshTimesItemisIncludedById(TreeItem<Object> root) {
|
||||
private void refreshTimesItemisIncludedById(TreeItem<GuiProdukt> 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);
|
||||
TreeItem<GuiProdukt> item = root.getChildren().get(i);
|
||||
if (!item.getValue().isNotIncluded()) {
|
||||
if (timesItemisIncludedById.get(((ProduktbausteinType) item.getValue().getProdukt()).getId()) == null) {
|
||||
timesItemisIncludedById.put(((ProduktbausteinType) item.getValue().getProdukt()).getId(), 1);
|
||||
} else {
|
||||
timesItemisIncludedById.replace(((ProduktbausteinType) item.getValue()).getId(),
|
||||
timesItemisIncludedById.get(((ProduktbausteinType) item.getValue()).getId()) + 1);
|
||||
timesItemisIncludedById.replace(((ProduktbausteinType) item.getValue().getProdukt()).getId(),
|
||||
timesItemisIncludedById.get(((ProduktbausteinType) item.getValue().getProdukt()).getId()) + 1);
|
||||
}
|
||||
}
|
||||
if (!item.getChildren().isEmpty()) {
|
||||
@@ -503,12 +620,12 @@ public class AllinOneView extends Application {
|
||||
}
|
||||
}
|
||||
|
||||
public int timeItemIsIncludedByParent(TreeItem<Object> parent, String itemId) {
|
||||
public int timeItemIsIncludedByParent(TreeItem<GuiProdukt> 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)) {
|
||||
TreeItem<GuiProdukt> item = parent.getChildren().get(i);
|
||||
if (((ProduktbausteinType) item.getValue().getProdukt()).getId().equals(itemId)) {
|
||||
if (!item.getValue().isNotIncluded()) {
|
||||
erg++;
|
||||
}
|
||||
}
|
||||
@@ -517,11 +634,11 @@ public class AllinOneView extends Application {
|
||||
|
||||
return erg;
|
||||
}
|
||||
private boolean isMeldungVorhanden(ProduktbausteinType produkt, TreeView<Object> tv) {
|
||||
private boolean isMeldungVorhanden(ProduktbausteinType produkt, TreeView<GuiProdukt> tv) {
|
||||
TreeHelper treeHelper = new TreeHelper();
|
||||
TreeItem<Object> actual = treeHelper.findTreeItem(produkt, tv.getRoot());
|
||||
TreeItem<GuiProdukt> actual = treeHelper.findTreeItem(produkt, tv.getRoot());
|
||||
|
||||
if (actual != null && ((ProduktbausteinType)actual.getValue()).getMeldungen() != null && !((ProduktbausteinType)actual.getValue()).getMeldungen().isEmpty()) {
|
||||
if (actual != null && ((ProduktbausteinType)actual.getValue().getProdukt()).getMeldungen() != null && !((ProduktbausteinType)actual.getValue().getProdukt()).getMeldungen().isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
for (ProduktbausteinType child : produkt.getBausteine()){
|
||||
@@ -529,4 +646,31 @@ public class AllinOneView extends Application {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public VerkaufsproduktType checkPlausis(List<Plausi> plausiList, TreeItem<GuiProdukt> vp){
|
||||
Repository repo = new SailRepository(new MemoryStore());
|
||||
repo.init();
|
||||
|
||||
try (RepositoryConnection conn = repo.getConnection()) {
|
||||
Model model = rdfHelper.createRdfModel(vp);
|
||||
|
||||
conn.add(model);
|
||||
|
||||
for (Plausi plausi : plausiList) {
|
||||
String sparql = plausi.getQuery();
|
||||
|
||||
GraphQuery q = conn.prepareGraphQuery(sparql);
|
||||
Model validatedModel = QueryResults.asModel(q.evaluate());
|
||||
|
||||
model.addAll(validatedModel);
|
||||
|
||||
}
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
Rio.write(model, baos, RDFFormat.JSONLD);
|
||||
return rdfHelper.calculateRequestToVerkaufsprodukt(baos.toString());
|
||||
} catch(Exception ignored) {
|
||||
System.out.println("CheckPlausi: " + ignored.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package at.vvo.omds.client.gui;
|
||||
|
||||
public class GuiProdukt {
|
||||
boolean notIncluded;
|
||||
Object produkt;
|
||||
|
||||
public GuiProdukt(Object produkt) {
|
||||
this.produkt = produkt;
|
||||
this.notIncluded = false;
|
||||
}
|
||||
|
||||
public GuiProdukt(Object produkt, boolean isNotIncluded) {
|
||||
this.produkt = produkt;
|
||||
this.notIncluded = isNotIncluded;
|
||||
}
|
||||
|
||||
public boolean isNotIncluded() {
|
||||
return notIncluded;
|
||||
}
|
||||
|
||||
public void setNotIncluded(boolean notIncluded) {
|
||||
this.notIncluded = notIncluded;
|
||||
}
|
||||
|
||||
public Object getProdukt() {
|
||||
return produkt;
|
||||
}
|
||||
|
||||
public void setProdukt(Object produkt) {
|
||||
this.produkt = produkt;
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,8 @@ 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.Node;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.paint.Paint;
|
||||
@@ -17,55 +15,37 @@ import javafx.util.Duration;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class ItemAttribute {
|
||||
Map<TreeItem<Object>, Map<AttributType, String>> infoBoxFromItem = new HashMap<>();
|
||||
Map<TreeItem<GuiProdukt>, Map<AttributType, String>> infoBoxFromItem = new HashMap<>();
|
||||
List<VersichertesInteresseMitAttributMetadatenType> risikoobjekte = new ArrayList<>();
|
||||
|
||||
public Map<TreeItem<Object>, Map<AttributType, String>> getInfoBoxFromItem() {
|
||||
public List<VersichertesInteresseMitAttributMetadatenType> getRisikoobjekte() {
|
||||
return risikoobjekte;
|
||||
}
|
||||
|
||||
public void setRisikoobjekte(List<VersichertesInteresseMitAttributMetadatenType> risikoobjekte) {
|
||||
this.risikoobjekte = risikoobjekte;
|
||||
}
|
||||
|
||||
public Map<TreeItem<GuiProdukt>, Map<AttributType, String>> getInfoBoxFromItem() {
|
||||
return infoBoxFromItem;
|
||||
}
|
||||
public void setInfoBoxFromItem(Map<TreeItem<Object>, Map<AttributType, String>> infoBoxFromItem) {
|
||||
public void setInfoBoxFromItem(Map<TreeItem<GuiProdukt>, Map<AttributType, String>> infoBoxFromItem) {
|
||||
this.infoBoxFromItem = infoBoxFromItem;
|
||||
}
|
||||
|
||||
public VBox addItemInfo(TreeItem<Object> newSelection, VBox attributBox) {
|
||||
if (((ProduktbausteinType)newSelection.getValue()).getMeldungen() != null && !((ProduktbausteinType)newSelection.getValue()).getMeldungen().isEmpty()){
|
||||
attributBox.getChildren().removeIf(n -> n.getId().equals("faultsbox"));
|
||||
|
||||
VBox faultsBox = new VBox();
|
||||
for (ServiceFault sf : ((ProduktbausteinType)newSelection.getValue()).getMeldungen()) {
|
||||
HBox singleFaultBox = new HBox();
|
||||
singleFaultBox.setPadding(new Insets(10));
|
||||
|
||||
Text symbole = new Text("\u26A0 ");
|
||||
symbole.setFont(Font.font("System", FontWeight.BOLD, symbole.getFont().getSize() + 2));
|
||||
|
||||
|
||||
if (sf.getErrorType().equals(BigInteger.ONE)){
|
||||
symbole.setFill(Paint.valueOf("#aa3333"));
|
||||
} else if (sf.getErrorType().equals(BigInteger.TWO)) {
|
||||
symbole.setFill(Paint.valueOf("#ccbb00"));
|
||||
}
|
||||
Label errorText = new Label(sf.getErrorMsg() + System.lineSeparator());
|
||||
|
||||
singleFaultBox.getChildren().addAll(symbole, errorText);
|
||||
faultsBox.getChildren().add(singleFaultBox);
|
||||
}
|
||||
|
||||
attributBox.getChildren().addFirst(faultsBox);
|
||||
}
|
||||
|
||||
for(int j = 0; j < ((ProduktbausteinType)newSelection.getValue()).getAttribute().size(); j++) {
|
||||
public VBox addItemInfo(TreeItem<GuiProdukt> newSelection, VBox attributBox) {
|
||||
for(int j = 0; j < ((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().size(); j++) {
|
||||
VBox singleAttributBox = new VBox();
|
||||
singleAttributBox.setPadding(new Insets(10));
|
||||
|
||||
Label label = new Label(
|
||||
((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j).getBezeichnung() + ": ");
|
||||
((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().get(j).getBezeichnung() + ": ");
|
||||
label.setId("label");
|
||||
TextField textField = new TextField();
|
||||
|
||||
|
||||
CheckBox checkBox = new CheckBox();
|
||||
|
||||
AttributStringType stringAttribut;
|
||||
@@ -73,14 +53,14 @@ public class ItemAttribute {
|
||||
AttributDezimalType attributDezimal;
|
||||
AttributIntType attributInt;
|
||||
|
||||
if (((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j).getClass()
|
||||
if (((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().get(j).getClass()
|
||||
.equals(AttributBooleanType.class)) {
|
||||
attributDezimal = null;
|
||||
attributInt = null;
|
||||
stringAttribut = null;
|
||||
|
||||
attributBoolean = (AttributBooleanType) (
|
||||
(ProduktbausteinType)newSelection.getValue()).getAttribute().get(j);
|
||||
(ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().get(j);
|
||||
|
||||
if (infoBoxFromItem.get(newSelection) != null && infoBoxFromItem.get(newSelection).get(attributBoolean)
|
||||
!= null && !infoBoxFromItem.get(newSelection).get(attributBoolean).isEmpty()){
|
||||
@@ -90,13 +70,13 @@ public class ItemAttribute {
|
||||
checkBox.setSelected(true);
|
||||
}
|
||||
}
|
||||
} else if (((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j).getClass()
|
||||
} else if (((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().get(j).getClass()
|
||||
.equals(AttributStringType.class)) {
|
||||
attributDezimal = null;
|
||||
attributBoolean = null;
|
||||
attributInt = null;
|
||||
|
||||
stringAttribut = (AttributStringType) ((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j);
|
||||
stringAttribut = (AttributStringType) ((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().get(j);
|
||||
|
||||
if (stringAttribut.isPflichtfeld()) {
|
||||
label.setText(label.getText().substring(0, label.getText().length()-2) + "*: ");
|
||||
@@ -115,13 +95,13 @@ public class ItemAttribute {
|
||||
}
|
||||
textField.setPromptText("Text eingeben");
|
||||
|
||||
} else if (((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j).getClass()
|
||||
} else if (((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().get(j).getClass()
|
||||
.equals(AttributDezimalType.class)) {
|
||||
attributBoolean = null;
|
||||
attributInt = null;
|
||||
stringAttribut = null;
|
||||
|
||||
attributDezimal = (AttributDezimalType) ((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j);
|
||||
attributDezimal = (AttributDezimalType) ((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().get(j);
|
||||
|
||||
if (attributDezimal.isPflichtfeld()) {
|
||||
label.setText(label.getText().substring(0, label.getText().length()-2) + "*: ");
|
||||
@@ -144,7 +124,7 @@ public class ItemAttribute {
|
||||
attributBoolean = null;
|
||||
stringAttribut = null;
|
||||
|
||||
attributInt = (AttributIntType) ((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j);
|
||||
attributInt = (AttributIntType) ((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().get(j);
|
||||
|
||||
if (attributInt.isPflichtfeld()) {
|
||||
label.setText(label.getText().substring(0, label.getText().length()-2) + "*: ");
|
||||
@@ -183,7 +163,7 @@ public class ItemAttribute {
|
||||
infoBoxFromItem.computeIfAbsent(newSelection,
|
||||
k -> new HashMap<>()).put(attributBoolean, checkBox.isSelected() ? "true" : "false");
|
||||
attributBoolean.setValue(checkBox.isSelected());
|
||||
((ProduktbausteinType)newSelection.getValue()).getAttribute().set(finalJ, attributBoolean);
|
||||
((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().set(finalJ, attributBoolean);
|
||||
}
|
||||
});
|
||||
textField.focusedProperty().addListener((observableValue, oldVal, newVal) -> {
|
||||
@@ -236,7 +216,7 @@ public class ItemAttribute {
|
||||
}else {
|
||||
if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
|
||||
attributDezimal.setValue(new BigDecimal(eingabe));
|
||||
((ProduktbausteinType)newSelection.getValue()).getAttribute().set(finalJ, attributDezimal);
|
||||
((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().set(finalJ, attributDezimal);
|
||||
}
|
||||
} else if (attributInt != null) {
|
||||
infoBoxFromItem.computeIfAbsent(newSelection,
|
||||
@@ -268,7 +248,7 @@ public class ItemAttribute {
|
||||
}else {
|
||||
if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
|
||||
attributInt.setValue(Integer.parseInt(textField.getText()));
|
||||
((ProduktbausteinType)newSelection.getValue()).getAttribute().set(finalJ, attributInt);
|
||||
((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().set(finalJ, attributInt);
|
||||
}
|
||||
} else if (stringAttribut != null) {
|
||||
infoBoxFromItem.computeIfAbsent(newSelection,
|
||||
@@ -292,12 +272,12 @@ public class ItemAttribute {
|
||||
pause.play();
|
||||
|
||||
if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
|
||||
((ProduktbausteinType)newSelection.getValue()).getAttribute().set(finalJ, attributInt);
|
||||
((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().set(finalJ, attributInt);
|
||||
|
||||
}else {
|
||||
if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
|
||||
stringAttribut.setValue(textField.getText());
|
||||
((ProduktbausteinType)newSelection.getValue()).getAttribute().set(finalJ, stringAttribut);
|
||||
((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().set(finalJ, stringAttribut);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,10 +286,110 @@ public class ItemAttribute {
|
||||
if (attributBoolean != null) {
|
||||
singleAttributBox.getChildren().addAll(label, checkBox);
|
||||
}else {
|
||||
textField.setId("textField");
|
||||
singleAttributBox.getChildren().addAll(label, textField);
|
||||
}
|
||||
|
||||
singleAttributBox.setId("singleAttributBox");
|
||||
|
||||
attributBox.getChildren().add(singleAttributBox);
|
||||
}
|
||||
|
||||
if (((ProduktbausteinType) newSelection.getValue().getProdukt()).isRisikoobjektErforderlich()) {
|
||||
|
||||
VBox risikoobjektAuswahlBox = new VBox();
|
||||
Label vpRo = new Label("Mit dem Baustein assoziierte Risikoobjekte: ");
|
||||
|
||||
for (int i = 0; i < risikoobjekte.size(); i++) {
|
||||
CheckBox checkBox = new CheckBox();
|
||||
checkBox.setText(risikoobjekte.get(i).toString());
|
||||
|
||||
if (risikoobjekte.get(i) instanceof FahrzeugType) {
|
||||
checkBox.setText(((FahrzeugType) risikoobjekte.get(i)).getHandelsbez() + " ("
|
||||
+ ((FahrzeugType) risikoobjekte.get(i)).getBaujahr() + ")");
|
||||
|
||||
int finalI = i;
|
||||
if (((ProduktbausteinType) newSelection.getValue().getProdukt()).getVersicherteObjekte().stream().anyMatch(v -> ((FahrzeugType) v).getHandelsbez().equals(((FahrzeugType) risikoobjekte.get(finalI)).getHandelsbez()))) {
|
||||
checkBox.setSelected(true);
|
||||
}
|
||||
|
||||
checkBox.selectedProperty().addListener((observableValue, oldValue, newValue) -> {
|
||||
if (newValue) {
|
||||
((ProduktbausteinType) newSelection.getValue().getProdukt()).getVersicherteObjekte().add(risikoobjekte.get(finalI));
|
||||
|
||||
} else {
|
||||
((ProduktbausteinType) newSelection.getValue().getProdukt()).getVersicherteObjekte().remove(risikoobjekte.get(finalI));
|
||||
}
|
||||
});
|
||||
}
|
||||
risikoobjektAuswahlBox.getChildren().add(checkBox);
|
||||
}
|
||||
|
||||
risikoobjektAuswahlBox.getChildren().addFirst(vpRo);
|
||||
risikoobjektAuswahlBox.setPadding(new Insets(10));
|
||||
risikoobjektAuswahlBox.setId("risikoobjektAuswahlBox");
|
||||
|
||||
attributBox.getChildren().removeIf(c -> c.getId() != null && c.getId().equals("risikoobjektAuswahlBox"));
|
||||
attributBox.getChildren().add(risikoobjektAuswahlBox);
|
||||
}
|
||||
|
||||
return addFaultsInfo((ProduktbausteinType) newSelection.getValue().getProdukt(), attributBox);
|
||||
}
|
||||
|
||||
public VBox addFaultsInfo(ProduktbausteinType produktbaustein, VBox attributBox) {
|
||||
if (produktbaustein.getMeldungen() != null && !produktbaustein.getMeldungen().isEmpty()) {
|
||||
attributBox.getChildren().removeIf(n -> n.getId() != null && n.getId().equals("faultsbox"));
|
||||
VBox faultsBox = new VBox();
|
||||
|
||||
for (ServiceFault sf : produktbaustein.getMeldungen()) {
|
||||
HBox singleFaultBox = new HBox();
|
||||
|
||||
Text symbole = new Text("\u26A0 ");
|
||||
symbole.setFont(Font.font("System", FontWeight.BOLD, symbole.getFont().getSize() + 2));
|
||||
|
||||
if (sf.getErrorType().equals(BigInteger.ONE)) {
|
||||
symbole.setFill(Paint.valueOf("#aa3333"));
|
||||
} else if (sf.getErrorType().equals(BigInteger.TWO)) {
|
||||
symbole.setFill(Paint.valueOf("#ccbb00"));
|
||||
}
|
||||
Label errorText = new Label(sf.getErrorMsg() + System.lineSeparator());
|
||||
errorText.setId("errorText");
|
||||
|
||||
singleFaultBox.getChildren().addAll(symbole, errorText);
|
||||
singleFaultBox.setId("singleFaultBox");
|
||||
faultsBox.getChildren().add(singleFaultBox);
|
||||
}
|
||||
|
||||
if (!faultsBox.getChildren().isEmpty()) {
|
||||
if (produktbaustein.getAttribute().isEmpty()) {
|
||||
attributBox.getChildren().addAll(faultsBox);
|
||||
}else {
|
||||
List<Node> singleAttributBoxes = attributBox.getChildren().stream().filter(n -> n.getId() != null && n.getId().equals("singleAttributBox")).toList();
|
||||
Optional<Node> textField;
|
||||
Optional<Node> label;
|
||||
for (Node singleAttributBox : singleAttributBoxes) {
|
||||
textField = ((VBox)singleAttributBox).getChildren().stream().filter(n -> n.getId() != null && n.getId().equals("textField")).findFirst();
|
||||
label = ((VBox)singleAttributBox).getChildren().stream().filter(n -> n.getId() != null && n.getId().equals("label")).findFirst();
|
||||
List<Node> singleFaultBoxes = faultsBox.getChildren().stream().filter(n -> n.getId() != null && n.getId().equals("singleFaultBox")).toList();
|
||||
|
||||
if (textField.isPresent() && label.isPresent()) {
|
||||
|
||||
for (Node singleFaultBox : singleFaultBoxes) {
|
||||
Optional<Node> errorText = ((HBox)singleFaultBox).getChildren().stream().filter(c -> c.getId() != null && c.getId().equals("errorText")).findFirst();
|
||||
|
||||
if (errorText.isPresent() && ((Label)errorText.get()).getText().contains(((Label)label.get()).getText().replace(":","").replace("*",""))) {
|
||||
textField.get().setStyle("-fx-border-color: #dd0000");
|
||||
((VBox)singleAttributBox).getChildren().addLast(faultsBox);
|
||||
Optional<Node> finalTextField = textField;
|
||||
textField.get().focusedProperty().addListener(s -> finalTextField.get().setStyle(null));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return attributBox;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package at.vvo.omds.client.gui;
|
||||
|
||||
import at.vvo.omds.types.omds3.r2025_05.common.ProduktbausteinType;
|
||||
import at.vvo.omds.types.omds3.r2025_05.on2antrag.kfz.ObjectFactory;
|
||||
|
||||
public class ObjectFactoryFactory {
|
||||
public Object create(String classPath) {
|
||||
public ProduktbausteinType create(String classPath) {
|
||||
if (classPath != null) {
|
||||
if (classPath.toLowerCase().contains("kfz")){
|
||||
ObjectFactory of = new ObjectFactory();
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package at.vvo.omds.client.gui;
|
||||
|
||||
public class Plausi {
|
||||
String id;
|
||||
String beschreibung;
|
||||
String query;
|
||||
|
||||
public Plausi(String name, String beschreibung, String query) {
|
||||
this.id = name;
|
||||
this.beschreibung = beschreibung;
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getBeschreibung() {
|
||||
return beschreibung;
|
||||
}
|
||||
|
||||
public void setBeschreibung(String beschreibung) {
|
||||
this.beschreibung = beschreibung;
|
||||
}
|
||||
|
||||
public String getQuery() {
|
||||
return query;
|
||||
}
|
||||
|
||||
public void setQuery(String query) {
|
||||
this.query = query;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,467 @@
|
||||
package at.vvo.omds.client.gui;
|
||||
|
||||
import at.vvo.omds.types.omds3.r2025_05.common.*;
|
||||
import jakarta.xml.bind.JAXBElement;
|
||||
import javafx.scene.control.TreeItem;
|
||||
import javafx.util.Pair;
|
||||
import org.eclipse.rdf4j.model.impl.LinkedHashModel;
|
||||
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
|
||||
import org.eclipse.rdf4j.model.util.Models;
|
||||
import org.eclipse.rdf4j.model.util.Values;
|
||||
import org.eclipse.rdf4j.model.vocabulary.RDF;
|
||||
import org.eclipse.rdf4j.rio.RDFFormat;
|
||||
import org.eclipse.rdf4j.rio.Rio;
|
||||
import org.eclipse.rdf4j.model.*;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.client.RestClient;
|
||||
|
||||
import javax.xml.datatype.DatatypeConfigurationException;
|
||||
import javax.xml.datatype.DatatypeFactory;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.*;
|
||||
|
||||
import static org.eclipse.rdf4j.model.util.Values.iri;
|
||||
|
||||
public class RDFHelper {
|
||||
|
||||
private final RestClient restClient = RestClient.create();
|
||||
|
||||
public Pair<List<APrioriVerkaufsproduktType>, List<Plausi>> getAprioriRDF(JAXBElement<ProductsRequest> r) throws DatatypeConfigurationException, IOException {
|
||||
String response = restClient.post()
|
||||
.uri("http://localhost:9090/ProductsRequest")
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(r.getValue())
|
||||
.retrieve()
|
||||
.toEntity(String.class)
|
||||
.getBody();
|
||||
|
||||
|
||||
List<Pair<String, AttributType>> attributeListe = getAttributesFromRequest(response);
|
||||
List<APrioriVerkaufsproduktType> result = productsRequestToVerkaufsprodukt(response, attributeListe);
|
||||
List<Plausi> result2 = productsRequestToPlausi(response);
|
||||
|
||||
return new Pair<>(result, result2);
|
||||
}
|
||||
|
||||
private List<Pair<String, AttributType>> getAttributesFromRequest(String response) throws IOException {
|
||||
Model model = Rio.parse(new StringReader(response), "", RDFFormat.JSONLD);
|
||||
Rio.write(model, System.out, RDFFormat.TURTLE);
|
||||
List<Pair<String, AttributType>> erg = new ArrayList<>();
|
||||
|
||||
String baseIri = "http://vvo.pisanoapi.at/";
|
||||
|
||||
IRI bezIri = iri(baseIri + "bez");
|
||||
IRI produktIri = iri(baseIri + "ProdElement");
|
||||
IRI requiredIri = iri(baseIri + "required");
|
||||
IRI maxIri = iri(baseIri + "max");
|
||||
IRI minIri = iri(baseIri + "min");
|
||||
IRI defaultIri = iri(baseIri + "default");
|
||||
IRI valueIri = iri(baseIri + "value");
|
||||
|
||||
|
||||
for (Resource iri : Models.subjectIRIs(model)) {
|
||||
String bez = Models.objectLiteral(model.filter(iri, bezIri, null)).map(Literal::getLabel).orElse(null);
|
||||
String prodId = Models.objectResource(model.filter(iri, produktIri, null)).map(Resource::stringValue).orElse(null);
|
||||
Boolean required = Boolean.valueOf(Models.objectLiteral(model.filter(iri, requiredIri, null)).map(Literal::getLabel).orElse(null));
|
||||
|
||||
if (iri.stringValue().contains("ElemBoolean")) {
|
||||
AttributBooleanType ab = new AttributBooleanType();
|
||||
|
||||
Boolean val = Boolean.valueOf(Models.objectLiteral(model.filter(iri, valueIri, null)).map(Literal::getLabel).orElse(null));
|
||||
Boolean def = Boolean.valueOf(Models.objectLiteral(model.filter(iri, defaultIri, null)).map(Literal::getLabel).orElse(null));
|
||||
|
||||
int start = iri.stringValue().lastIndexOf("ElemBoolean");
|
||||
ab.setId(BigInteger.valueOf(Long.valueOf(iri.stringValue().substring(start + "ElemBoolean".length()))));
|
||||
|
||||
ab.setBezeichnung(bez);
|
||||
ab.setDefault(def);
|
||||
ab.setPflichtfeld(required);
|
||||
ab.setValue(val);
|
||||
|
||||
Pair<String, AttributType> atPair = new Pair<>(prodId, ab);
|
||||
erg.add(atPair);
|
||||
} else if (iri.stringValue().contains("ElemInt")) {
|
||||
AttributIntType ai = new AttributIntType();
|
||||
|
||||
Integer val = Integer.parseInt(Models.objectLiteral(model.filter(iri, valueIri, null)).map(Literal::getLabel).orElse("-1"));
|
||||
Integer def = Integer.parseInt(Models.objectLiteral(model.filter(iri, defaultIri, null)).map(Literal::getLabel).orElse("-1"));
|
||||
Integer min = Integer.parseInt(Models.objectLiteral(model.filter(iri, minIri, null)).map(Literal::getLabel).orElse("-1"));
|
||||
Integer max = Integer.parseInt(Models.objectLiteral(model.filter(iri, maxIri, null)).map(Literal::getLabel).orElse("-1"));
|
||||
|
||||
int start = iri.stringValue().lastIndexOf("ElemInt");
|
||||
ai.setId(BigInteger.valueOf(Long.valueOf(iri.stringValue().substring(start + "ElemInt".length()))));
|
||||
|
||||
ai.setBezeichnung(bez);
|
||||
ai.setDefault(def);
|
||||
ai.setPflichtfeld(required);
|
||||
ai.setMax(max);
|
||||
ai.setMin(min);
|
||||
ai.setValue(val);
|
||||
|
||||
Pair<String, AttributType> atPair = new Pair<>(prodId, ai);
|
||||
erg.add(atPair);
|
||||
} else if (iri.stringValue().contains("ElemDecimal")) {
|
||||
AttributDezimalType ad = new AttributDezimalType();
|
||||
|
||||
BigDecimal val = Models.objectLiteral(model.filter(iri, valueIri, null)).map(Literal::decimalValue).orElse(BigDecimal.valueOf(-1));
|
||||
BigDecimal def = Models.objectLiteral(model.filter(iri, defaultIri, null)).map(Literal::decimalValue).orElse(BigDecimal.valueOf(-1));
|
||||
BigDecimal min = Models.objectLiteral(model.filter(iri, minIri, null)).map(Literal::decimalValue).orElse(BigDecimal.valueOf(-1));
|
||||
BigDecimal max = Models.objectLiteral(model.filter(iri, maxIri, null)).map(Literal::decimalValue).orElse(BigDecimal.valueOf(-1));
|
||||
|
||||
int start = iri.stringValue().lastIndexOf("ElemDecimal");
|
||||
ad.setId(BigInteger.valueOf(Long.valueOf(iri.stringValue().substring(start + "ElemDecimal".length()))));
|
||||
|
||||
ad.setBezeichnung(bez);
|
||||
ad.setDefault(def);
|
||||
ad.setPflichtfeld(required);
|
||||
ad.setMax(max);
|
||||
ad.setMin(min);
|
||||
ad.setValue(val);
|
||||
|
||||
Pair<String, AttributType> atPair = new Pair<>(prodId, ad);
|
||||
erg.add(atPair);
|
||||
} else if (iri.stringValue().contains("ElemString")) {
|
||||
AttributStringType as = new AttributStringType();
|
||||
|
||||
String val = String.valueOf(Models.objectLiteral(model.filter(iri, valueIri, null)).map(Literal::getLabel).orElse(null));
|
||||
String def = String.valueOf(Models.objectLiteral(model.filter(iri, defaultIri, null)).map(Literal::getLabel).orElse(null));
|
||||
|
||||
int start = iri.stringValue().lastIndexOf("ElemString");
|
||||
as.setId(BigInteger.valueOf(Long.parseLong(iri.stringValue().substring(start + "ElemString".length()))));
|
||||
|
||||
as.setBezeichnung(bez);
|
||||
as.setDefault(def);
|
||||
as.setPflichtfeld(required);
|
||||
as.setValue(val);
|
||||
|
||||
Pair<String, AttributType> atPair = new Pair<>(prodId, as);
|
||||
erg.add(atPair);
|
||||
}
|
||||
}
|
||||
|
||||
return erg;
|
||||
}
|
||||
|
||||
private List<Plausi> productsRequestToPlausi(String response) throws IOException {
|
||||
List<Plausi> result = new ArrayList<>();
|
||||
Model model = Rio.parse(new StringReader(response), "", RDFFormat.JSONLD);
|
||||
|
||||
for (Resource iri : Models.subjectIRIs(model)) {
|
||||
if (iri.stringValue().contains("plausi")) {
|
||||
String id = iri.stringValue().replace("http://vvo.pisanoapi.at/plausi", "");
|
||||
ValueFactory vf = SimpleValueFactory.getInstance();
|
||||
|
||||
String beschreibung = Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/beschreibung"), null)).map(Literal::getLabel).orElse(null);
|
||||
|
||||
String query = Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/query"), null)).map(Literal::getLabel).orElse(null);
|
||||
|
||||
result.add(new Plausi(id, beschreibung, query));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<APrioriVerkaufsproduktType> productsRequestToVerkaufsprodukt(String productsRequest, List<Pair<String, AttributType>> attributeListe) throws IOException, DatatypeConfigurationException {
|
||||
Model model = Rio.parse(new StringReader(productsRequest), "", RDFFormat.JSONLD);
|
||||
|
||||
Map<String, APrioriProduktbausteinType> bausteine = new HashMap<>();
|
||||
Map<String, String> parents = new HashMap<>();
|
||||
|
||||
for (Resource iri : Models.subjectIRIs(model)) {
|
||||
if (iri.stringValue().contains("ProdElement")) {
|
||||
|
||||
String id = iri.stringValue();
|
||||
|
||||
System.out.println(iri.stringValue());
|
||||
ValueFactory vf = SimpleValueFactory.getInstance();
|
||||
|
||||
int insId = Integer.parseInt(Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/ins_id"), null)).map(Literal::getLabel).orElse("-1"));
|
||||
int maxOccurrence = Integer.parseInt(Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/maxOccurrence"), null)).map(Literal::getLabel).orElse("-1"));
|
||||
int minOccurrence = Integer.parseInt(Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/minOccurrence"), null)).map(Literal::getLabel).orElse("-1"));
|
||||
String bez = Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/bez"), null)).map(Literal::getLabel).orElse(null);
|
||||
String type = Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/type"), null)).map(Literal::getLabel).orElse(null);
|
||||
String risikoobjektType = Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/risikoobjektType"), null)).map(Literal::getLabel).orElse(null);
|
||||
XMLGregorianCalendar verkaufsoffenVon = Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/salesFrom"), null)).map(Literal::getLabel).isPresent() ?
|
||||
DatatypeFactory.newInstance().newXMLGregorianCalendar( Models.objectLiteral(model.filter(
|
||||
iri, vf.createIRI("http://vvo.pisanoapi.at/salesFrom"), null))
|
||||
.map(Literal::getLabel).orElse(null)) : null;
|
||||
XMLGregorianCalendar verkaufsoffenBis = Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/salesTo"), null)).map(Literal::getLabel).isPresent() ?
|
||||
DatatypeFactory.newInstance().newXMLGregorianCalendar( Models.objectLiteral(model.filter(
|
||||
iri, vf.createIRI("http://vvo.pisanoapi.at/salesTo"), null))
|
||||
.map(Literal::getLabel).orElse(null)) : null;
|
||||
|
||||
Optional<String> parentId = Models.objectResource(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/parent"), null)).map(Resource::stringValue);
|
||||
|
||||
APrioriProduktbausteinType verkaufsproduktType;
|
||||
if (parentId.isPresent()) {
|
||||
verkaufsproduktType = new APrioriUnterbausteinType();
|
||||
} else {
|
||||
verkaufsproduktType = new APrioriVerkaufsproduktType();
|
||||
}
|
||||
|
||||
for (Pair<String, AttributType> attribute : attributeListe) {
|
||||
if (attribute.getKey().equals(id)){
|
||||
verkaufsproduktType.getAttribute().add(attribute.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
verkaufsproduktType.setId(iri.stringValue().substring("http://vvo.pisanoapi.at/ProdElement".length(), iri.stringValue().indexOf("-") > 0 ? iri.stringValue().indexOf("-") : iri.stringValue().length()));
|
||||
verkaufsproduktType.setName(bez);
|
||||
verkaufsproduktType.setType(type);
|
||||
verkaufsproduktType.setFrom(verkaufsoffenVon);
|
||||
verkaufsproduktType.setTo(verkaufsoffenBis);
|
||||
verkaufsproduktType.setMaxOccurrences(maxOccurrence);
|
||||
verkaufsproduktType.setMinOccurrences(minOccurrence);
|
||||
verkaufsproduktType.setRisikoobjektType(risikoobjektType);
|
||||
|
||||
parentId.ifPresent(p -> parents.put(id, p));
|
||||
bausteine.put(id, verkaufsproduktType);
|
||||
}
|
||||
}
|
||||
|
||||
List<APrioriVerkaufsproduktType> verkaufsprodukteList = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<String, APrioriProduktbausteinType> entry : bausteine.entrySet()){
|
||||
String id = entry.getKey();
|
||||
Object baustein = entry.getValue();
|
||||
String parentId = parents.get(id);
|
||||
|
||||
System.out.println(id + " " + baustein.getClass().getName());
|
||||
|
||||
if (parentId != null && bausteine.containsKey(parentId)){
|
||||
bausteine.get(parentId).getBausteine().add((APrioriUnterbausteinType) baustein);
|
||||
}else {
|
||||
verkaufsprodukteList.add((APrioriVerkaufsproduktType) baustein);
|
||||
}
|
||||
}
|
||||
|
||||
return verkaufsprodukteList;
|
||||
}
|
||||
|
||||
public VerkaufsproduktType getCalculateRDF(String r) throws DatatypeConfigurationException, IOException {
|
||||
|
||||
return calculateRequestToVerkaufsprodukt(restClient.post()
|
||||
.uri("http://localhost:9090/CalculateRequest")
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(r)
|
||||
.retrieve()
|
||||
.toEntity(String.class)
|
||||
.getBody());
|
||||
}
|
||||
|
||||
public VerkaufsproduktType calculateRequestToVerkaufsprodukt(String calculateRequest) throws IOException, DatatypeConfigurationException {
|
||||
Model model = Rio.parse(new StringReader(calculateRequest), "", RDFFormat.JSONLD);
|
||||
|
||||
Map<String, ProduktbausteinType> bausteine = new LinkedHashMap<>();
|
||||
Map<String, String> parents = new HashMap<>();
|
||||
|
||||
List<Pair<String, AttributType>> attListe = getAttributesFromRequest(calculateRequest);
|
||||
for (Resource iri : Models.subjectIRIs(model)) {
|
||||
|
||||
if (iri.stringValue().contains("Prod")) {
|
||||
String id = iri.stringValue();
|
||||
|
||||
ValueFactory vf = SimpleValueFactory.getInstance();
|
||||
|
||||
int insId = Integer.parseInt(Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/ins_id"), null)).map(Literal::getLabel).orElse("-1"));
|
||||
int maxOccurrence = Integer.parseInt(Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/maxOccurrence"), null)).map(Literal::getLabel).orElse("-1"));
|
||||
int minOccurrence = Integer.parseInt(Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/minOccurrence"), null)).map(Literal::getLabel).orElse("-1"));
|
||||
String bez = Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/bez"), null)).map(Literal::getLabel).orElse(null);
|
||||
String type = Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/type"), null)).map(Literal::getLabel).orElse(null);
|
||||
String risikoobjektType = Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/risikoobjektType"), null)).map(Literal::getLabel).orElse(null);
|
||||
String meldung = Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/meldung"), null)).map(Literal::getLabel).orElse(null);
|
||||
XMLGregorianCalendar verkaufsoffenVon = Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/salesFrom"), null)).map(Literal::getLabel).isPresent() ? DatatypeFactory.newInstance().newXMLGregorianCalendar(
|
||||
Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/salesFrom"), null)).map(Literal::getLabel).orElse(null)) : null;
|
||||
XMLGregorianCalendar verkaufsoffenBis = Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/salesTo"), null)).map(Literal::getLabel).isPresent() ? DatatypeFactory.newInstance().newXMLGregorianCalendar(
|
||||
Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/salesTo"), null)).map(Literal::getLabel).orElse(null)) : null;
|
||||
|
||||
Optional<String> parentId = Models.objectResource(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/parent"), null)).map(Resource::stringValue);
|
||||
|
||||
ObjectFactoryFactory off = new ObjectFactoryFactory();
|
||||
ProduktbausteinType verkaufsproduktType = (ProduktbausteinType) off.create(type);
|
||||
|
||||
verkaufsproduktType.setId(iri.stringValue().substring("http://vvo.pisanoapi.at/ProdElement".length(), iri.stringValue().indexOf("-") > 0 ? iri.stringValue().indexOf("-") : iri.stringValue().length()));
|
||||
verkaufsproduktType.setBezeichnung(bez);
|
||||
verkaufsproduktType.setTyp(type);
|
||||
verkaufsproduktType.setVerkaufsoffenVon(verkaufsoffenVon);
|
||||
verkaufsproduktType.setVerkaufsoffenBis(verkaufsoffenBis);
|
||||
verkaufsproduktType.setMaxVorkommen(maxOccurrence);
|
||||
verkaufsproduktType.setMinVorkommen(minOccurrence);
|
||||
verkaufsproduktType.setRisikoobjektErforderlich(risikoobjektType != null);
|
||||
|
||||
if (meldung != null) {
|
||||
ServiceFault tmp = new ServiceFault();
|
||||
tmp.setErrorMsg(meldung);
|
||||
tmp.setErrorType(BigInteger.ONE);
|
||||
verkaufsproduktType.getMeldungen().add(tmp);
|
||||
}
|
||||
|
||||
for (Pair<String, AttributType> pair : attListe) {
|
||||
if (pair.getKey().equals(id)) {
|
||||
verkaufsproduktType.getAttribute().add(pair.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
parentId.ifPresent(p -> parents.put(id, p));
|
||||
bausteine.put(id, verkaufsproduktType);
|
||||
}
|
||||
}
|
||||
|
||||
List<VerkaufsproduktType> verkaufsprodukteList = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<String, ProduktbausteinType> entry : bausteine.entrySet()){
|
||||
String id = entry.getKey();
|
||||
ProduktbausteinType baustein = entry.getValue();
|
||||
String parentId = parents.get(id);
|
||||
|
||||
if (parentId != null && bausteine.containsKey(parentId)){
|
||||
bausteine.get(parentId).getBausteine().add(baustein);
|
||||
}else {
|
||||
verkaufsprodukteList.add((VerkaufsproduktType) baustein);
|
||||
}
|
||||
}
|
||||
|
||||
return verkaufsprodukteList.getFirst();
|
||||
}
|
||||
|
||||
public Model createRdfModel(TreeItem<GuiProdukt> vp) {
|
||||
Model erg = new LinkedHashModel();
|
||||
String baseIri = "http://vvo.pisanoapi.at/";
|
||||
|
||||
Map<String,Integer> occCounter = new HashMap<>();
|
||||
addProduktToModel(vp, erg, baseIri, null, occCounter);
|
||||
|
||||
return erg;
|
||||
}
|
||||
|
||||
public void addProduktToModel(TreeItem<GuiProdukt> guiProdukt, Model model, String baseIri, String parentId, Map<String,Integer> occCounter) {
|
||||
ProduktbausteinType produkt = (ProduktbausteinType) guiProdukt.getValue().getProdukt();
|
||||
|
||||
IRI prodelemIri = iri(baseIri + "ProdElement");
|
||||
IRI insIdIri = iri(baseIri + "ins_id");
|
||||
IRI bezIri = iri(baseIri + "bez");
|
||||
IRI createdIri = iri(baseIri + "created");
|
||||
IRI salesFromIri = iri(baseIri + "salesFrom");
|
||||
IRI salesToIri = iri(baseIri + "salesTo");
|
||||
IRI minOccurrenceIri = iri(baseIri + "minOccurrence");
|
||||
IRI maxOccurrenceIri = iri(baseIri + "maxOccurrence");
|
||||
IRI typeIri = iri(baseIri + "type");
|
||||
IRI risikoobjektTypeIri = iri(baseIri + "risikoobjektType");
|
||||
IRI bausteinIri = iri(baseIri + "baustein");
|
||||
IRI parentIri = iri(baseIri + "parent");
|
||||
|
||||
int occ = occCounter.merge(String.valueOf(produkt.getId()), 1, Integer::sum);
|
||||
IRI vpIri = iri(baseIri + "ProdElement" + produkt.getId() + "-" + occ);
|
||||
|
||||
if (!guiProdukt.getValue().isNotIncluded()) {
|
||||
model.add(vpIri, RDF.TYPE, prodelemIri);
|
||||
model.add(vpIri, bezIri, Values.literal(produkt.getBezeichnung()));
|
||||
model.add(vpIri, salesFromIri, Values.literal(produkt.getVerkaufsoffenVon()));
|
||||
if (produkt.getVerkaufsoffenBis() != null)
|
||||
model.add(vpIri, salesToIri, Values.literal(produkt.getVerkaufsoffenBis()));
|
||||
model.add(vpIri, minOccurrenceIri, Values.literal(produkt.getMinVorkommen()));
|
||||
model.add(vpIri, maxOccurrenceIri, Values.literal(produkt.getMaxVorkommen()));
|
||||
model.add(vpIri, typeIri, Values.literal(produkt.getTyp()));
|
||||
|
||||
if (parentId != null) model.add(vpIri, parentIri, Values.iri(parentId));
|
||||
|
||||
}
|
||||
|
||||
for (AttributType attribut : produkt.getAttribute()){
|
||||
IRI atBez = iri(baseIri + "bez");
|
||||
IRI atRequiredIri = iri(baseIri + "required");
|
||||
IRI atProd = iri(baseIri + "ProdElement");
|
||||
IRI atValue = iri(baseIri + "value");
|
||||
IRI atMax = iri(baseIri + "max");
|
||||
IRI atMin = iri(baseIri + "min");
|
||||
IRI atDefault = iri(baseIri + "default");
|
||||
|
||||
if (attribut instanceof AttributIntType){
|
||||
IRI specificAt = iri(baseIri + "ElemInt" + attribut.getId());
|
||||
|
||||
model.add(specificAt, RDF.TYPE, iri(baseIri + "ElemInt"));
|
||||
model.add(specificAt, atBez, Values.literal(attribut.getBezeichnung()));
|
||||
model.add(specificAt, atRequiredIri, Values.literal(((AttributIntType) attribut).isPflichtfeld()));
|
||||
if (((AttributIntType) attribut).getValue() != null) model.add(specificAt, atValue, Values.literal(((AttributIntType) attribut).getValue()));
|
||||
model.add(specificAt, atProd, vpIri);
|
||||
model.add(specificAt, atMax, Values.literal(((AttributIntType) attribut).getMax()));
|
||||
model.add(specificAt, atMin, Values.literal(((AttributIntType) attribut).getMin()));
|
||||
model.add(specificAt, atDefault, Values.literal(((AttributIntType) attribut).getDefault()));
|
||||
|
||||
} else if (attribut instanceof AttributBooleanType) {
|
||||
IRI specificAt = iri(baseIri + "ElemBoolean" + attribut.getId());
|
||||
|
||||
model.add(specificAt, RDF.TYPE, iri(baseIri + "ElemBoolean"));
|
||||
model.add(specificAt, atBez, Values.literal(attribut.getBezeichnung()));
|
||||
model.add(specificAt, atRequiredIri, Values.literal(((AttributBooleanType) attribut).isPflichtfeld()));
|
||||
if (((AttributBooleanType) attribut).isValue() != null) model.add(specificAt, atValue, Values.literal(((AttributBooleanType) attribut).isValue()));
|
||||
model.add(specificAt, atProd, vpIri);
|
||||
model.add(specificAt, atDefault, Values.literal(((AttributBooleanType) attribut).isDefault()));
|
||||
|
||||
} else if (attribut instanceof AttributStringType) {
|
||||
IRI specificAt = iri(baseIri + "ElemString" + attribut.getId());
|
||||
|
||||
model.add(specificAt, RDF.TYPE, iri(baseIri + "ElemString"));
|
||||
model.add(specificAt, atBez, Values.literal(attribut.getBezeichnung()));
|
||||
model.add(specificAt, atRequiredIri, Values.literal(((AttributStringType) attribut).isPflichtfeld()));
|
||||
if (((AttributStringType) attribut).getValue() != null) model.add(specificAt, atValue, Values.literal(((AttributStringType) attribut).getValue()));
|
||||
model.add(specificAt, atProd, vpIri);
|
||||
model.add(specificAt, atDefault, Values.literal(((AttributStringType) attribut).getDefault()));
|
||||
|
||||
} else if (attribut instanceof AttributDezimalType) {
|
||||
IRI specificAt = iri(baseIri + "ElemDecimal" + attribut.getId());
|
||||
|
||||
model.add(specificAt, RDF.TYPE, iri(baseIri + "ElemDecimal"));
|
||||
model.add(specificAt, atBez, Values.literal(attribut.getBezeichnung()));
|
||||
model.add(specificAt, atRequiredIri, Values.literal(((AttributDezimalType) attribut).isPflichtfeld()));
|
||||
if (((AttributDezimalType) attribut).getValue() != null) model.add(specificAt, atValue, Values.literal(((AttributDezimalType) attribut).getValue()));
|
||||
model.add(specificAt, atProd, vpIri);
|
||||
if (((AttributDezimalType) attribut).getMax() != null) model.add(specificAt, atMax, Values.literal(((AttributDezimalType) attribut).getMax()));
|
||||
if (((AttributDezimalType) attribut).getMin() != null)model.add(specificAt, atMin, Values.literal(((AttributDezimalType) attribut).getMin()));
|
||||
if (((AttributDezimalType) attribut).getDefault() != null)model.add(specificAt, atDefault, Values.literal(((AttributDezimalType) attribut).getDefault()));
|
||||
}
|
||||
}
|
||||
// for (int i = 0; i < vp.getVersicherteObjekte().size(); i++) {
|
||||
// erg.add(vpIri, risikoobjektTypeIri, Values.literal(vp.getVersicherteObjekte().get(i)));
|
||||
// }
|
||||
|
||||
for (int i = 0; i < guiProdukt.getChildren().size(); i++) {
|
||||
IRI unterbausteinIri = iri(baseIri + "ProdElement" + ((ProduktbausteinType)guiProdukt.getChildren().get(i).getValue().getProdukt()).getId() +
|
||||
"-" + occCounter.getOrDefault(((ProduktbausteinType)guiProdukt.getChildren().get(i).getValue()
|
||||
.getProdukt()).getId(), 1));
|
||||
if (!guiProdukt.getValue().isNotIncluded()) {
|
||||
model.add(vpIri, bausteinIri, unterbausteinIri);
|
||||
}
|
||||
|
||||
String newParentId = vpIri.stringValue();
|
||||
addProduktToModel(guiProdukt.getChildren().get(i), model, baseIri, newParentId, occCounter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,215 @@
|
||||
package at.vvo.omds.client.gui;
|
||||
|
||||
import at.vvo.omds.types.omds3.r2025_05.common.FahrzeugType;
|
||||
import at.vvo.omds.types.omds3.r2025_05.common.VersichertesInteresseMitAttributMetadatenType;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.scene.paint.Paint;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.scene.text.FontWeight;
|
||||
|
||||
import javax.xml.datatype.DatatypeConfigurationException;
|
||||
import javax.xml.datatype.DatatypeFactory;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RisikoobjektView {
|
||||
List<VersichertesInteresseMitAttributMetadatenType> risikoobjekte = new ArrayList<>();
|
||||
VBox objekteListe = new VBox();
|
||||
ScrollPane objekteScroll = new ScrollPane();
|
||||
GridPane main = new GridPane();
|
||||
|
||||
public List<VersichertesInteresseMitAttributMetadatenType> getRisikoobjekte() {
|
||||
return risikoobjekte;
|
||||
}
|
||||
|
||||
public GridPane risikoobjekte() {
|
||||
VBox createObjekt = createRisikoobjekt();
|
||||
|
||||
objekteListe = risikoobjekteListe();
|
||||
|
||||
objekteScroll.setContent(objekteListe);
|
||||
objekteScroll.setFitToWidth(true);
|
||||
objekteScroll.setFitToHeight(false);
|
||||
objekteScroll.setStyle("-fx-background-color:transparent;");
|
||||
|
||||
main.add(createObjekt, 0, 0);
|
||||
main.add(objekteScroll, 1, 0);
|
||||
|
||||
GridPane.setHgrow(createObjekt, Priority.ALWAYS);
|
||||
GridPane.setVgrow(createObjekt, Priority.ALWAYS);
|
||||
GridPane.setHgrow(objekteScroll, Priority.ALWAYS);
|
||||
GridPane.setVgrow(objekteScroll, Priority.ALWAYS);
|
||||
|
||||
createObjekt.setPadding(new Insets(10, 10, 10, 5));
|
||||
createObjekt.setStyle("-fx-border-color: black; -fx-border-width: 1px;");
|
||||
|
||||
objekteScroll.setPadding(new Insets(10, 10, 10, 5));
|
||||
objekteScroll.setStyle("-fx-border-color: black; -fx-border-width: 1px;");
|
||||
|
||||
main.setAlignment(Pos.CENTER);
|
||||
main.setPadding(new Insets(10));
|
||||
main.setHgap(10);
|
||||
|
||||
return main;
|
||||
}
|
||||
|
||||
private VBox risikoobjekteListe() {
|
||||
VBox objekteListe = new VBox(10); // spacing
|
||||
objekteListe.setFillWidth(true);
|
||||
|
||||
if (risikoobjekte != null && !risikoobjekte.isEmpty()) {
|
||||
for (VersichertesInteresseMitAttributMetadatenType r : risikoobjekte) {
|
||||
|
||||
|
||||
HBox singleRisikoobjekt = new HBox(10);
|
||||
singleRisikoobjekt.setPadding(new Insets(5));
|
||||
singleRisikoobjekt.setAlignment(Pos.CENTER);
|
||||
|
||||
VBox objektInfo = new VBox(2);
|
||||
|
||||
if (r instanceof FahrzeugType fahrzeug) {
|
||||
Label handelsbezeichnung = new Label(fahrzeug.getHandelsbez());
|
||||
handelsbezeichnung.setFont(Font.font("System", FontWeight.BOLD, 14));
|
||||
|
||||
Label baujahr = new Label(fahrzeug.getBaujahr().toString());
|
||||
baujahr.setStyle("-fx-text-fill: #555555");
|
||||
|
||||
Label erstzulassung = new Label(fahrzeug.getErstzulassdat().toString()
|
||||
.substring(0, fahrzeug.getErstzulassdat().toString().length()-1));
|
||||
erstzulassung.setStyle("-fx-text-fill: #555555");
|
||||
|
||||
objektInfo.getChildren().addAll(handelsbezeichnung, baujahr, erstzulassung);
|
||||
|
||||
Pane separator = new Pane();
|
||||
separator.setPrefWidth(2);
|
||||
separator.setMaxWidth(2);
|
||||
separator.setStyle("-fx-background-color: black;");
|
||||
|
||||
Label symbole = new Label("\u26DF");
|
||||
symbole.setFont(Font.font(18));
|
||||
|
||||
VBox symbolBox = new VBox(symbole);
|
||||
|
||||
singleRisikoobjekt.getChildren().addAll(symbolBox, separator, objektInfo);
|
||||
singleRisikoobjekt.setAlignment(Pos.CENTER_LEFT);
|
||||
}
|
||||
|
||||
objekteListe.getChildren().add(singleRisikoobjekt);
|
||||
}
|
||||
}
|
||||
return objekteListe;
|
||||
}
|
||||
|
||||
private VBox createRisikoobjekt() {
|
||||
VBox createForm = new VBox();
|
||||
ChoiceBox<String> choiceBox = new ChoiceBox<>();
|
||||
|
||||
List<String> risikoobjektArten = new ArrayList<>();
|
||||
risikoobjektArten.add("Versichertes objekt SachPrivat");
|
||||
risikoobjektArten.add("Versicherte Liegenschaft");
|
||||
risikoobjektArten.add("Fahrzeug");
|
||||
risikoobjektArten.add("Risiko Gebaeude");
|
||||
risikoobjektArten.add("Versicherte Person");
|
||||
risikoobjektArten.add("Risiko Haushalt");
|
||||
|
||||
choiceBox.getSelectionModel().selectedItemProperty().addListener((obs, oldVal, newVal) -> {
|
||||
if (newVal != null) {
|
||||
switch (newVal) {
|
||||
case "Versichertes objekt SachPrivat": {
|
||||
System.out.println("formular sach Privat");
|
||||
break;
|
||||
}
|
||||
case "Versicherte Liegenschaft": {
|
||||
System.out.println("create Versicherte Liegenschaft");
|
||||
break;
|
||||
}
|
||||
case "Fahrzeug": {
|
||||
FahrzeugType fahrzeug = new FahrzeugType();
|
||||
|
||||
VBox createFormBox = new VBox();
|
||||
|
||||
VBox baujahrBox = new VBox();
|
||||
Label label1 = new Label("Baujahr");
|
||||
TextField textField1 = new TextField();
|
||||
|
||||
textField1.setPromptText("Baujahr");
|
||||
baujahrBox.setPadding(new Insets(5));
|
||||
baujahrBox.getChildren().addAll(label1, textField1);
|
||||
|
||||
textField1.focusedProperty().addListener((observableValue, oldValue, newValue) -> {
|
||||
if (!newValue) {
|
||||
Label failedCheck = new Label("Es muss eine 4 stellige Jahreszahl mitgegeben werden");
|
||||
failedCheck.setId("failedCheck");
|
||||
failedCheck.setTextFill(Paint.valueOf("#DD0000"));
|
||||
if (textField1.getText().length() != 4) {
|
||||
textField1.setStyle("-fx-border-color: #dd0000");
|
||||
baujahrBox.getChildren().addAll(failedCheck);
|
||||
} else {
|
||||
textField1.setStyle("-fx-border-color: #555555");
|
||||
baujahrBox.getChildren().removeIf(c -> c.getId() != null && c.getId().equals("failedCheck"));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
VBox handelsbezeichnungBox = new VBox();
|
||||
Label label2 = new Label("Handelsbezeichnung");
|
||||
TextField textField2 = new TextField();
|
||||
|
||||
textField2.setPromptText("Handelsbezeichnung");
|
||||
handelsbezeichnungBox.setPadding(new Insets(5));
|
||||
handelsbezeichnungBox.getChildren().addAll(label2, textField2);
|
||||
|
||||
VBox erstzulassungBox = new VBox();
|
||||
Label label3 = new Label("Erstzulassung");
|
||||
DatePicker datePicker = new DatePicker(LocalDate.now());
|
||||
|
||||
erstzulassungBox.setPadding(new Insets(5));
|
||||
erstzulassungBox.getChildren().addAll(label3, datePicker);
|
||||
|
||||
Button createBtn = new Button("Create");
|
||||
|
||||
createBtn.setOnAction(e -> {
|
||||
fahrzeug.setBaujahr(Integer.valueOf(textField1.getText()));
|
||||
fahrzeug.setHandelsbez(textField2.getText());
|
||||
try {
|
||||
int day = datePicker.getValue().getDayOfMonth();
|
||||
int month = datePicker.getValue().getMonthValue();
|
||||
int year = datePicker.getValue().getYear();
|
||||
|
||||
XMLGregorianCalendar erstzulassung = DatatypeFactory.newInstance().newXMLGregorianCalendarDate(year, month, day, 0);
|
||||
|
||||
fahrzeug.setErstzulassdat(erstzulassung);
|
||||
} catch (DatatypeConfigurationException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
|
||||
risikoobjekte.add(fahrzeug);
|
||||
|
||||
objekteListe.getChildren().setAll(risikoobjekteListe().getChildren());
|
||||
|
||||
createFormBox.getChildren().clear();
|
||||
String select = choiceBox.getSelectionModel().getSelectedItem();
|
||||
choiceBox.getSelectionModel().clearSelection();
|
||||
choiceBox.getSelectionModel().select(select);
|
||||
|
||||
});
|
||||
|
||||
createFormBox.getChildren().addAll(baujahrBox, handelsbezeichnungBox, erstzulassungBox, createBtn);
|
||||
createForm.getChildren().add(createFormBox);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
choiceBox.getItems().addAll(risikoobjektArten);
|
||||
|
||||
createForm.getChildren().addAll(choiceBox);
|
||||
return createForm;
|
||||
}
|
||||
}
|
||||
@@ -2,17 +2,12 @@ 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<>();
|
||||
|
||||
public Map<String, Integer> getTimesItemisIncludedById() {
|
||||
return timesItemisIncludedById;
|
||||
@@ -22,22 +17,14 @@ public class TreeHelper {
|
||||
this.timesItemisIncludedById = timesItemisIncludedById;
|
||||
}
|
||||
|
||||
public List<TreeItem<Object>> getIsNotIncluded() {
|
||||
return isNotIncluded;
|
||||
}
|
||||
|
||||
public void setIsNotIncluded(List<TreeItem<Object>> isNotIncluded) {
|
||||
this.isNotIncluded = isNotIncluded;
|
||||
}
|
||||
|
||||
public TreeItem<Object> cleanTree(TreeItem<Object> original) {
|
||||
if (isNotIncluded.contains(original)) {
|
||||
public TreeItem<GuiProdukt> cleanTree(TreeItem<GuiProdukt> original) {
|
||||
if (original.getValue().isNotIncluded()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
TreeItem<Object> newItem = new TreeItem<>(original.getValue());
|
||||
for (TreeItem<Object> child : original.getChildren()) {
|
||||
TreeItem<Object> cleanedChild = cleanTree(child);
|
||||
TreeItem<GuiProdukt> newItem = new TreeItem<>(original.getValue());
|
||||
for (TreeItem<GuiProdukt> child : original.getChildren()) {
|
||||
TreeItem<GuiProdukt> cleanedChild = cleanTree(child);
|
||||
if (cleanedChild != null) {
|
||||
newItem.getChildren().add(cleanedChild);
|
||||
}
|
||||
@@ -45,110 +32,121 @@ public class TreeHelper {
|
||||
return newItem;
|
||||
}
|
||||
|
||||
public TreeItem<Object> cloneTreeItem(TreeItem<Object> original) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
|
||||
Object cloneOriginalValue;
|
||||
public TreeItem<GuiProdukt> cloneTreeItem(TreeItem<GuiProdukt> original) {
|
||||
ProduktbausteinType cloneOriginalValue;
|
||||
|
||||
cloneOriginalValue = new ObjectFactoryFactory().create(((ProduktbausteinType) original.getValue()).getTyp());
|
||||
cloneOriginalValue = new ObjectFactoryFactory().create(((ProduktbausteinType) original.getValue().getProdukt()).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());
|
||||
cloneOriginalValue.setId(
|
||||
((ProduktbausteinType) original.getValue().getProdukt()).getId());
|
||||
cloneOriginalValue.setBezeichnung(
|
||||
((ProduktbausteinType) original.getValue().getProdukt()).getBezeichnung());
|
||||
cloneOriginalValue.setVerkaufsoffenVon(
|
||||
((ProduktbausteinType) original.getValue().getProdukt()).getVerkaufsoffenVon());
|
||||
cloneOriginalValue.setVerkaufsoffenBis(
|
||||
((ProduktbausteinType) original.getValue().getProdukt()).getVerkaufsoffenBis());
|
||||
cloneOriginalValue.getAttribute().addAll(
|
||||
((ProduktbausteinType) original.getValue().getProdukt()).getAttribute());
|
||||
cloneOriginalValue.getMeldungen().addAll(
|
||||
((ProduktbausteinType) original.getValue().getProdukt()).getMeldungen());
|
||||
cloneOriginalValue.setMinVorkommen(
|
||||
((ProduktbausteinType) original.getValue().getProdukt()).getMinVorkommen());
|
||||
cloneOriginalValue.setMaxVorkommen(
|
||||
((ProduktbausteinType) original.getValue().getProdukt()).getMaxVorkommen());
|
||||
cloneOriginalValue.setTyp(
|
||||
((ProduktbausteinType) original.getValue().getProdukt()).getTyp());
|
||||
cloneOriginalValue.setRisikoobjektErforderlich(
|
||||
((ProduktbausteinType) original.getValue().getProdukt()).isRisikoobjektErforderlich());
|
||||
cloneOriginalValue.getVersicherteObjekte().addAll(
|
||||
((ProduktbausteinType) original.getValue().getProdukt()).getVersicherteObjekte());
|
||||
|
||||
TreeItem<GuiProdukt> clonedItem = new TreeItem<>(new GuiProdukt(cloneOriginalValue));
|
||||
|
||||
TreeItem<Object> clonedItem = new TreeItem<>(cloneOriginalValue);
|
||||
|
||||
for (TreeItem<Object> child : original.getChildren()) {
|
||||
for (TreeItem<GuiProdukt> child : original.getChildren()) {
|
||||
clonedItem.getChildren().add(cloneTreeItem(child));
|
||||
}
|
||||
clonedItem.setExpanded(true);
|
||||
|
||||
clonedItem.getValue().setNotIncluded(original.getValue().isNotIncluded());
|
||||
|
||||
return clonedItem;
|
||||
}
|
||||
|
||||
public TreeItem<Object> findTreeItem(ProduktbausteinType item, TreeItem<Object> root) {
|
||||
if (((ProduktbausteinType) root.getValue()).getId().equals(item.getId())) {
|
||||
public TreeItem<GuiProdukt> findTreeItem(ProduktbausteinType item, TreeItem<GuiProdukt> root) {
|
||||
if (((ProduktbausteinType) root.getValue().getProdukt()).getId().equals(item.getId())) {
|
||||
return root;
|
||||
}
|
||||
for (TreeItem<Object> child : root.getChildren()) {
|
||||
TreeItem<Object> found = findTreeItem(item, child);
|
||||
for (TreeItem<GuiProdukt> child : root.getChildren()) {
|
||||
TreeItem<GuiProdukt> found = findTreeItem(item, child);
|
||||
if (found != null) return found;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void messageToTree(APrioriProduktbausteinType produkt, TreeItem<Object> treeItem) throws Exception {
|
||||
public void aprioriProduktToTree(APrioriProduktbausteinType produkt, TreeItem<GuiProdukt> 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)));
|
||||
TreeItem<GuiProdukt> up = aprioriItemToCalcItem(new TreeItem<>(new GuiProdukt(produkt.getBausteine().get(i))));
|
||||
up.setExpanded(true);
|
||||
if (!produkt.getBausteine().get(i).getBausteine().isEmpty()) {
|
||||
messageToTree(produkt.getBausteine().get(i), up);
|
||||
aprioriProduktToTree(produkt.getBausteine().get(i), up);
|
||||
}
|
||||
treeItem.getChildren().add(up);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void calcMessageToTree(ProduktbausteinType produkt, TreeItem<Object> treeItem) {
|
||||
if (!produkt.getBausteine().isEmpty()) {
|
||||
public void produktToTree(ProduktbausteinType produkt, TreeItem<GuiProdukt> treeItem) throws Exception {
|
||||
if (produkt != null && !produkt.getBausteine().isEmpty()) {
|
||||
for (int i = 0; i < produkt.getBausteine().size(); i++) {
|
||||
TreeItem<Object> up = new TreeItem<>(produkt.getBausteine().get(i));
|
||||
TreeItem<GuiProdukt> up = new TreeItem<>(new GuiProdukt(produkt.getBausteine().get(i)));
|
||||
up.setExpanded(true);
|
||||
if (!produkt.getBausteine().get(i).getBausteine().isEmpty()) {
|
||||
calcMessageToTree(produkt.getBausteine().get(i), up);
|
||||
produktToTree(produkt.getBausteine().get(i), up);
|
||||
}
|
||||
treeItem.getChildren().add(up);
|
||||
if (!timesItemisIncludedById.containsKey(((ProduktbausteinType) up.getValue()).getId())) {
|
||||
timesItemisIncludedById.put(((ProduktbausteinType) up.getValue()).getId(), 1);
|
||||
if (!timesItemisIncludedById.containsKey(((ProduktbausteinType) up.getValue().getProdukt()).getId())) {
|
||||
timesItemisIncludedById.put(((ProduktbausteinType) up.getValue().getProdukt()).getId(), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public TreeItem<Object> aprioriItemToCalcItem(TreeItem<Object> produkt) throws Exception {
|
||||
public TreeItem<GuiProdukt> aprioriItemToCalcItem(TreeItem<GuiProdukt> produkt) throws Exception {
|
||||
|
||||
TreeItem<Object> ergItem = new TreeItem<>();
|
||||
Object erg = new ObjectFactoryFactory().create(((APrioriProduktbausteinType) produkt.getValue()).getType());
|
||||
TreeItem<GuiProdukt> ergItem = new TreeItem<>();
|
||||
Object erg = new ObjectFactoryFactory().create(
|
||||
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getType());
|
||||
|
||||
if (erg != null) {
|
||||
if (ProduktbausteinType.class.isAssignableFrom(erg.getClass())) {
|
||||
((ProduktbausteinType) erg).setId(
|
||||
((APrioriProduktbausteinType) produkt.getValue()).getId());
|
||||
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getId());
|
||||
((ProduktbausteinType) erg).setBezeichnung(
|
||||
((APrioriProduktbausteinType) produkt.getValue()).getName());
|
||||
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getName());
|
||||
((ProduktbausteinType) erg).setVerkaufsoffenVon(
|
||||
((APrioriProduktbausteinType) produkt.getValue()).getFrom());
|
||||
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getFrom());
|
||||
((ProduktbausteinType) erg).setVerkaufsoffenBis(
|
||||
((APrioriProduktbausteinType) produkt.getValue()).getTo());
|
||||
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getTo());
|
||||
((ProduktbausteinType) erg).getMeldungen().addAll(
|
||||
((APrioriProduktbausteinType) produkt.getValue()).getMeldungen());
|
||||
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getMeldungen());
|
||||
((ProduktbausteinType) erg).getAttribute().addAll(
|
||||
((APrioriProduktbausteinType) produkt.getValue()).getAttribute());
|
||||
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getAttribute());
|
||||
((ProduktbausteinType) erg).setMinVorkommen(
|
||||
((APrioriProduktbausteinType) produkt.getValue()).getMinOccurrences());
|
||||
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getMinOccurrences());
|
||||
((ProduktbausteinType) erg).setMaxVorkommen(
|
||||
((APrioriProduktbausteinType) produkt.getValue()).getMaxOccurrences());
|
||||
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getMaxOccurrences());
|
||||
((ProduktbausteinType) erg).setTyp(
|
||||
((APrioriProduktbausteinType) produkt.getValue()).getType());
|
||||
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getType());
|
||||
|
||||
if (((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getRisikoobjektType() != null) {
|
||||
((ProduktbausteinType) erg).setRisikoobjektErforderlich(true);
|
||||
}
|
||||
|
||||
for (int i = 0; i < ((APrioriProduktbausteinType) produkt.getValue()).getBausteine().size(); i++) {
|
||||
for (int i = 0; i < ((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getBausteine().size(); i++) {
|
||||
((ProduktbausteinType) erg).getBausteine().add((ProduktbausteinType) aprioriItemToCalcItem(
|
||||
new TreeItem<>(((APrioriProduktbausteinType) produkt.getValue())
|
||||
.getBausteine().get(i))).getValue());
|
||||
new TreeItem<>(new GuiProdukt(((APrioriProduktbausteinType) produkt.getValue().getProdukt())
|
||||
.getBausteine().get(i)))).getValue().getProdukt());
|
||||
}
|
||||
|
||||
for (int i = 0; i < produkt.getChildren().size(); i++) {
|
||||
@@ -157,51 +155,82 @@ public class TreeHelper {
|
||||
}
|
||||
} else {
|
||||
throw new Exception("Objekt kann nicht erzeugt werden. Unbekannte Klasse "
|
||||
+ ((APrioriProduktbausteinType) produkt.getValue()).getType());
|
||||
+ ((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getType());
|
||||
}
|
||||
ergItem.setValue(erg);
|
||||
ergItem.setValue(new GuiProdukt(erg));
|
||||
return ergItem;
|
||||
}
|
||||
|
||||
public TreeItem<Object> addAprioriToCalc(TreeItem<Object> calcItem, TreeItem<Object> aprioriItem)
|
||||
throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
|
||||
for (TreeItem<Object> aprioriChild : aprioriItem.getChildren()) {
|
||||
boolean isInCalc = false;
|
||||
int i = 0;
|
||||
for (TreeItem<Object> calcChild : calcItem.getChildren()) {
|
||||
if (((ProduktbausteinType) calcChild.getValue()).getId().equals(((ProduktbausteinType) aprioriChild.getValue()).getId()) || isNotIncluded.contains(calcChild)) {
|
||||
isInCalc = true;
|
||||
if (!aprioriChild.getChildren().isEmpty()) {
|
||||
calcChild = addAprioriToCalc(calcChild, aprioriChild);
|
||||
calcItem.getChildren().set(i, calcChild);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (!isInCalc) {
|
||||
TreeItem<Object> missingCalcItem = cloneTreeItem(aprioriChild);
|
||||
calcItem.getChildren().add(missingCalcItem);
|
||||
if (!isNotIncluded.contains(missingCalcItem)) {
|
||||
isNotIncluded.add(missingCalcItem);
|
||||
// public TreeItem<GuiProdukt> addAprioriToCalc(TreeItem<GuiProdukt> calcItem, TreeItem<GuiProdukt> aprioriItem) {
|
||||
// for (TreeItem<GuiProdukt> aprioriChild : aprioriItem.getChildren()) {
|
||||
// boolean isInCalc = false;
|
||||
// int i = 0;
|
||||
// for (TreeItem<GuiProdukt> calcChild : calcItem.getChildren()) {
|
||||
// if (((ProduktbausteinType) calcChild.getValue().getProdukt()).getId().equals(
|
||||
// ((ProduktbausteinType) aprioriChild.getValue().getProdukt()).getId())
|
||||
// && !calcChild.getValue().isNotIncluded()) {
|
||||
// isInCalc = true;
|
||||
// if (!aprioriChild.getChildren().isEmpty()) {
|
||||
// addAprioriToCalc(calcChild, aprioriChild);
|
||||
//// calcItem.getChildren().set(i, calcChild);
|
||||
// }
|
||||
// }
|
||||
// i++;
|
||||
// }
|
||||
// if (!isInCalc) {
|
||||
// TreeItem<GuiProdukt> missingCalcItem = cloneTreeItem(aprioriChild);
|
||||
// calcItem.getChildren().add(missingCalcItem);
|
||||
// missingCalcItem.getValue().setNotIncluded(true);
|
||||
// }
|
||||
// }
|
||||
// return calcItem;
|
||||
// }
|
||||
|
||||
public TreeItem<GuiProdukt> addAprioriToCalc(TreeItem<GuiProdukt> calcItem, TreeItem<GuiProdukt> aprioriItem) {
|
||||
|
||||
for (TreeItem<GuiProdukt> aprioriChild : aprioriItem.getChildren()) {
|
||||
ProduktbausteinType aprioriProd = (ProduktbausteinType) aprioriChild.getValue().getProdukt();
|
||||
String aprioriId = aprioriProd.getId();
|
||||
|
||||
TreeItem<GuiProdukt> matchingCalcChild = calcItem.getChildren().stream()
|
||||
.filter(c -> {
|
||||
ProduktbausteinType calcProd = (ProduktbausteinType) c.getValue().getProdukt();
|
||||
return calcProd.getId().equals(aprioriId) && !c.getValue().isNotIncluded();
|
||||
})
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if (matchingCalcChild != null) {
|
||||
if (!aprioriChild.getChildren().isEmpty()) {
|
||||
addAprioriToCalc(matchingCalcChild, aprioriChild);
|
||||
}
|
||||
} else {
|
||||
TreeItem<GuiProdukt> cloned = cloneTreeItem(aprioriChild);
|
||||
cloned.getValue().setNotIncluded(true);
|
||||
|
||||
calcItem.getChildren().add(cloned);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
public TreeItem<GuiProdukt> sortTree(TreeItem<GuiProdukt> parent) {
|
||||
// FXCollections.sort(parent.getChildren(), Comparator.comparing(
|
||||
// item -> ((ProduktbausteinType)((TreeItem<GuiProdukt>)item).getValue().getProdukt()).getBezeichnung()
|
||||
// ));
|
||||
//
|
||||
// Comparator<TreeItem<GuiProdukt>> compareBez = (s1, s2) -> {
|
||||
// int erg = ((ProduktbausteinType)s1.getValue().getProdukt()).getBezeichnung().compareTo(((ProduktbausteinType)s2.getValue().getProdukt()).getBezeichnung());
|
||||
// if (erg == 0) {
|
||||
// return 1;
|
||||
// }else {
|
||||
// return erg;
|
||||
// }
|
||||
// };
|
||||
// for (TreeItem<GuiProdukt> child : parent.getChildren()) {
|
||||
// sortTree(child);
|
||||
// }
|
||||
return parent;
|
||||
}
|
||||
|
||||
private String itemPfad(TreeItem<Object> item) {
|
||||
if (item.getParent() == null) return ((ProduktbausteinType)item.getValue()).getId();
|
||||
return itemPfad(item.getParent()) + "/" + ((ProduktbausteinType)item.getValue()).getId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
package at.vvo.omds.client.gui.api.apriori;
|
||||
|
||||
import at.vvo.omds.client.gui.Plausi;
|
||||
import at.vvo.omds.client.gui.RDFHelper;
|
||||
import at.vvo.omds.client.gui.api.SOAPConnector;
|
||||
import at.vvo.omds.types.omds3.r2025_05.common.APrioriVerkaufsproduktType;
|
||||
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 javafx.util.Pair;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AprioriAuskunftService {
|
||||
@@ -34,4 +39,16 @@ public class AprioriAuskunftService {
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
public Pair<List<APrioriVerkaufsproduktType>, List<Plausi>> aprioriRDFAuskunft(XMLGregorianCalendar stichtag, String vuNr) throws Exception {
|
||||
JAXBElement<ProductsRequest> r = BuildProductsRequest.aprioriRequest(stichtag, vuNr);
|
||||
|
||||
RDFHelper rdfHelper = new RDFHelper();
|
||||
Pair<List<APrioriVerkaufsproduktType>, List<Plausi>> response = rdfHelper.getAprioriRDF(r);
|
||||
|
||||
log.info("Got Response As below ========= : ");
|
||||
log.info("Status : {}", response.getKey().getFirst().getName());
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
package at.vvo.omds.client.gui.api.calc;
|
||||
|
||||
import at.vvo.omds.client.gui.GuiProdukt;
|
||||
import at.vvo.omds.client.gui.ObjectFactoryFactory;
|
||||
import at.vvo.omds.client.gui.RDFHelper;
|
||||
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 org.eclipse.rdf4j.model.Model;
|
||||
import org.eclipse.rdf4j.rio.RDFFormat;
|
||||
import org.eclipse.rdf4j.rio.Rio;
|
||||
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
import javax.xml.namespace.QName;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
||||
public class BuildCalculateRequestAuskunft {
|
||||
private static final at.vvo.omds.types.omds3.r2025_05.on2antrag.common.ObjectFactory OUOF =
|
||||
@@ -16,11 +22,11 @@ public class BuildCalculateRequestAuskunft {
|
||||
|
||||
private BuildCalculateRequestAuskunft(){}
|
||||
|
||||
static public JAXBElement<CalculateRequest> buildRequestFromTreeView(TreeView<Object> treeView, XMLGregorianCalendar vtBeg) {
|
||||
static public JAXBElement<CalculateRequest> buildRequestFromTreeView(TreeView<GuiProdukt> treeView, XMLGregorianCalendar vtBeg) {
|
||||
CalculateRequest request = OUOF.createCalculateRequest();
|
||||
VerkaufsproduktType verkaufsprodukt = TreeViewToVerkaufsprodukt(treeView, vtBeg);
|
||||
verkaufsprodukt.setVtgBeg(vtBeg);
|
||||
verkaufsprodukt.setTyp(((ProduktbausteinType)treeView.getRoot().getValue()).getTyp());
|
||||
verkaufsprodukt.setTyp(((ProduktbausteinType)treeView.getRoot().getValue().getProdukt()).getTyp());
|
||||
SpezBerechnungGenType berechnungsanfrage = new SpezBerechnungGenType();
|
||||
|
||||
berechnungsanfrage.setVerkaufsprodukt(verkaufsprodukt);
|
||||
@@ -31,28 +37,43 @@ public class BuildCalculateRequestAuskunft {
|
||||
return createCalculateRequest(request);
|
||||
}
|
||||
|
||||
static public String buildRDFRequestFromTreeView(TreeView<GuiProdukt> treeView, XMLGregorianCalendar vtBeg) {
|
||||
VerkaufsproduktType verkaufsprodukt = TreeViewToVerkaufsprodukt(treeView, vtBeg);
|
||||
verkaufsprodukt.setVtgBeg(vtBeg);
|
||||
verkaufsprodukt.setTyp(((ProduktbausteinType)treeView.getRoot().getValue().getProdukt()).getTyp());
|
||||
|
||||
RDFHelper rdf = new RDFHelper();
|
||||
|
||||
Model requestModel = rdf.createRdfModel(new TreeItem<>(new GuiProdukt(verkaufsprodukt, true)));
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
Rio.write(requestModel, baos, RDFFormat.JSONLD);
|
||||
|
||||
return baos.toString();
|
||||
}
|
||||
|
||||
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) {
|
||||
public static ProduktbausteinType TreeItemToBaustein(TreeItem<GuiProdukt> treeItem) {
|
||||
ProduktbausteinType baustein = (ProduktbausteinType) new ObjectFactoryFactory().create(
|
||||
((ProduktbausteinType)treeItem.getValue()).getTyp());
|
||||
((ProduktbausteinType)treeItem.getValue().getProdukt()).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());
|
||||
baustein.setMinVorkommen(((ProduktbausteinType)treeItem.getValue()).getMinVorkommen());
|
||||
baustein.setMaxVorkommen(((ProduktbausteinType)treeItem.getValue()).getMaxVorkommen());
|
||||
baustein.setBezeichnung(((ProduktbausteinType)treeItem.getValue().getProdukt()).getBezeichnung());
|
||||
baustein.setId(((ProduktbausteinType)treeItem.getValue().getProdukt()).getId());
|
||||
baustein.setVerkaufsoffenVon(((ProduktbausteinType)treeItem.getValue().getProdukt()).getVerkaufsoffenVon());
|
||||
baustein.setVerkaufsoffenBis(((ProduktbausteinType)treeItem.getValue().getProdukt()).getVerkaufsoffenBis());
|
||||
baustein.getAttribute().addAll(((ProduktbausteinType)treeItem.getValue().getProdukt()).getAttribute());
|
||||
baustein.setTyp(((ProduktbausteinType)treeItem.getValue().getProdukt()).getTyp());
|
||||
baustein.setMinVorkommen(((ProduktbausteinType)treeItem.getValue().getProdukt()).getMinVorkommen());
|
||||
baustein.setMaxVorkommen(((ProduktbausteinType)treeItem.getValue().getProdukt()).getMaxVorkommen());
|
||||
|
||||
return baustein;
|
||||
}
|
||||
|
||||
public static VerkaufsproduktType TreeViewToVerkaufsprodukt(TreeView<Object> treeView, XMLGregorianCalendar vtBeg) {
|
||||
public static VerkaufsproduktType TreeViewToVerkaufsprodukt(TreeView<GuiProdukt> treeView, XMLGregorianCalendar vtBeg) {
|
||||
VerkaufsproduktType verkaufsprodukt = (VerkaufsproduktType) TreeItemToBaustein(treeView.getRoot());
|
||||
verkaufsprodukt.setVtgBeg(vtBeg);
|
||||
|
||||
@@ -65,7 +86,7 @@ public class BuildCalculateRequestAuskunft {
|
||||
return verkaufsprodukt;
|
||||
}
|
||||
|
||||
public static ProduktbausteinType addUpFromTreeItem(TreeItem<Object> treeItem) {
|
||||
public static ProduktbausteinType addUpFromTreeItem(TreeItem<GuiProdukt> treeItem) {
|
||||
ProduktbausteinType baustein = (ProduktbausteinType) TreeItemToBaustein(treeItem);
|
||||
|
||||
if (!treeItem.getChildren().isEmpty()) {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package at.vvo.omds.client.gui.api.calc;
|
||||
|
||||
import at.vvo.omds.client.gui.GuiProdukt;
|
||||
import at.vvo.omds.client.gui.RDFHelper;
|
||||
import at.vvo.omds.client.gui.api.SOAPConnector;
|
||||
import at.vvo.omds.types.omds3.r2025_05.common.VerkaufsproduktType;
|
||||
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;
|
||||
@@ -21,7 +24,7 @@ public class CalculateRequestAuskunftService {
|
||||
this.soapConnector = soapConnector;
|
||||
}
|
||||
|
||||
public CalculateResponse aprioriAuskunft(TreeView<Object> treeView, XMLGregorianCalendar vtBeg) throws Exception {
|
||||
public CalculateResponse calculateAuskunft(TreeView<GuiProdukt> treeView, XMLGregorianCalendar vtBeg) throws Exception {
|
||||
|
||||
String token = "<KEY>";
|
||||
JAXBElement<CalculateRequest> r = BuildCalculateRequestAuskunft.buildRequestFromTreeView(treeView, vtBeg);
|
||||
@@ -35,4 +38,18 @@ public class CalculateRequestAuskunftService {
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
public VerkaufsproduktType calculateRDFAuskunft(TreeView<GuiProdukt> treeView, XMLGregorianCalendar vtBeg) throws Exception {
|
||||
|
||||
String request = BuildCalculateRequestAuskunft.buildRDFRequestFromTreeView(treeView, vtBeg);
|
||||
|
||||
System.out.println(request);
|
||||
|
||||
RDFHelper rdfHelper = new RDFHelper();
|
||||
VerkaufsproduktType response = rdfHelper.getCalculateRDF(request);
|
||||
log.info("Got Response As below ========= : ");
|
||||
log.info("Status : {}", response.getBezeichnung());
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
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"
|
||||
version="3.0">
|
||||
jaxb:extensionBindingPrefixes="xjc annox"
|
||||
|
||||
|
||||
|
||||
@@ -606,7 +606,7 @@
|
||||
<!-- </jaxb:bindings>-->
|
||||
|
||||
<!-- Antrag Rechtsschutz Namespace urn:at.vvo.omds.types.omds3.v1-4-0.on2antrag.rs -->
|
||||
<!--
|
||||
|
||||
<jaxb:bindings schemaLocation="omds3_ON2_Antrag_Rechtsschutz.xsd" node="/xs:schema" >
|
||||
<jaxb:schemaBindings>
|
||||
<jaxb:package name="at.vvo.omds.types.omds3.r2025_05.on2antrag.rs"/>
|
||||
@@ -652,7 +652,7 @@
|
||||
</annox:annotate>
|
||||
</bindings>
|
||||
</jaxb:bindings>
|
||||
-->
|
||||
|
||||
|
||||
<!-- Antrag Sach-Privat Namespace urn:at.vvo.omds.types.omds3.v1-4-0.on2antrag.sachprivat -->
|
||||
<jaxb:bindings schemaLocation="omds3_ON2_Antrag_SachPrivat.xsd" node="/xs:schema" >
|
||||
|
||||
@@ -1721,12 +1721,14 @@
|
||||
</xsd:element>
|
||||
<xsd:element name="Baustein" type="Produktbaustein_Type" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element name="Aktion" type="Aktion_Type" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element name="VersicherteObjekte" type="VersichertesInteresse_Type" 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:attribute name="RisikoobjektErforderlich" type="xsd:boolean" default="false"/>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
@@ -3254,7 +3256,7 @@
|
||||
<xsd:documentation>Basisklasse für alle Fahrzeuge in der Kfz-Versicherung</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="VersichertesInteresse_Type">
|
||||
<xsd:extension base="VersichertesInteresseMitAttributMetadaten_Type">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Zulassungsdaten" type="Zulassungsdaten_Type" minOccurs="0">
|
||||
<xsd:annotation>
|
||||
@@ -5062,6 +5064,7 @@
|
||||
<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:attribute name="risikoobjekt_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">
|
||||
|
||||
Reference in New Issue
Block a user