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>
|
</executions>
|
||||||
</plugin>
|
</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>
|
<plugin>
|
||||||
<!-- Lizenz: Berkeley Software Distribution, frei -->
|
<groupId>org.apache.cxf</groupId>
|
||||||
<groupId>org.jvnet.jaxb</groupId>
|
<artifactId>cxf-codegen-plugin</artifactId>
|
||||||
<artifactId>jaxb-maven-plugin</artifactId>
|
<version>4.1.3</version>
|
||||||
<version>4.0.0</version>
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<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>
|
<goals>
|
||||||
<goal>generate</goal>
|
<goal>wsdl2java</goal>
|
||||||
</goals>
|
</goals>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
<dependencies>
|
||||||
<extension>true</extension>
|
<dependency>
|
||||||
<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>
|
<groupId>org.jvnet.jaxb</groupId>
|
||||||
<artifactId>jaxb-plugin-annotate</artifactId>
|
<artifactId>jaxb-plugin-annotate</artifactId>
|
||||||
<version>3.0.0</version>
|
<version>3.0.0</version>
|
||||||
</plugin>
|
</dependency>
|
||||||
</plugins>
|
</dependencies>
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
@@ -205,12 +247,77 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
|
|||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-controls -->
|
<!-- 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>
|
<groupId>org.openjfx</groupId>
|
||||||
<artifactId>javafx-controls</artifactId>
|
<artifactId>javafx-controls</artifactId>
|
||||||
<version>23.0.1</version>
|
<version>23.0.1</version>
|
||||||
</dependency>
|
</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>
|
<dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter -->
|
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter -->
|
||||||
|
|||||||
@@ -37,8 +37,6 @@ public class BuildRequestHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static XMLGregorianCalendar aktuellesDatum() {
|
public static XMLGregorianCalendar aktuellesDatum() {
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("uuuu-MM-dd'T'HH:mm:ss");
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("uuuu-MM-dd'T'HH:mm:ss");
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -18,10 +18,22 @@ import javafx.scene.layout.*;
|
|||||||
import javafx.scene.paint.Paint;
|
import javafx.scene.paint.Paint;
|
||||||
import javafx.scene.text.*;
|
import javafx.scene.text.*;
|
||||||
import javafx.stage.Stage;
|
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.DatatypeConfigurationException;
|
||||||
import javax.xml.datatype.DatatypeFactory;
|
import javax.xml.datatype.DatatypeFactory;
|
||||||
import javax.xml.datatype.XMLGregorianCalendar;
|
import javax.xml.datatype.XMLGregorianCalendar;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -31,10 +43,12 @@ import java.util.concurrent.atomic.AtomicReference;
|
|||||||
public class AllinOneView extends Application {
|
public class AllinOneView extends Application {
|
||||||
|
|
||||||
Map<String, Integer> timesItemisIncludedById = new HashMap<>();
|
Map<String, Integer> timesItemisIncludedById = new HashMap<>();
|
||||||
List<TreeItem<Object>> isNotIncluded = new ArrayList<>();
|
Map<TreeItem<GuiProdukt>, Map<AttributType, String>> infoBoxFromItem = new HashMap<>();
|
||||||
Map<TreeItem<Object>, Map<AttributType, String>> infoBoxFromItem = new HashMap<>();
|
List<Plausi> plausiList = new ArrayList<>();
|
||||||
|
|
||||||
|
RisikoobjektView risikoobjektView = new RisikoobjektView();
|
||||||
TreeHelper treeHelper = new TreeHelper();
|
TreeHelper treeHelper = new TreeHelper();
|
||||||
|
RDFHelper rdfHelper = new RDFHelper();
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
launch(args);
|
launch(args);
|
||||||
@@ -42,11 +56,50 @@ public class AllinOneView extends Application {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage stage) {
|
public void start(Stage stage) {
|
||||||
AprioriAuskunftService s = new AprioriAuskunftService(new SOAPConnector());
|
|
||||||
|
|
||||||
stage.setTitle("OMDS Client");
|
stage.setTitle("OMDS Client");
|
||||||
stage.getIcons().add(new Image(AllinOneView.class.getResourceAsStream("/logo/VVO_Logo_2024.png")));
|
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()};
|
final VBox[] controlBox = {new VBox()};
|
||||||
DatePicker dp = new DatePicker();
|
DatePicker dp = new DatePicker();
|
||||||
ChoiceBox<String> vpBox = new ChoiceBox<>();
|
ChoiceBox<String> vpBox = new ChoiceBox<>();
|
||||||
@@ -62,33 +115,60 @@ public class AllinOneView extends Application {
|
|||||||
newCalcRequestControlBox.setVisible(false);
|
newCalcRequestControlBox.setVisible(false);
|
||||||
newCalcRequestControlBox.setPadding(new Insets(10, 10, 10, 10));
|
newCalcRequestControlBox.setPadding(new Insets(10, 10, 10, 10));
|
||||||
newCalcRequestControlBox.getChildren().add(newCalcRequestButton);
|
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 -> {
|
dp.setOnAction(e -> {
|
||||||
try {
|
try {
|
||||||
stichtag.set(stichtagEvent(dp));
|
stichtag.set(stichtagEvent(dp));
|
||||||
if (stichtagEvent(dp) != null) {
|
if (stichtagEvent(dp) != null) {
|
||||||
try {
|
try {
|
||||||
response.set(s.aprioriAuskunft(stichtag.get(), "042"));
|
Pair<List<APrioriVerkaufsproduktType>, List<Plausi>> aprioriPair = s.aprioriRDFAuskunft(stichtag.get(), "042");
|
||||||
} catch (NoSuchElementException ex) {
|
responseproduct.set(aprioriPair.getKey());
|
||||||
controlBox[0].getChildren().clear();
|
plausiList = aprioriPair.getValue();
|
||||||
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 zum Server möglich!"));
|
|
||||||
|
|
||||||
controlBox[0].getChildren().add(errorBox);
|
|
||||||
}
|
|
||||||
newCalcRequestControlBox.setVisible(true);
|
newCalcRequestControlBox.setVisible(true);
|
||||||
|
|
||||||
if (response.get().getVerkaufsprodukt().size() > 1) {
|
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);
|
||||||
|
|
||||||
|
} 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()) {
|
if (!vpBox.getItems().isEmpty()) {
|
||||||
vpBox.getItems().clear();
|
vpBox.getItems().clear();
|
||||||
@@ -103,7 +183,7 @@ public class AllinOneView extends Application {
|
|||||||
.getSelectedItem().equals(response.get().getVerkaufsprodukt().get(i).getName())) {
|
.getSelectedItem().equals(response.get().getVerkaufsprodukt().get(i).getName())) {
|
||||||
try {
|
try {
|
||||||
controlBox[0] = buttonAuskunft(response.get().getVerkaufsprodukt().get(i),
|
controlBox[0] = buttonAuskunft(response.get().getVerkaufsprodukt().get(i),
|
||||||
controlBox[0], newCalcRequestButton, stichtag);
|
controlBox[0], newCalcRequestButton, stichtag, serverBtn);
|
||||||
controlBox[0].getChildren().add(newCalcRequestControlBox);
|
controlBox[0].getChildren().add(newCalcRequestControlBox);
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
@@ -114,8 +194,28 @@ public class AllinOneView extends Application {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
controlBox[0] = buttonAuskunft(response.get().getVerkaufsprodukt().getFirst(),
|
controlBox[0] = buttonAuskunft(response.get().getVerkaufsprodukt().getFirst(),
|
||||||
controlBox[0], newCalcRequestButton, stichtag);
|
controlBox[0], newCalcRequestButton, stichtag, serverBtn);
|
||||||
}
|
}
|
||||||
|
} 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)) {
|
if (!controlBox[0].getChildren().contains(newCalcRequestControlBox)) {
|
||||||
controlBox[0].getChildren().add(newCalcRequestControlBox);
|
controlBox[0].getChildren().add(newCalcRequestControlBox);
|
||||||
}
|
}
|
||||||
@@ -139,19 +239,22 @@ public class AllinOneView extends Application {
|
|||||||
|
|
||||||
VBox.setVgrow(newCalcRequestControlBox, Priority.ALWAYS);
|
VBox.setVgrow(newCalcRequestControlBox, Priority.ALWAYS);
|
||||||
newCalcRequestControlBox.setAlignment(Pos.BOTTOM_RIGHT);
|
newCalcRequestControlBox.setAlignment(Pos.BOTTOM_RIGHT);
|
||||||
|
newCalcRequestControlBox.setId("newCalcRequestControlBox");
|
||||||
|
|
||||||
|
servBox.getChildren().add(serverBtn);
|
||||||
|
servBox.setAlignment(Pos.TOP_RIGHT);
|
||||||
|
|
||||||
HBox aprioriControlBox = new HBox();
|
HBox aprioriControlBox = new HBox();
|
||||||
|
Region region = new Region();
|
||||||
|
HBox.setHgrow(region, Priority.ALWAYS);
|
||||||
aprioriControlBox.setPadding(new Insets(10, 10, 0, 10));
|
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);
|
controlBox[0].getChildren().addAll(aprioriControlBox);
|
||||||
|
|
||||||
Scene scene = new Scene(controlBox[0], 900, 600);
|
return controlBox[0];
|
||||||
stage.setScene(scene);
|
|
||||||
|
|
||||||
stage.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public XMLGregorianCalendar stichtagEvent(DatePicker dp) throws DatatypeConfigurationException {
|
public XMLGregorianCalendar stichtagEvent(DatePicker dp) throws DatatypeConfigurationException {
|
||||||
if (dp.getValue() == null) {
|
if (dp.getValue() == null) {
|
||||||
return null;
|
return null;
|
||||||
@@ -164,7 +267,7 @@ public class AllinOneView extends Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public VBox buttonAuskunft(APrioriVerkaufsproduktType verkaufsprodukt, VBox vbox, Button newCalcRequest,
|
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) {
|
while (vbox.getChildren().size() > 1) {
|
||||||
vbox.getChildren().removeLast();
|
vbox.getChildren().removeLast();
|
||||||
}
|
}
|
||||||
@@ -172,24 +275,28 @@ public class AllinOneView extends Application {
|
|||||||
VBox treeBox = new VBox();
|
VBox treeBox = new VBox();
|
||||||
VBox infoBox = 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);
|
vkp.setExpanded(true);
|
||||||
|
|
||||||
treeHelper.messageToTree(verkaufsprodukt, vkp);
|
treeHelper.aprioriProduktToTree(verkaufsprodukt, vkp);
|
||||||
|
|
||||||
|
TreeView<GuiProdukt> tv = new TreeView<>(vkp);
|
||||||
|
|
||||||
TreeView<Object> tv = new TreeView<>(vkp);
|
|
||||||
|
|
||||||
tv.getSelectionModel().selectedItemProperty().addListener((obs, oldSelection, newSelection) -> {
|
tv.getSelectionModel().selectedItemProperty().addListener((obs, oldSelection, newSelection) -> {
|
||||||
if (newSelection != null) {
|
if (newSelection != null) {
|
||||||
|
|
||||||
if (!infoBox.getChildren().isEmpty()) {
|
if (!infoBox.getChildren().isEmpty()) {
|
||||||
infoBox.getChildren().removeAll(infoBox.getChildren());
|
infoBox.getChildren().removeAll(infoBox.getChildren());
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemAttribute itemAttribute = new ItemAttribute();
|
ItemAttribute itemAttribute = new ItemAttribute();
|
||||||
|
itemAttribute.setRisikoobjekte(risikoobjektView.getRisikoobjekte());
|
||||||
if (!infoBoxFromItem.isEmpty()) itemAttribute.setInfoBoxFromItem(infoBoxFromItem);
|
if (!infoBoxFromItem.isEmpty()) itemAttribute.setInfoBoxFromItem(infoBoxFromItem);
|
||||||
|
|
||||||
itemAttribute.addItemInfo(newSelection, infoBox);
|
itemAttribute.addItemInfo(newSelection, infoBox);
|
||||||
if (newSelection.getValue() instanceof VerkaufsproduktType){
|
if (newSelection.getValue().getProdukt() instanceof VerkaufsproduktType){
|
||||||
itemAttribute.addVpInfo(infoBox, isMeldungVorhanden((ProduktbausteinType) newSelection.getValue(), tv), (VerkaufsproduktType) newSelection.getValue());
|
itemAttribute.addVpInfo(infoBox, isMeldungVorhanden((ProduktbausteinType) newSelection.getValue().getProdukt(), tv), (VerkaufsproduktType) newSelection.getValue().getProdukt());
|
||||||
}
|
}
|
||||||
infoBoxFromItem = itemAttribute.getInfoBoxFromItem();
|
infoBoxFromItem = itemAttribute.getInfoBoxFromItem();
|
||||||
}else{
|
}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<>() {
|
tv.setCellFactory(tc -> new TreeCell<>() {
|
||||||
@Override
|
@Override
|
||||||
public void updateItem(Object item, boolean empty) {
|
public void updateItem(GuiProdukt item, boolean empty) {
|
||||||
super.updateItem(item, empty);
|
super.updateItem(item, empty);
|
||||||
|
|
||||||
if (item == null || empty) {
|
if (item == null || empty) {
|
||||||
@@ -211,7 +318,7 @@ public class AllinOneView extends Application {
|
|||||||
HBox cellBox = new HBox();
|
HBox cellBox = new HBox();
|
||||||
Button include = new Button("+");
|
Button include = new Button("+");
|
||||||
include.setStyle("-fx-margin: 5;");
|
include.setStyle("-fx-margin: 5;");
|
||||||
Label label = new Label(((ProduktbausteinType) item).getBezeichnung() + " ");
|
Label label = new Label(((ProduktbausteinType) item.getProdukt()).getBezeichnung() + " ");
|
||||||
Button remove = new Button("-");
|
Button remove = new Button("-");
|
||||||
|
|
||||||
remove.setVisible(true);
|
remove.setVisible(true);
|
||||||
@@ -224,8 +331,8 @@ public class AllinOneView extends Application {
|
|||||||
if (!shouldBeIncluded(getTreeItem())) {
|
if (!shouldBeIncluded(getTreeItem())) {
|
||||||
label.setFont(Font.font("System", FontPosture.ITALIC, label.getFont().getSize()));
|
label.setFont(Font.font("System", FontPosture.ITALIC, label.getFont().getSize()));
|
||||||
label.setTextFill(Paint.valueOf("#A0A0A0"));
|
label.setTextFill(Paint.valueOf("#A0A0A0"));
|
||||||
if (!isNotIncluded.contains(getTreeItem())) {
|
if (!(getTreeItem().getValue().isNotIncluded())) {
|
||||||
isNotIncluded.add(getTreeItem());
|
getTreeItem().getValue().setNotIncluded(true);
|
||||||
}
|
}
|
||||||
remove.setDisable(true);
|
remove.setDisable(true);
|
||||||
remove.setStyle("-fx-background-color: #CCCCCC");
|
remove.setStyle("-fx-background-color: #CCCCCC");
|
||||||
@@ -233,7 +340,7 @@ public class AllinOneView extends Application {
|
|||||||
label.setTextFill(Paint.valueOf("#000000"));
|
label.setTextFill(Paint.valueOf("#000000"));
|
||||||
remove.setVisible(true);
|
remove.setVisible(true);
|
||||||
|
|
||||||
isNotIncluded.remove(getTreeItem());
|
getTreeItem().getValue().setNotIncluded(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Region spacer = new Region();
|
Region spacer = new Region();
|
||||||
@@ -242,15 +349,15 @@ public class AllinOneView extends Application {
|
|||||||
|
|
||||||
label.setMaxWidth(Double.MAX_VALUE);
|
label.setMaxWidth(Double.MAX_VALUE);
|
||||||
|
|
||||||
if (getTreeItem().getValue() instanceof VerkaufsproduktType ||
|
if (getTreeItem().getValue().getProdukt() instanceof VerkaufsproduktType ||
|
||||||
getTreeItem().getValue().getClass().equals(APrioriVerkaufsproduktType.class)) {
|
getTreeItem().getValue().getClass().equals(APrioriVerkaufsproduktType.class)) {
|
||||||
cellBox.getChildren().addAll(label);
|
cellBox.getChildren().addAll(label);
|
||||||
} else if (timesItemisIncludedById.get(
|
} else if (timesItemisIncludedById.get(
|
||||||
((ProduktbausteinType) getTreeItem().getValue()).getId()) != null
|
((ProduktbausteinType) getTreeItem().getValue().getProdukt()).getId()) != null
|
||||||
&& ((ProduktbausteinType) getTreeItem().getValue()).getMaxVorkommen() != null
|
&& ((ProduktbausteinType) getTreeItem().getValue().getProdukt()).getMaxVorkommen() != null
|
||||||
&& ((ProduktbausteinType) getTreeItem().getValue()).getMaxVorkommen() <=
|
&& ((ProduktbausteinType) getTreeItem().getValue().getProdukt()).getMaxVorkommen() <=
|
||||||
timeItemIsIncludedByParent(getTreeItem().getParent(),
|
timeItemIsIncludedByParent(getTreeItem().getParent(),
|
||||||
((ProduktbausteinType) getTreeItem().getValue()).getId())) {
|
((ProduktbausteinType) getTreeItem().getValue().getProdukt()).getId())) {
|
||||||
include.setDisable(true);
|
include.setDisable(true);
|
||||||
include.setStyle("-fx-background-color: #CCCCCC");
|
include.setStyle("-fx-background-color: #CCCCCC");
|
||||||
cellBox.getChildren().addAll(label, spacer, include, spacer2, remove);
|
cellBox.getChildren().addAll(label, spacer, include, spacer2, remove);
|
||||||
@@ -259,18 +366,18 @@ public class AllinOneView extends Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
include.setOnAction(e -> {
|
include.setOnAction(e -> {
|
||||||
if (isNotIncluded.contains(getTreeItem())) {
|
if (getTreeItem().getValue().isNotIncluded()) {
|
||||||
label.setFont(Font.font("System", label.getFont().getSize()));
|
label.setFont(Font.font("System", label.getFont().getSize()));
|
||||||
label.setTextFill(Paint.valueOf("#000000"));
|
label.setTextFill(Paint.valueOf("#000000"));
|
||||||
remove.setVisible(true);
|
remove.setVisible(true);
|
||||||
|
|
||||||
timesItemisIncludedById.put(((ProduktbausteinType) getTreeItem().getValue()).getId(),
|
timesItemisIncludedById.put(((ProduktbausteinType) getTreeItem().getValue().getProdukt()).getId(),
|
||||||
(timesItemisIncludedById.get(
|
(timesItemisIncludedById.get(
|
||||||
((ProduktbausteinType) getTreeItem().getValue()).getId()) != null ?
|
((ProduktbausteinType) getTreeItem().getValue().getProdukt()).getId()) != null ?
|
||||||
timesItemisIncludedById.get(
|
timesItemisIncludedById.get(
|
||||||
((ProduktbausteinType) getTreeItem().getValue()).getId()) + 1 : 1));
|
((ProduktbausteinType) getTreeItem().getValue().getProdukt()).getId()) + 1 : 1));
|
||||||
|
|
||||||
isNotIncluded.remove(getTreeItem());
|
getTreeItem().getValue().setNotIncluded(false);
|
||||||
includeAddedParent(getTreeItem());
|
includeAddedParent(getTreeItem());
|
||||||
includeAddedChildren(getTreeItem());
|
includeAddedChildren(getTreeItem());
|
||||||
tv.setRoot(treeHelper.sortTree(tv.getRoot()));
|
tv.setRoot(treeHelper.sortTree(tv.getRoot()));
|
||||||
@@ -278,24 +385,40 @@ public class AllinOneView extends Application {
|
|||||||
timesItemisIncludedById.clear();
|
timesItemisIncludedById.clear();
|
||||||
refreshTimesItemisIncludedById(tv.getRoot());
|
refreshTimesItemisIncludedById(tv.getRoot());
|
||||||
} else {
|
} else {
|
||||||
TreeItem<Object> parent = getTreeItem().getParent();
|
TreeItem<GuiProdukt> parent = getTreeItem().getParent();
|
||||||
TreeItem<Object> clone = null;
|
TreeItem<GuiProdukt> clone = null;
|
||||||
try {
|
try {
|
||||||
clone = treeHelper.cloneTreeItem(
|
clone = treeHelper.cloneTreeItem(
|
||||||
treeHelper.findTreeItem((ProduktbausteinType) item, originalRoot));
|
treeHelper.findTreeItem((ProduktbausteinType) item.getProdukt(), originalRoot));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw new RuntimeException(ex);
|
throw new RuntimeException(ex);
|
||||||
}
|
}
|
||||||
parent.getChildren().add(clone);
|
parent.getChildren().add(clone);
|
||||||
|
|
||||||
refreshIsNotIncluded(clone, originalRoot);
|
|
||||||
|
|
||||||
timesItemisIncludedById.clear();
|
timesItemisIncludedById.clear();
|
||||||
refreshTimesItemisIncludedById(tv.getRoot());
|
refreshTimesItemisIncludedById(tv.getRoot());
|
||||||
|
|
||||||
tv.setRoot(treeHelper.sortTree(tv.getRoot()));
|
tv.setRoot(treeHelper.sortTree(tv.getRoot()));
|
||||||
tv.refresh();
|
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 -> {
|
remove.setOnAction(e -> {
|
||||||
@@ -303,18 +426,18 @@ public class AllinOneView extends Application {
|
|||||||
Map<String, Integer> countByAprioriParent = new HashMap<>();
|
Map<String, Integer> countByAprioriParent = new HashMap<>();
|
||||||
timesItemisIncludedById.clear();
|
timesItemisIncludedById.clear();
|
||||||
refreshTimesItemisIncludedById(tv.getRoot());
|
refreshTimesItemisIncludedById(tv.getRoot());
|
||||||
timesItemisIncludedById.replace(((ProduktbausteinType) item).getId(),
|
timesItemisIncludedById.replace(((ProduktbausteinType) item.getProdukt()).getId(),
|
||||||
timesItemisIncludedById.get(((ProduktbausteinType) item).getId()) - 1);
|
timesItemisIncludedById.get(((ProduktbausteinType) item.getProdukt()).getId()) - 1);
|
||||||
|
|
||||||
if (countChildIds(countByParent, getTreeItem().getParent()).get
|
if (countChildIds(countByParent, getTreeItem().getParent()).get
|
||||||
(((ProduktbausteinType) item).getId()).equals(countChildIds(countByAprioriParent,
|
(((ProduktbausteinType) item.getProdukt()).getId()).equals(countChildIds(countByAprioriParent,
|
||||||
treeHelper.findTreeItem(((ProduktbausteinType) item), originalRoot).getParent()).get(
|
treeHelper.findTreeItem(((ProduktbausteinType) item.getProdukt()), originalRoot).getParent()).get(
|
||||||
((ProduktbausteinType) item).getId()))) {
|
((ProduktbausteinType) item.getProdukt()).getId()))) {
|
||||||
label.setFont(Font.font("System", label.getFont().getSize()));
|
label.setFont(Font.font("System", label.getFont().getSize()));
|
||||||
label.setTextFill(Paint.valueOf("#A0A0A0"));
|
label.setTextFill(Paint.valueOf("#A0A0A0"));
|
||||||
remove.setVisible(false);
|
remove.setVisible(false);
|
||||||
|
|
||||||
isNotIncluded.add(getTreeItem());
|
getTreeItem().getValue().setNotIncluded(true);
|
||||||
includeAddedChildren(getTreeItem());
|
includeAddedChildren(getTreeItem());
|
||||||
|
|
||||||
tv.setRoot(treeHelper.sortTree(tv.getRoot()));
|
tv.setRoot(treeHelper.sortTree(tv.getRoot()));
|
||||||
@@ -326,13 +449,13 @@ public class AllinOneView extends Application {
|
|||||||
refreshTimesItemisIncludedById(tv.getRoot());
|
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);
|
AtomicBoolean symboleAdded = new AtomicBoolean(false);
|
||||||
Text symbole = new Text("\u26A0 ");
|
Text symbole = new Text("\u26A0 ");
|
||||||
symbole.setFont(Font.font("System", FontWeight.BOLD, symbole.getFont().getSize() + 2));
|
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)) {
|
if(m.getErrorType().equals(BigInteger.ONE)) {
|
||||||
symbole.setFill(Paint.valueOf("#aa3333"));
|
symbole.setFill(Paint.valueOf("#aa3333"));
|
||||||
symboleAdded.set(true);
|
symboleAdded.set(true);
|
||||||
@@ -355,14 +478,21 @@ public class AllinOneView extends Application {
|
|||||||
|
|
||||||
newCalcRequest.setOnAction(e -> {
|
newCalcRequest.setOnAction(e -> {
|
||||||
try {
|
try {
|
||||||
treeHelper.setIsNotIncluded(isNotIncluded);
|
TreeItem<GuiProdukt> cleanedRoot = treeHelper.cleanTree(tv.getRoot());
|
||||||
TreeItem<Object> cleanedRoot = treeHelper.cleanTree(tv.getRoot());
|
|
||||||
|
|
||||||
CalculateRequestAuskunftService s = new CalculateRequestAuskunftService(new SOAPConnector());
|
CalculateRequestAuskunftService s = new CalculateRequestAuskunftService(new SOAPConnector());
|
||||||
CalculateResponse calcResponse = s.aprioriAuskunft(new TreeView<>(cleanedRoot), stichtag.get());
|
TreeItem<GuiProdukt> newRoot = new TreeItem<>(cleanedRoot.getValue());
|
||||||
TreeItem<Object> newRoot = new TreeItem<>(cleanedRoot.getValue());
|
|
||||||
treeHelper.setTimesItemisIncludedById(timesItemisIncludedById);
|
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();
|
timesItemisIncludedById = treeHelper.getTimesItemisIncludedById();
|
||||||
newRoot.setExpanded(true);
|
newRoot.setExpanded(true);
|
||||||
|
|
||||||
@@ -400,6 +530,7 @@ public class AllinOneView extends Application {
|
|||||||
HBox.setHgrow(infoBox, Priority.ALWAYS);
|
HBox.setHgrow(infoBox, Priority.ALWAYS);
|
||||||
|
|
||||||
HBox splitBox = new HBox(treeBox, infoBox);
|
HBox splitBox = new HBox(treeBox, infoBox);
|
||||||
|
splitBox.setId("splitBox");
|
||||||
splitBox.setSpacing(10);
|
splitBox.setSpacing(10);
|
||||||
splitBox.setPadding(new Insets(20));
|
splitBox.setPadding(new Insets(20));
|
||||||
splitBox.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
|
splitBox.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
|
||||||
@@ -419,23 +550,22 @@ public class AllinOneView extends Application {
|
|||||||
return vbox;
|
return vbox;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void includeAddedParent(TreeItem<Object> treeItem) {
|
private void includeAddedParent(TreeItem<GuiProdukt> treeItem) {
|
||||||
if (treeItem.getParent() != null) {
|
if (treeItem.getParent() != null) {
|
||||||
isNotIncluded.remove(treeItem.getParent());
|
treeItem.getParent().getValue().setNotIncluded(false);
|
||||||
if (treeItem.getParent().getParent() != null) {
|
if (treeItem.getParent().getParent() != null) {
|
||||||
includeAddedParent(treeItem.getParent());
|
includeAddedParent(treeItem.getParent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void includeAddedChildren(TreeItem<Object> parent) {
|
private void includeAddedChildren(TreeItem<GuiProdukt> parent) {
|
||||||
for (int i = 0; i < parent.getChildren().size(); i++) {
|
for (int i = 0; i < parent.getChildren().size(); i++) {
|
||||||
isNotIncluded.remove(parent.getChildren().get(i));
|
parent.getChildren().get(i).getValue().setNotIncluded(false);
|
||||||
|
if (!shouldBeIncluded(parent.getChildren().get(i)) && !(parent.getChildren().get(i).getValue().isNotIncluded())) {
|
||||||
if (!shouldBeIncluded(parent.getChildren().get(i)) && !isNotIncluded.contains(parent.getChildren().get(i))) {
|
parent.getChildren().get(i).getValue().setNotIncluded(true);
|
||||||
isNotIncluded.add(parent.getChildren().get(i));
|
|
||||||
} else {
|
} 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) {
|
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) {
|
private boolean shouldBeIncluded(TreeItem<GuiProdukt> treeItem) {
|
||||||
for (int i = 0; i < clone.getChildren().size(); i++) {
|
return !(((treeItem.getParent() != null && treeItem.getParent().getValue().isNotIncluded()) || treeItem.getValue().isNotIncluded() ||
|
||||||
if (isNotIncluded.contains(treeHelper.findTreeItem(
|
(((ProduktbausteinType) treeItem.getValue().getProdukt()).getMinVorkommen() != null && ((ProduktbausteinType) treeItem.getValue().getProdukt()).getMinVorkommen() == 0 &&
|
||||||
((ProduktbausteinType) clone.getChildren().get(i).getValue()), originalRoot)) ||
|
(timesItemisIncludedById.get(((ProduktbausteinType) treeItem.getValue().getProdukt()).getId()) == null ||
|
||||||
((ProduktbausteinType) clone.getChildren().get(i).getValue()).getMinVorkommen() == 0) {
|
timesItemisIncludedById.get(((ProduktbausteinType) treeItem.getValue().getProdukt()).getId()) == 0))) &&
|
||||||
isNotIncluded.add(clone.getChildren().get(i));
|
!(treeItem.getValue().getProdukt() instanceof VerkaufsproduktType));
|
||||||
}
|
|
||||||
if (clone.getChildren().get(i).getChildren() != null || !clone.getChildren().get(i).getChildren().isEmpty()) {
|
|
||||||
refreshIsNotIncluded(clone.getChildren().get(i), originalRoot);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean shouldBeIncluded(TreeItem<Object> treeItem) {
|
private Map<String, Integer> countChildIds(Map<String, Integer> count, TreeItem<GuiProdukt> root) {
|
||||||
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) {
|
|
||||||
if (root != null) {
|
if (root != null) {
|
||||||
for (int i = 0; i < root.getChildren().size(); i++) {
|
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) {
|
if (count.get(((ProduktbausteinType) item.getValue().getProdukt()).getId()) == null) {
|
||||||
count.put(((ProduktbausteinType) item.getValue()).getId(), 1);
|
count.put(((ProduktbausteinType) item.getValue().getProdukt()).getId(), 1);
|
||||||
} else {
|
} else {
|
||||||
count.replace(((ProduktbausteinType) item.getValue()).getId(),
|
count.replace(((ProduktbausteinType) item.getValue().getProdukt()).getId(),
|
||||||
count.get(((ProduktbausteinType) item.getValue()).getId()) + 1);
|
count.get(((ProduktbausteinType) item.getValue().getProdukt()).getId()) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!item.getChildren().isEmpty()) {
|
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++) {
|
for (int i = 0; i < root.getChildren().size(); i++) {
|
||||||
TreeItem<Object> item = root.getChildren().get(i);
|
TreeItem<GuiProdukt> item = root.getChildren().get(i);
|
||||||
if (!isNotIncluded.contains(item)) {
|
if (!item.getValue().isNotIncluded()) {
|
||||||
if (timesItemisIncludedById.get(((ProduktbausteinType) item.getValue()).getId()) == null) {
|
if (timesItemisIncludedById.get(((ProduktbausteinType) item.getValue().getProdukt()).getId()) == null) {
|
||||||
timesItemisIncludedById.put(((ProduktbausteinType) item.getValue()).getId(), 1);
|
timesItemisIncludedById.put(((ProduktbausteinType) item.getValue().getProdukt()).getId(), 1);
|
||||||
} else {
|
} else {
|
||||||
timesItemisIncludedById.replace(((ProduktbausteinType) item.getValue()).getId(),
|
timesItemisIncludedById.replace(((ProduktbausteinType) item.getValue().getProdukt()).getId(),
|
||||||
timesItemisIncludedById.get(((ProduktbausteinType) item.getValue()).getId()) + 1);
|
timesItemisIncludedById.get(((ProduktbausteinType) item.getValue().getProdukt()).getId()) + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!item.getChildren().isEmpty()) {
|
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;
|
int erg = 0;
|
||||||
for (int i = 0; i < parent.getChildren().size(); i++) {
|
for (int i = 0; i < parent.getChildren().size(); i++) {
|
||||||
TreeItem<Object> item = parent.getChildren().get(i);
|
TreeItem<GuiProdukt> item = parent.getChildren().get(i);
|
||||||
if (((ProduktbausteinType) item.getValue()).getId().equals(itemId)) {
|
if (((ProduktbausteinType) item.getValue().getProdukt()).getId().equals(itemId)) {
|
||||||
if (!isNotIncluded.contains(item)) {
|
if (!item.getValue().isNotIncluded()) {
|
||||||
erg++;
|
erg++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -517,11 +634,11 @@ public class AllinOneView extends Application {
|
|||||||
|
|
||||||
return erg;
|
return erg;
|
||||||
}
|
}
|
||||||
private boolean isMeldungVorhanden(ProduktbausteinType produkt, TreeView<Object> tv) {
|
private boolean isMeldungVorhanden(ProduktbausteinType produkt, TreeView<GuiProdukt> tv) {
|
||||||
TreeHelper treeHelper = new TreeHelper();
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
for (ProduktbausteinType child : produkt.getBausteine()){
|
for (ProduktbausteinType child : produkt.getBausteine()){
|
||||||
@@ -529,4 +646,31 @@ public class AllinOneView extends Application {
|
|||||||
}
|
}
|
||||||
return false;
|
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 at.vvo.omds.types.omds3.r2025_05.common.*;
|
||||||
import javafx.animation.PauseTransition;
|
import javafx.animation.PauseTransition;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
import javafx.scene.control.CheckBox;
|
import javafx.scene.Node;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.*;
|
||||||
import javafx.scene.control.TextField;
|
|
||||||
import javafx.scene.control.TreeItem;
|
|
||||||
import javafx.scene.layout.HBox;
|
import javafx.scene.layout.HBox;
|
||||||
import javafx.scene.layout.VBox;
|
import javafx.scene.layout.VBox;
|
||||||
import javafx.scene.paint.Paint;
|
import javafx.scene.paint.Paint;
|
||||||
@@ -17,55 +15,37 @@ import javafx.util.Duration;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class ItemAttribute {
|
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;
|
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;
|
this.infoBoxFromItem = infoBoxFromItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public VBox addItemInfo(TreeItem<Object> newSelection, VBox attributBox) {
|
public VBox addItemInfo(TreeItem<GuiProdukt> newSelection, VBox attributBox) {
|
||||||
if (((ProduktbausteinType)newSelection.getValue()).getMeldungen() != null && !((ProduktbausteinType)newSelection.getValue()).getMeldungen().isEmpty()){
|
for(int j = 0; j < ((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().size(); j++) {
|
||||||
attributBox.getChildren().removeIf(n -> n.getId().equals("faultsbox"));
|
|
||||||
|
|
||||||
VBox faultsBox = new VBox();
|
|
||||||
for (ServiceFault sf : ((ProduktbausteinType)newSelection.getValue()).getMeldungen()) {
|
|
||||||
HBox singleFaultBox = new HBox();
|
|
||||||
singleFaultBox.setPadding(new Insets(10));
|
|
||||||
|
|
||||||
Text symbole = new Text("\u26A0 ");
|
|
||||||
symbole.setFont(Font.font("System", FontWeight.BOLD, symbole.getFont().getSize() + 2));
|
|
||||||
|
|
||||||
|
|
||||||
if (sf.getErrorType().equals(BigInteger.ONE)){
|
|
||||||
symbole.setFill(Paint.valueOf("#aa3333"));
|
|
||||||
} else if (sf.getErrorType().equals(BigInteger.TWO)) {
|
|
||||||
symbole.setFill(Paint.valueOf("#ccbb00"));
|
|
||||||
}
|
|
||||||
Label errorText = new Label(sf.getErrorMsg() + System.lineSeparator());
|
|
||||||
|
|
||||||
singleFaultBox.getChildren().addAll(symbole, errorText);
|
|
||||||
faultsBox.getChildren().add(singleFaultBox);
|
|
||||||
}
|
|
||||||
|
|
||||||
attributBox.getChildren().addFirst(faultsBox);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(int j = 0; j < ((ProduktbausteinType)newSelection.getValue()).getAttribute().size(); j++) {
|
|
||||||
VBox singleAttributBox = new VBox();
|
VBox singleAttributBox = new VBox();
|
||||||
singleAttributBox.setPadding(new Insets(10));
|
singleAttributBox.setPadding(new Insets(10));
|
||||||
|
|
||||||
Label label = new Label(
|
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();
|
TextField textField = new TextField();
|
||||||
|
|
||||||
|
|
||||||
CheckBox checkBox = new CheckBox();
|
CheckBox checkBox = new CheckBox();
|
||||||
|
|
||||||
AttributStringType stringAttribut;
|
AttributStringType stringAttribut;
|
||||||
@@ -73,14 +53,14 @@ public class ItemAttribute {
|
|||||||
AttributDezimalType attributDezimal;
|
AttributDezimalType attributDezimal;
|
||||||
AttributIntType attributInt;
|
AttributIntType attributInt;
|
||||||
|
|
||||||
if (((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j).getClass()
|
if (((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().get(j).getClass()
|
||||||
.equals(AttributBooleanType.class)) {
|
.equals(AttributBooleanType.class)) {
|
||||||
attributDezimal = null;
|
attributDezimal = null;
|
||||||
attributInt = null;
|
attributInt = null;
|
||||||
stringAttribut = null;
|
stringAttribut = null;
|
||||||
|
|
||||||
attributBoolean = (AttributBooleanType) (
|
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)
|
if (infoBoxFromItem.get(newSelection) != null && infoBoxFromItem.get(newSelection).get(attributBoolean)
|
||||||
!= null && !infoBoxFromItem.get(newSelection).get(attributBoolean).isEmpty()){
|
!= null && !infoBoxFromItem.get(newSelection).get(attributBoolean).isEmpty()){
|
||||||
@@ -90,13 +70,13 @@ public class ItemAttribute {
|
|||||||
checkBox.setSelected(true);
|
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)) {
|
.equals(AttributStringType.class)) {
|
||||||
attributDezimal = null;
|
attributDezimal = null;
|
||||||
attributBoolean = null;
|
attributBoolean = null;
|
||||||
attributInt = null;
|
attributInt = null;
|
||||||
|
|
||||||
stringAttribut = (AttributStringType) ((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j);
|
stringAttribut = (AttributStringType) ((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().get(j);
|
||||||
|
|
||||||
if (stringAttribut.isPflichtfeld()) {
|
if (stringAttribut.isPflichtfeld()) {
|
||||||
label.setText(label.getText().substring(0, label.getText().length()-2) + "*: ");
|
label.setText(label.getText().substring(0, label.getText().length()-2) + "*: ");
|
||||||
@@ -115,13 +95,13 @@ public class ItemAttribute {
|
|||||||
}
|
}
|
||||||
textField.setPromptText("Text eingeben");
|
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)) {
|
.equals(AttributDezimalType.class)) {
|
||||||
attributBoolean = null;
|
attributBoolean = null;
|
||||||
attributInt = null;
|
attributInt = null;
|
||||||
stringAttribut = null;
|
stringAttribut = null;
|
||||||
|
|
||||||
attributDezimal = (AttributDezimalType) ((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j);
|
attributDezimal = (AttributDezimalType) ((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().get(j);
|
||||||
|
|
||||||
if (attributDezimal.isPflichtfeld()) {
|
if (attributDezimal.isPflichtfeld()) {
|
||||||
label.setText(label.getText().substring(0, label.getText().length()-2) + "*: ");
|
label.setText(label.getText().substring(0, label.getText().length()-2) + "*: ");
|
||||||
@@ -144,7 +124,7 @@ public class ItemAttribute {
|
|||||||
attributBoolean = null;
|
attributBoolean = null;
|
||||||
stringAttribut = null;
|
stringAttribut = null;
|
||||||
|
|
||||||
attributInt = (AttributIntType) ((ProduktbausteinType)newSelection.getValue()).getAttribute().get(j);
|
attributInt = (AttributIntType) ((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().get(j);
|
||||||
|
|
||||||
if (attributInt.isPflichtfeld()) {
|
if (attributInt.isPflichtfeld()) {
|
||||||
label.setText(label.getText().substring(0, label.getText().length()-2) + "*: ");
|
label.setText(label.getText().substring(0, label.getText().length()-2) + "*: ");
|
||||||
@@ -183,7 +163,7 @@ public class ItemAttribute {
|
|||||||
infoBoxFromItem.computeIfAbsent(newSelection,
|
infoBoxFromItem.computeIfAbsent(newSelection,
|
||||||
k -> new HashMap<>()).put(attributBoolean, checkBox.isSelected() ? "true" : "false");
|
k -> new HashMap<>()).put(attributBoolean, checkBox.isSelected() ? "true" : "false");
|
||||||
attributBoolean.setValue(checkBox.isSelected());
|
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) -> {
|
textField.focusedProperty().addListener((observableValue, oldVal, newVal) -> {
|
||||||
@@ -236,7 +216,7 @@ public class ItemAttribute {
|
|||||||
}else {
|
}else {
|
||||||
if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
|
if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
|
||||||
attributDezimal.setValue(new BigDecimal(eingabe));
|
attributDezimal.setValue(new BigDecimal(eingabe));
|
||||||
((ProduktbausteinType)newSelection.getValue()).getAttribute().set(finalJ, attributDezimal);
|
((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().set(finalJ, attributDezimal);
|
||||||
}
|
}
|
||||||
} else if (attributInt != null) {
|
} else if (attributInt != null) {
|
||||||
infoBoxFromItem.computeIfAbsent(newSelection,
|
infoBoxFromItem.computeIfAbsent(newSelection,
|
||||||
@@ -268,7 +248,7 @@ public class ItemAttribute {
|
|||||||
}else {
|
}else {
|
||||||
if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
|
if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
|
||||||
attributInt.setValue(Integer.parseInt(textField.getText()));
|
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) {
|
} else if (stringAttribut != null) {
|
||||||
infoBoxFromItem.computeIfAbsent(newSelection,
|
infoBoxFromItem.computeIfAbsent(newSelection,
|
||||||
@@ -292,12 +272,12 @@ public class ItemAttribute {
|
|||||||
pause.play();
|
pause.play();
|
||||||
|
|
||||||
if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
|
if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
|
||||||
((ProduktbausteinType)newSelection.getValue()).getAttribute().set(finalJ, attributInt);
|
((ProduktbausteinType)newSelection.getValue().getProdukt()).getAttribute().set(finalJ, attributInt);
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
|
if (singleAttributBox.getChildren().size() > 2) singleAttributBox.getChildren().removeLast();
|
||||||
stringAttribut.setValue(textField.getText());
|
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) {
|
if (attributBoolean != null) {
|
||||||
singleAttributBox.getChildren().addAll(label, checkBox);
|
singleAttributBox.getChildren().addAll(label, checkBox);
|
||||||
}else {
|
}else {
|
||||||
|
textField.setId("textField");
|
||||||
singleAttributBox.getChildren().addAll(label, textField);
|
singleAttributBox.getChildren().addAll(label, textField);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
singleAttributBox.setId("singleAttributBox");
|
||||||
|
|
||||||
attributBox.getChildren().add(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;
|
return attributBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package at.vvo.omds.client.gui;
|
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;
|
import at.vvo.omds.types.omds3.r2025_05.on2antrag.kfz.ObjectFactory;
|
||||||
|
|
||||||
public class ObjectFactoryFactory {
|
public class ObjectFactoryFactory {
|
||||||
public Object create(String classPath) {
|
public ProduktbausteinType create(String classPath) {
|
||||||
if (classPath != null) {
|
if (classPath != null) {
|
||||||
if (classPath.toLowerCase().contains("kfz")){
|
if (classPath.toLowerCase().contains("kfz")){
|
||||||
ObjectFactory of = new ObjectFactory();
|
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.APrioriProduktbausteinType;
|
||||||
import at.vvo.omds.types.omds3.r2025_05.common.ProduktbausteinType;
|
import at.vvo.omds.types.omds3.r2025_05.common.ProduktbausteinType;
|
||||||
import javafx.collections.FXCollections;
|
|
||||||
import javafx.scene.control.TreeItem;
|
import javafx.scene.control.TreeItem;
|
||||||
import javafx.scene.text.Text;
|
|
||||||
import javafx.scene.text.TextFlow;
|
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class TreeHelper {
|
public class TreeHelper {
|
||||||
Map<String, Integer> timesItemisIncludedById = new HashMap<>();
|
Map<String, Integer> timesItemisIncludedById = new HashMap<>();
|
||||||
List<TreeItem<Object>> isNotIncluded = new ArrayList<>();
|
|
||||||
|
|
||||||
public Map<String, Integer> getTimesItemisIncludedById() {
|
public Map<String, Integer> getTimesItemisIncludedById() {
|
||||||
return timesItemisIncludedById;
|
return timesItemisIncludedById;
|
||||||
@@ -22,22 +17,14 @@ public class TreeHelper {
|
|||||||
this.timesItemisIncludedById = timesItemisIncludedById;
|
this.timesItemisIncludedById = timesItemisIncludedById;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TreeItem<Object>> getIsNotIncluded() {
|
public TreeItem<GuiProdukt> cleanTree(TreeItem<GuiProdukt> original) {
|
||||||
return isNotIncluded;
|
if (original.getValue().isNotIncluded()) {
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsNotIncluded(List<TreeItem<Object>> isNotIncluded) {
|
|
||||||
this.isNotIncluded = isNotIncluded;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TreeItem<Object> cleanTree(TreeItem<Object> original) {
|
|
||||||
if (isNotIncluded.contains(original)) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeItem<Object> newItem = new TreeItem<>(original.getValue());
|
TreeItem<GuiProdukt> newItem = new TreeItem<>(original.getValue());
|
||||||
for (TreeItem<Object> child : original.getChildren()) {
|
for (TreeItem<GuiProdukt> child : original.getChildren()) {
|
||||||
TreeItem<Object> cleanedChild = cleanTree(child);
|
TreeItem<GuiProdukt> cleanedChild = cleanTree(child);
|
||||||
if (cleanedChild != null) {
|
if (cleanedChild != null) {
|
||||||
newItem.getChildren().add(cleanedChild);
|
newItem.getChildren().add(cleanedChild);
|
||||||
}
|
}
|
||||||
@@ -45,110 +32,121 @@ public class TreeHelper {
|
|||||||
return newItem;
|
return newItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreeItem<Object> cloneTreeItem(TreeItem<Object> original) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
|
public TreeItem<GuiProdukt> cloneTreeItem(TreeItem<GuiProdukt> original) {
|
||||||
Object cloneOriginalValue;
|
ProduktbausteinType cloneOriginalValue;
|
||||||
|
|
||||||
cloneOriginalValue = new ObjectFactoryFactory().create(((ProduktbausteinType) original.getValue()).getTyp());
|
cloneOriginalValue = new ObjectFactoryFactory().create(((ProduktbausteinType) original.getValue().getProdukt()).getTyp());
|
||||||
|
|
||||||
((ProduktbausteinType) cloneOriginalValue).setId(
|
cloneOriginalValue.setId(
|
||||||
((ProduktbausteinType) original.getValue()).getId());
|
((ProduktbausteinType) original.getValue().getProdukt()).getId());
|
||||||
((ProduktbausteinType) cloneOriginalValue).setBezeichnung(
|
cloneOriginalValue.setBezeichnung(
|
||||||
((ProduktbausteinType) original.getValue()).getBezeichnung());
|
((ProduktbausteinType) original.getValue().getProdukt()).getBezeichnung());
|
||||||
((ProduktbausteinType) cloneOriginalValue).setVerkaufsoffenVon(
|
cloneOriginalValue.setVerkaufsoffenVon(
|
||||||
((ProduktbausteinType) original.getValue()).getVerkaufsoffenVon());
|
((ProduktbausteinType) original.getValue().getProdukt()).getVerkaufsoffenVon());
|
||||||
((ProduktbausteinType) cloneOriginalValue).setVerkaufsoffenBis(
|
cloneOriginalValue.setVerkaufsoffenBis(
|
||||||
((ProduktbausteinType) original.getValue()).getVerkaufsoffenBis());
|
((ProduktbausteinType) original.getValue().getProdukt()).getVerkaufsoffenBis());
|
||||||
((ProduktbausteinType) cloneOriginalValue).getAttribute().addAll(
|
cloneOriginalValue.getAttribute().addAll(
|
||||||
((ProduktbausteinType) original.getValue()).getAttribute());
|
((ProduktbausteinType) original.getValue().getProdukt()).getAttribute());
|
||||||
((ProduktbausteinType) cloneOriginalValue).getMeldungen().addAll(
|
cloneOriginalValue.getMeldungen().addAll(
|
||||||
((ProduktbausteinType) original.getValue()).getMeldungen());
|
((ProduktbausteinType) original.getValue().getProdukt()).getMeldungen());
|
||||||
((ProduktbausteinType) cloneOriginalValue).setMinVorkommen(
|
cloneOriginalValue.setMinVorkommen(
|
||||||
((ProduktbausteinType) original.getValue()).getMinVorkommen());
|
((ProduktbausteinType) original.getValue().getProdukt()).getMinVorkommen());
|
||||||
((ProduktbausteinType) cloneOriginalValue).setMaxVorkommen(
|
cloneOriginalValue.setMaxVorkommen(
|
||||||
((ProduktbausteinType) original.getValue()).getMaxVorkommen());
|
((ProduktbausteinType) original.getValue().getProdukt()).getMaxVorkommen());
|
||||||
((ProduktbausteinType) cloneOriginalValue).setTyp(
|
cloneOriginalValue.setTyp(
|
||||||
((ProduktbausteinType) original.getValue()).getTyp());
|
((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<GuiProdukt> child : original.getChildren()) {
|
||||||
|
|
||||||
for (TreeItem<Object> child : original.getChildren()) {
|
|
||||||
clonedItem.getChildren().add(cloneTreeItem(child));
|
clonedItem.getChildren().add(cloneTreeItem(child));
|
||||||
}
|
}
|
||||||
|
clonedItem.setExpanded(true);
|
||||||
|
|
||||||
|
clonedItem.getValue().setNotIncluded(original.getValue().isNotIncluded());
|
||||||
|
|
||||||
return clonedItem;
|
return clonedItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreeItem<Object> findTreeItem(ProduktbausteinType item, TreeItem<Object> root) {
|
public TreeItem<GuiProdukt> findTreeItem(ProduktbausteinType item, TreeItem<GuiProdukt> root) {
|
||||||
if (((ProduktbausteinType) root.getValue()).getId().equals(item.getId())) {
|
if (((ProduktbausteinType) root.getValue().getProdukt()).getId().equals(item.getId())) {
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
for (TreeItem<Object> child : root.getChildren()) {
|
for (TreeItem<GuiProdukt> child : root.getChildren()) {
|
||||||
TreeItem<Object> found = findTreeItem(item, child);
|
TreeItem<GuiProdukt> found = findTreeItem(item, child);
|
||||||
if (found != null) return found;
|
if (found != null) return found;
|
||||||
}
|
}
|
||||||
return null;
|
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()) {
|
if (!produkt.getBausteine().isEmpty()) {
|
||||||
for (int i = 0; i < produkt.getBausteine().size(); i++) {
|
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);
|
up.setExpanded(true);
|
||||||
if (!produkt.getBausteine().get(i).getBausteine().isEmpty()) {
|
if (!produkt.getBausteine().get(i).getBausteine().isEmpty()) {
|
||||||
messageToTree(produkt.getBausteine().get(i), up);
|
aprioriProduktToTree(produkt.getBausteine().get(i), up);
|
||||||
}
|
}
|
||||||
treeItem.getChildren().add(up);
|
treeItem.getChildren().add(up);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void calcMessageToTree(ProduktbausteinType produkt, TreeItem<Object> treeItem) {
|
public void produktToTree(ProduktbausteinType produkt, TreeItem<GuiProdukt> treeItem) throws Exception {
|
||||||
if (!produkt.getBausteine().isEmpty()) {
|
if (produkt != null && !produkt.getBausteine().isEmpty()) {
|
||||||
for (int i = 0; i < produkt.getBausteine().size(); i++) {
|
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);
|
up.setExpanded(true);
|
||||||
if (!produkt.getBausteine().get(i).getBausteine().isEmpty()) {
|
if (!produkt.getBausteine().get(i).getBausteine().isEmpty()) {
|
||||||
calcMessageToTree(produkt.getBausteine().get(i), up);
|
produktToTree(produkt.getBausteine().get(i), up);
|
||||||
}
|
}
|
||||||
treeItem.getChildren().add(up);
|
treeItem.getChildren().add(up);
|
||||||
if (!timesItemisIncludedById.containsKey(((ProduktbausteinType) up.getValue()).getId())) {
|
if (!timesItemisIncludedById.containsKey(((ProduktbausteinType) up.getValue().getProdukt()).getId())) {
|
||||||
timesItemisIncludedById.put(((ProduktbausteinType) up.getValue()).getId(), 1);
|
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<>();
|
TreeItem<GuiProdukt> ergItem = new TreeItem<>();
|
||||||
Object erg = new ObjectFactoryFactory().create(((APrioriProduktbausteinType) produkt.getValue()).getType());
|
Object erg = new ObjectFactoryFactory().create(
|
||||||
|
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getType());
|
||||||
|
|
||||||
if (erg != null) {
|
if (erg != null) {
|
||||||
if (ProduktbausteinType.class.isAssignableFrom(erg.getClass())) {
|
if (ProduktbausteinType.class.isAssignableFrom(erg.getClass())) {
|
||||||
((ProduktbausteinType) erg).setId(
|
((ProduktbausteinType) erg).setId(
|
||||||
((APrioriProduktbausteinType) produkt.getValue()).getId());
|
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getId());
|
||||||
((ProduktbausteinType) erg).setBezeichnung(
|
((ProduktbausteinType) erg).setBezeichnung(
|
||||||
((APrioriProduktbausteinType) produkt.getValue()).getName());
|
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getName());
|
||||||
((ProduktbausteinType) erg).setVerkaufsoffenVon(
|
((ProduktbausteinType) erg).setVerkaufsoffenVon(
|
||||||
((APrioriProduktbausteinType) produkt.getValue()).getFrom());
|
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getFrom());
|
||||||
((ProduktbausteinType) erg).setVerkaufsoffenBis(
|
((ProduktbausteinType) erg).setVerkaufsoffenBis(
|
||||||
((APrioriProduktbausteinType) produkt.getValue()).getTo());
|
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getTo());
|
||||||
((ProduktbausteinType) erg).getMeldungen().addAll(
|
((ProduktbausteinType) erg).getMeldungen().addAll(
|
||||||
((APrioriProduktbausteinType) produkt.getValue()).getMeldungen());
|
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getMeldungen());
|
||||||
((ProduktbausteinType) erg).getAttribute().addAll(
|
((ProduktbausteinType) erg).getAttribute().addAll(
|
||||||
((APrioriProduktbausteinType) produkt.getValue()).getAttribute());
|
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getAttribute());
|
||||||
((ProduktbausteinType) erg).setMinVorkommen(
|
((ProduktbausteinType) erg).setMinVorkommen(
|
||||||
((APrioriProduktbausteinType) produkt.getValue()).getMinOccurrences());
|
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getMinOccurrences());
|
||||||
((ProduktbausteinType) erg).setMaxVorkommen(
|
((ProduktbausteinType) erg).setMaxVorkommen(
|
||||||
((APrioriProduktbausteinType) produkt.getValue()).getMaxOccurrences());
|
((APrioriProduktbausteinType) produkt.getValue().getProdukt()).getMaxOccurrences());
|
||||||
((ProduktbausteinType) erg).setTyp(
|
((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(
|
((ProduktbausteinType) erg).getBausteine().add((ProduktbausteinType) aprioriItemToCalcItem(
|
||||||
new TreeItem<>(((APrioriProduktbausteinType) produkt.getValue())
|
new TreeItem<>(new GuiProdukt(((APrioriProduktbausteinType) produkt.getValue().getProdukt())
|
||||||
.getBausteine().get(i))).getValue());
|
.getBausteine().get(i)))).getValue().getProdukt());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < produkt.getChildren().size(); i++) {
|
for (int i = 0; i < produkt.getChildren().size(); i++) {
|
||||||
@@ -157,51 +155,82 @@ public class TreeHelper {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("Objekt kann nicht erzeugt werden. Unbekannte Klasse "
|
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;
|
return ergItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreeItem<Object> addAprioriToCalc(TreeItem<Object> calcItem, TreeItem<Object> aprioriItem)
|
// public TreeItem<GuiProdukt> addAprioriToCalc(TreeItem<GuiProdukt> calcItem, TreeItem<GuiProdukt> aprioriItem) {
|
||||||
throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
|
// for (TreeItem<GuiProdukt> aprioriChild : aprioriItem.getChildren()) {
|
||||||
for (TreeItem<Object> aprioriChild : aprioriItem.getChildren()) {
|
// boolean isInCalc = false;
|
||||||
boolean isInCalc = false;
|
// int i = 0;
|
||||||
int i = 0;
|
// for (TreeItem<GuiProdukt> calcChild : calcItem.getChildren()) {
|
||||||
for (TreeItem<Object> calcChild : calcItem.getChildren()) {
|
// if (((ProduktbausteinType) calcChild.getValue().getProdukt()).getId().equals(
|
||||||
if (((ProduktbausteinType) calcChild.getValue()).getId().equals(((ProduktbausteinType) aprioriChild.getValue()).getId()) || isNotIncluded.contains(calcChild)) {
|
// ((ProduktbausteinType) aprioriChild.getValue().getProdukt()).getId())
|
||||||
isInCalc = true;
|
// && !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()) {
|
if (!aprioriChild.getChildren().isEmpty()) {
|
||||||
calcChild = addAprioriToCalc(calcChild, aprioriChild);
|
addAprioriToCalc(matchingCalcChild, aprioriChild);
|
||||||
calcItem.getChildren().set(i, calcChild);
|
}
|
||||||
}
|
} else {
|
||||||
}
|
TreeItem<GuiProdukt> cloned = cloneTreeItem(aprioriChild);
|
||||||
i++;
|
cloned.getValue().setNotIncluded(true);
|
||||||
}
|
|
||||||
if (!isInCalc) {
|
calcItem.getChildren().add(cloned);
|
||||||
TreeItem<Object> missingCalcItem = cloneTreeItem(aprioriChild);
|
|
||||||
calcItem.getChildren().add(missingCalcItem);
|
|
||||||
if (!isNotIncluded.contains(missingCalcItem)) {
|
|
||||||
isNotIncluded.add(missingCalcItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return calcItem;
|
return calcItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreeItem<Object> sortTree(TreeItem<Object> parent) {
|
public TreeItem<GuiProdukt> sortTree(TreeItem<GuiProdukt> parent) {
|
||||||
FXCollections.sort(parent.getChildren(), Comparator.comparing(
|
// FXCollections.sort(parent.getChildren(), Comparator.comparing(
|
||||||
item -> ((ProduktbausteinType) item.getValue()).getBezeichnung().toLowerCase()
|
// item -> ((ProduktbausteinType)((TreeItem<GuiProdukt>)item).getValue().getProdukt()).getBezeichnung()
|
||||||
));
|
// ));
|
||||||
|
//
|
||||||
for (TreeItem<Object> child : parent.getChildren()) {
|
// Comparator<TreeItem<GuiProdukt>> compareBez = (s1, s2) -> {
|
||||||
sortTree(child);
|
// 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;
|
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;
|
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.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.ProductsRequest;
|
||||||
import at.vvo.omds.types.omds3.r2025_05.common.ProductsResponse;
|
import at.vvo.omds.types.omds3.r2025_05.common.ProductsResponse;
|
||||||
import jakarta.xml.bind.JAXBElement;
|
import jakarta.xml.bind.JAXBElement;
|
||||||
|
import javafx.util.Pair;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import javax.xml.datatype.XMLGregorianCalendar;
|
import javax.xml.datatype.XMLGregorianCalendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public class AprioriAuskunftService {
|
public class AprioriAuskunftService {
|
||||||
@@ -34,4 +39,16 @@ public class AprioriAuskunftService {
|
|||||||
|
|
||||||
return response;
|
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;
|
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.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.common.*;
|
||||||
import at.vvo.omds.types.omds3.r2025_05.on2antrag.common.*;
|
import at.vvo.omds.types.omds3.r2025_05.on2antrag.common.*;
|
||||||
import jakarta.xml.bind.JAXBElement;
|
import jakarta.xml.bind.JAXBElement;
|
||||||
import javafx.scene.control.TreeItem;
|
import javafx.scene.control.TreeItem;
|
||||||
import javafx.scene.control.TreeView;
|
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.datatype.XMLGregorianCalendar;
|
||||||
import javax.xml.namespace.QName;
|
import javax.xml.namespace.QName;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
|
||||||
public class BuildCalculateRequestAuskunft {
|
public class BuildCalculateRequestAuskunft {
|
||||||
private static final at.vvo.omds.types.omds3.r2025_05.on2antrag.common.ObjectFactory OUOF =
|
private static final at.vvo.omds.types.omds3.r2025_05.on2antrag.common.ObjectFactory OUOF =
|
||||||
@@ -16,11 +22,11 @@ public class BuildCalculateRequestAuskunft {
|
|||||||
|
|
||||||
private 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();
|
CalculateRequest request = OUOF.createCalculateRequest();
|
||||||
VerkaufsproduktType verkaufsprodukt = TreeViewToVerkaufsprodukt(treeView, vtBeg);
|
VerkaufsproduktType verkaufsprodukt = TreeViewToVerkaufsprodukt(treeView, vtBeg);
|
||||||
verkaufsprodukt.setVtgBeg(vtBeg);
|
verkaufsprodukt.setVtgBeg(vtBeg);
|
||||||
verkaufsprodukt.setTyp(((ProduktbausteinType)treeView.getRoot().getValue()).getTyp());
|
verkaufsprodukt.setTyp(((ProduktbausteinType)treeView.getRoot().getValue().getProdukt()).getTyp());
|
||||||
SpezBerechnungGenType berechnungsanfrage = new SpezBerechnungGenType();
|
SpezBerechnungGenType berechnungsanfrage = new SpezBerechnungGenType();
|
||||||
|
|
||||||
berechnungsanfrage.setVerkaufsprodukt(verkaufsprodukt);
|
berechnungsanfrage.setVerkaufsprodukt(verkaufsprodukt);
|
||||||
@@ -31,28 +37,43 @@ public class BuildCalculateRequestAuskunft {
|
|||||||
return createCalculateRequest(request);
|
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) {
|
public static JAXBElement<CalculateRequest> createCalculateRequest(CalculateRequest value) {
|
||||||
return new JAXBElement<>(new QName("urn:at.vvo.omds.types.omds3types.v1-3-0.on2antrag.common","CalculateRequest"),
|
return new JAXBElement<>(new QName("urn:at.vvo.omds.types.omds3types.v1-3-0.on2antrag.common","CalculateRequest"),
|
||||||
CalculateRequest.class, null, value);
|
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 baustein = (ProduktbausteinType) new ObjectFactoryFactory().create(
|
||||||
((ProduktbausteinType)treeItem.getValue()).getTyp());
|
((ProduktbausteinType)treeItem.getValue().getProdukt()).getTyp());
|
||||||
|
|
||||||
baustein.setBezeichnung(((ProduktbausteinType)treeItem.getValue()).getBezeichnung());
|
baustein.setBezeichnung(((ProduktbausteinType)treeItem.getValue().getProdukt()).getBezeichnung());
|
||||||
baustein.setId(((ProduktbausteinType)treeItem.getValue()).getId());
|
baustein.setId(((ProduktbausteinType)treeItem.getValue().getProdukt()).getId());
|
||||||
baustein.setVerkaufsoffenVon(((ProduktbausteinType)treeItem.getValue()).getVerkaufsoffenVon());
|
baustein.setVerkaufsoffenVon(((ProduktbausteinType)treeItem.getValue().getProdukt()).getVerkaufsoffenVon());
|
||||||
baustein.setVerkaufsoffenBis(((ProduktbausteinType)treeItem.getValue()).getVerkaufsoffenBis());
|
baustein.setVerkaufsoffenBis(((ProduktbausteinType)treeItem.getValue().getProdukt()).getVerkaufsoffenBis());
|
||||||
baustein.getAttribute().addAll(((ProduktbausteinType)treeItem.getValue()).getAttribute());
|
baustein.getAttribute().addAll(((ProduktbausteinType)treeItem.getValue().getProdukt()).getAttribute());
|
||||||
baustein.setTyp(((ProduktbausteinType)treeItem.getValue()).getTyp());
|
baustein.setTyp(((ProduktbausteinType)treeItem.getValue().getProdukt()).getTyp());
|
||||||
baustein.setMinVorkommen(((ProduktbausteinType)treeItem.getValue()).getMinVorkommen());
|
baustein.setMinVorkommen(((ProduktbausteinType)treeItem.getValue().getProdukt()).getMinVorkommen());
|
||||||
baustein.setMaxVorkommen(((ProduktbausteinType)treeItem.getValue()).getMaxVorkommen());
|
baustein.setMaxVorkommen(((ProduktbausteinType)treeItem.getValue().getProdukt()).getMaxVorkommen());
|
||||||
|
|
||||||
return baustein;
|
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());
|
VerkaufsproduktType verkaufsprodukt = (VerkaufsproduktType) TreeItemToBaustein(treeView.getRoot());
|
||||||
verkaufsprodukt.setVtgBeg(vtBeg);
|
verkaufsprodukt.setVtgBeg(vtBeg);
|
||||||
|
|
||||||
@@ -65,7 +86,7 @@ public class BuildCalculateRequestAuskunft {
|
|||||||
return verkaufsprodukt;
|
return verkaufsprodukt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ProduktbausteinType addUpFromTreeItem(TreeItem<Object> treeItem) {
|
public static ProduktbausteinType addUpFromTreeItem(TreeItem<GuiProdukt> treeItem) {
|
||||||
ProduktbausteinType baustein = (ProduktbausteinType) TreeItemToBaustein(treeItem);
|
ProduktbausteinType baustein = (ProduktbausteinType) TreeItemToBaustein(treeItem);
|
||||||
|
|
||||||
if (!treeItem.getChildren().isEmpty()) {
|
if (!treeItem.getChildren().isEmpty()) {
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package at.vvo.omds.client.gui.api.calc;
|
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.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.CalculateRequest;
|
||||||
import at.vvo.omds.types.omds3.r2025_05.on2antrag.common.CalculateResponse;
|
import at.vvo.omds.types.omds3.r2025_05.on2antrag.common.CalculateResponse;
|
||||||
import jakarta.xml.bind.JAXBElement;
|
import jakarta.xml.bind.JAXBElement;
|
||||||
@@ -21,7 +24,7 @@ public class CalculateRequestAuskunftService {
|
|||||||
this.soapConnector = soapConnector;
|
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>";
|
String token = "<KEY>";
|
||||||
JAXBElement<CalculateRequest> r = BuildCalculateRequestAuskunft.buildRequestFromTreeView(treeView, vtBeg);
|
JAXBElement<CalculateRequest> r = BuildCalculateRequestAuskunft.buildRequestFromTreeView(treeView, vtBeg);
|
||||||
@@ -35,4 +38,18 @@ public class CalculateRequestAuskunftService {
|
|||||||
|
|
||||||
return response;
|
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:annox="urn:jaxb.jvnet.org:annox"
|
||||||
xmlns:inheritance="urn:jaxb.jvnet.org:plugin:inheritance"
|
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"
|
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"
|
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
|
||||||
version="3.0">
|
version="3.0">
|
||||||
|
jaxb:extensionBindingPrefixes="xjc annox"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -606,7 +606,7 @@
|
|||||||
<!-- </jaxb:bindings>-->
|
<!-- </jaxb:bindings>-->
|
||||||
|
|
||||||
<!-- Antrag Rechtsschutz Namespace urn:at.vvo.omds.types.omds3.v1-4-0.on2antrag.rs -->
|
<!-- 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:bindings schemaLocation="omds3_ON2_Antrag_Rechtsschutz.xsd" node="/xs:schema" >
|
||||||
<jaxb:schemaBindings>
|
<jaxb:schemaBindings>
|
||||||
<jaxb:package name="at.vvo.omds.types.omds3.r2025_05.on2antrag.rs"/>
|
<jaxb:package name="at.vvo.omds.types.omds3.r2025_05.on2antrag.rs"/>
|
||||||
@@ -652,7 +652,7 @@
|
|||||||
</annox:annotate>
|
</annox:annotate>
|
||||||
</bindings>
|
</bindings>
|
||||||
</jaxb:bindings>
|
</jaxb:bindings>
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- Antrag Sach-Privat Namespace urn:at.vvo.omds.types.omds3.v1-4-0.on2antrag.sachprivat -->
|
<!-- 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" >
|
<jaxb:bindings schemaLocation="omds3_ON2_Antrag_SachPrivat.xsd" node="/xs:schema" >
|
||||||
|
|||||||
@@ -1721,12 +1721,14 @@
|
|||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="Baustein" type="Produktbaustein_Type" minOccurs="0" maxOccurs="unbounded"/>
|
<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="Aktion" type="Aktion_Type" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<xsd:element name="VersicherteObjekte" type="VersichertesInteresse_Type" maxOccurs="unbounded"/>
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="MinVorkommen" type="xsd:int" />
|
<xsd:attribute name="MinVorkommen" type="xsd:int" />
|
||||||
<xsd:attribute name="MaxVorkommen" 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="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="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="Typ" type="xsd:string" />
|
||||||
|
<xsd:attribute name="RisikoobjektErforderlich" type="xsd:boolean" default="false"/>
|
||||||
</xsd:extension>
|
</xsd:extension>
|
||||||
</xsd:complexContent>
|
</xsd:complexContent>
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
@@ -3254,7 +3256,7 @@
|
|||||||
<xsd:documentation>Basisklasse für alle Fahrzeuge in der Kfz-Versicherung</xsd:documentation>
|
<xsd:documentation>Basisklasse für alle Fahrzeuge in der Kfz-Versicherung</xsd:documentation>
|
||||||
</xsd:annotation>
|
</xsd:annotation>
|
||||||
<xsd:complexContent>
|
<xsd:complexContent>
|
||||||
<xsd:extension base="VersichertesInteresse_Type">
|
<xsd:extension base="VersichertesInteresseMitAttributMetadaten_Type">
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="Zulassungsdaten" type="Zulassungsdaten_Type" minOccurs="0">
|
<xsd:element name="Zulassungsdaten" type="Zulassungsdaten_Type" minOccurs="0">
|
||||||
<xsd:annotation>
|
<xsd:annotation>
|
||||||
@@ -5062,6 +5064,7 @@
|
|||||||
<xsd:attribute name="minOccurrences" type="xsd:int" use="required"/>
|
<xsd:attribute name="minOccurrences" type="xsd:int" use="required"/>
|
||||||
<xsd:attribute name="maxOccurrences" type="xsd:int" />
|
<xsd:attribute name="maxOccurrences" type="xsd:int" />
|
||||||
<xsd:attribute name="type" type="xsd:string" use="required" />
|
<xsd:attribute name="type" type="xsd:string" use="required" />
|
||||||
|
<xsd:attribute name="risikoobjekt_type" type="xsd:string" use="required" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
<xsd:annotation><xsd:documentation>Es gibt zwei Implementierungen für a priori: Verkaufsprodukt und Unterbaustein</xsd:documentation></xsd:annotation>
|
<xsd:annotation><xsd:documentation>Es gibt zwei Implementierungen für a priori: Verkaufsprodukt und Unterbaustein</xsd:documentation></xsd:annotation>
|
||||||
<xsd:complexType name="APrioriUnterbaustein_Type">
|
<xsd:complexType name="APrioriUnterbaustein_Type">
|
||||||
|
|||||||
Reference in New Issue
Block a user