aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/fxml/RegistrationWindow.fxml76
-rw-r--r--src/main/resources/sql/H2RegistrationDAOTest_depopulate.sql5
-rw-r--r--src/main/resources/sql/H2RegistrationDAOTest_populate.sql10
-rw-r--r--src/main/resources/sql/database.sql17
4 files changed, 102 insertions, 6 deletions
diff --git a/src/main/resources/fxml/RegistrationWindow.fxml b/src/main/resources/fxml/RegistrationWindow.fxml
new file mode 100644
index 0000000..0394ca7
--- /dev/null
+++ b/src/main/resources/fxml/RegistrationWindow.fxml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.geometry.Insets?>
+<?import javafx.scene.control.Button?>
+<?import javafx.scene.control.ChoiceBox?>
+<?import javafx.scene.control.Label?>
+<?import javafx.scene.control.SplitPane?>
+<?import javafx.scene.control.TableColumn?>
+<?import javafx.scene.control.TableView?>
+<?import javafx.scene.control.TextField?>
+<?import javafx.scene.layout.AnchorPane?>
+<?import javafx.scene.layout.HBox?>
+<?import javafx.scene.layout.VBox?>
+
+<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="600.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.RegistrationWindowController">
+ <children>
+ <AnchorPane prefHeight="135.0" prefWidth="600.0">
+ <children>
+ <Label layoutX="14.0" layoutY="14.0" text="Neue Anmeldung" />
+ <Label layoutX="14.0" layoutY="44.0" text="von" />
+ <Label layoutX="133.0" layoutY="44.0" text="bis" />
+ <ChoiceBox fx:id="cbStart" layoutX="42.0" layoutY="40.0" prefWidth="80.0" />
+ <ChoiceBox fx:id="cbEnd" layoutX="159.0" layoutY="40.0" prefWidth="80.0" />
+ <Label layoutX="10.0" layoutY="82.0" text="Fahrzeug" />
+ <Label fx:id="lVehicles" layoutX="10.0" layoutY="108.0" text="Fahrzeugname" />
+ <Label layoutX="216.0" layoutY="82.0" text="Personen" />
+ <Label fx:id="lEmployees" layoutX="216.0" layoutY="108.0" text="Namen" />
+ </children>
+ </AnchorPane>
+ <SplitPane dividerPositions="0.35" prefWidth="200.0">
+ <items>
+ <VBox prefHeight="200.0" prefWidth="100.0">
+ <children>
+ <Label text="Fahrzeugsuche" />
+ <TextField fx:id="tfVehicleSearch" />
+ <TableView fx:id="tvVehicles" prefHeight="200.0" prefWidth="200.0">
+ <columns>
+ <TableColumn fx:id="tcVehicles" prefWidth="75.0" text="Fahrzeuge" />
+ </columns>
+ <columnResizePolicy>
+ <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
+ </columnResizePolicy>
+ </TableView>
+ </children>
+ </VBox>
+ <VBox prefHeight="200.0" prefWidth="100.0">
+ <children>
+ <Label text="Personensuche" />
+ <TextField fx:id="tfEmployeeSearch" />
+ <TableView fx:id="tvEmployees" prefHeight="200.0" prefWidth="200.0">
+ <columns>
+ <TableColumn fx:id="tcEmployees" prefWidth="75.0" text="Personen" />
+ </columns>
+ <columnResizePolicy>
+ <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
+ </columnResizePolicy>
+ </TableView>
+ </children>
+ </VBox>
+ </items>
+ </SplitPane>
+ <HBox alignment="CENTER" prefWidth="200.0">
+ <children>
+ <Button mnemonicParsing="false" onAction="#cancel" text="Abbrechen">
+ <HBox.margin>
+ <Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
+ </HBox.margin>
+ </Button>
+ <Button mnemonicParsing="false" onAction="#create" text="Erstellen">
+ <HBox.margin>
+ <Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
+ </HBox.margin>
+ </Button>
+ </children></HBox>
+ </children>
+</VBox>
diff --git a/src/main/resources/sql/H2RegistrationDAOTest_depopulate.sql b/src/main/resources/sql/H2RegistrationDAOTest_depopulate.sql
new file mode 100644
index 0000000..f43b641
--- /dev/null
+++ b/src/main/resources/sql/H2RegistrationDAOTest_depopulate.sql
@@ -0,0 +1,5 @@
+DELETE FROM Registration;
+DELETE FROM Vehicle;
+DELETE FROM VehicleVersion;
+DELETE FROM Employee;
+DELETE FROM EmployeeVersion; \ No newline at end of file
diff --git a/src/main/resources/sql/H2RegistrationDAOTest_populate.sql b/src/main/resources/sql/H2RegistrationDAOTest_populate.sql
new file mode 100644
index 0000000..b81eb78
--- /dev/null
+++ b/src/main/resources/sql/H2RegistrationDAOTest_populate.sql
@@ -0,0 +1,10 @@
+INSERT INTO EmployeeVersion (id, name, birthday, educationLevel, isDriver, isPilot) VALUES (1, 'John Doe', '2000-01-01', 'RS', TRUE, TRUE);
+INSERT INTO EmployeeVersion (id, name, birthday, educationLevel, isDriver, isPilot) VALUES (2, 'Nick "Kage" Verily', '1990-01-01', 'NKV', TRUE, FALSE);
+INSERT INTO EmployeeVersion (id, name, birthday, educationLevel, isDriver, isPilot) VALUES (3, 'Nicht Arzt', '1980-01-01', 'NA', FALSE, FALSE);
+INSERT INTO Employee (id, version) VALUES (1, 1);
+INSERT INTO Employee (id, version) VALUES (2, 2);
+INSERT INTO Employee (id, version) VALUES (3, 3);
+INSERT INTO VehicleVersion (id, name, hasNef, constructionType, type) VALUES (1, 'RTW-1', TRUE, 'Hochdach', 'RTW');
+INSERT INTO VehicleVersion (id, name, hasNef, constructionType, type) VALUES (2, 'NEF-1', FALSE, 'Normal', 'NEF');
+INSERT INTO Vehicle (id, version, status) VALUES (1, 1, 'abgemeldet');
+INSERT INTO Vehicle (id, version, status) VALUES (2, 2, 'abgemeldet'); \ No newline at end of file
diff --git a/src/main/resources/sql/database.sql b/src/main/resources/sql/database.sql
index bb23c91..e775550 100644
--- a/src/main/resources/sql/database.sql
+++ b/src/main/resources/sql/database.sql
@@ -1,26 +1,30 @@
CREATE TABLE IF NOT EXISTS VehicleVersion (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
- constructionType ENUM('Normal', 'Hochdach', 'Mittelhochdach') NOT NULL,
- type ENUM('BKTW', 'KTW-B', 'KTW', 'RTW', 'NEF', 'NAH') NOT NULL,
+ constructionType VARCHAR NOT NULL,
+ type VARCHAR NOT NULL,
hasNef BOOLEAN NOT NULL,
+ CHECK constructionType IN ('Normal', 'Hochdach', 'Mittelhochdach'),
+ CHECK type IN ('BKTW', 'KTW-B', 'KTW', 'RTW', 'NEF', 'NAH')
);
CREATE TABLE IF NOT EXISTS Vehicle (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
version BIGINT NOT NULL,
- status ENUM('abgemeldet', 'frei_wache', 'zum_berufungsort', 'am_berufungsort', 'zum_zielort',
- 'am_zielort', 'frei_funk', 'deleted') NOT NULL,
+ status VARCHAR NOT NULL,
FOREIGN KEY (version) REFERENCES VehicleVersion(id),
+ CHECK status IN ('abgemeldet', 'frei_wache', 'zum_berufungsort', 'am_berufungsort', 'zum_zielort',
+ 'am_zielort', 'frei_funk', 'deleted')
);
CREATE TABLE IF NOT EXISTS EmployeeVersion (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
birthday DATE NOT NULL,
- educationLevel ENUM('RS', 'NFS', 'NKV', 'NKA', 'NKI', 'NA') NOT NULL,
+ educationLevel VARCHAR NOT NULL,
isDriver BOOLEAN NOT NULL,
isPilot BOOLEAN NOT NULL,
+ CHECK educationLevel IN ('RS', 'NFS', 'NKV', 'NKA', 'NKI', 'NA')
);
CREATE TABLE IF NOT EXISTS Employee (
@@ -43,10 +47,11 @@ CREATE TABLE IF NOT EXISTS Registration (
CREATE TABLE IF NOT EXISTS Operation (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
opCode VARCHAR(20) NOT NULL,
- severity ENUM('A', 'B', 'C', 'D', 'E', 'O') NOT NULL,
+ severity VARCHAR NOT NULL,
created TIMESTAMP NOT NULL,
destination VARCHAR(100) NOT NULL,
additionalInfo VARCHAR(100),
+ CHECK severity IN ('A', 'B', 'C', 'D', 'E', 'O')
);
CREATE TABLE IF NOT EXISTS VehicleOperation (