Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
2360566063 | |||
0c8ccce950 |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.idea/
|
||||||
|
out/
|
@ -1,5 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module type="JAVA_MODULE" version="4">
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="Spring" name="Spring">
|
||||||
|
<configuration>
|
||||||
|
<fileset id="fileset" name="ConfigHelper" removed="false">
|
||||||
|
<file>file://$MODULE_DIR$/src/tourplaner/business/ConfigHelper.java</file>
|
||||||
|
</fileset>
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
<exclude-output />
|
<exclude-output />
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
@ -8,10 +17,9 @@
|
|||||||
<orderEntry type="jdk" jdkName="11" jdkType="JavaSDK" />
|
<orderEntry type="jdk" jdkName="11" jdkType="JavaSDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" name="lib" level="project" />
|
<orderEntry type="library" name="lib" level="project" />
|
||||||
<orderEntry type="library" name="log4j:log4j:1.2.17" level="project" />
|
|
||||||
<orderEntry type="library" name="junit:junit:4.13.2" level="project" />
|
<orderEntry type="library" name="junit:junit:4.13.2" level="project" />
|
||||||
<orderEntry type="library" name="org.cfg4j:cfg4j-core:4.4.1" level="project" />
|
<orderEntry type="library" name="org.slf4j:slf4j-log4j12:1.7.12" level="project" />
|
||||||
<orderEntry type="library" name="org.cfg4j:cfg4j:3.3.2" level="project" />
|
<orderEntry type="library" name="org.ini4j:ini4j:0.5.4" level="project" />
|
||||||
<orderEntry type="library" name="org.springframework:spring-beans:4.0.0.RELEASE" level="project" />
|
<orderEntry type="library" name="org.postgresql:postgresql:42.2.19" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
9
conf.ini
Normal file
9
conf.ini
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[start]
|
||||||
|
message = Tour Planer App gestartet
|
||||||
|
|
||||||
|
[db]
|
||||||
|
dbname = tourplaner
|
||||||
|
url = 192.168.1.116
|
||||||
|
port = 5432
|
||||||
|
user = user
|
||||||
|
pw = user
|
41
log/log4j/log.out
Normal file
41
log/log4j/log.out
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
Tour planer Startet!
|
||||||
|
Tour planer Startet!
|
||||||
|
App started
|
||||||
|
2021-02-26 15:59:44 INFO TourPlaner:15 - App started
|
||||||
|
2021-02-26 16:06:01 FATAL TourPlanerConfig:27 - C:\Users\georg\OneDrive\FH\Swe\Tourplaner\conf.ini (Das System kann die angegebene Datei nicht finden)
|
||||||
|
2021-02-26 16:08:31 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||||
|
2021-02-26 21:27:46 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||||
|
2021-02-26 21:27:46 ERROR PresenterMain:33 -
|
||||||
|
/C:/Users/georg/OneDrive/FH/Swe/Tourplaner/out/production/Tourplaner/tourplaner/ui/tourplaner.fxml:56
|
||||||
|
|
||||||
|
2021-02-26 21:27:46 INFO PostgresHelper:15 - User Table created
|
||||||
|
2021-02-26 21:27:46 ERROR ClassNotFoundException:33 - org.postgresql.Driver
|
||||||
|
2021-02-26 21:27:46 ERROR NullPointerException:33 -
|
||||||
|
2021-02-26 21:30:59 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||||
|
2021-02-26 21:30:59 ERROR PresenterMain:33 -
|
||||||
|
/C:/Users/georg/OneDrive/FH/Swe/Tourplaner/out/production/Tourplaner/tourplaner/ui/tourplaner.fxml:56
|
||||||
|
|
||||||
|
2021-02-26 21:30:59 INFO PostgresHelper:15 - User Table created
|
||||||
|
2021-02-26 21:31:01 ERROR PSQLException:33 - Connection to postgres.dergeorg.at:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||||
|
2021-02-26 21:31:01 ERROR NullPointerException:33 -
|
||||||
|
2021-02-26 21:32:19 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||||
|
2021-02-26 21:32:19 ERROR PresenterMain:33 -
|
||||||
|
/C:/Users/georg/OneDrive/FH/Swe/Tourplaner/out/production/Tourplaner/tourplaner/ui/tourplaner.fxml:56
|
||||||
|
|
||||||
|
2021-02-26 21:32:19 INFO PostgresHelper:15 - User Table created
|
||||||
|
2021-02-26 21:32:21 ERROR PSQLException:33 - Connection to postgres.dergeorg.at:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||||
|
2021-02-26 21:32:21 ERROR NullPointerException:33 -
|
||||||
|
2021-02-26 21:33:05 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||||
|
2021-02-26 21:33:05 ERROR PresenterMain:33 -
|
||||||
|
/C:/Users/georg/OneDrive/FH/Swe/Tourplaner/out/production/Tourplaner/tourplaner/ui/tourplaner.fxml:56
|
||||||
|
|
||||||
|
2021-02-26 21:33:05 INFO PostgresHelper:15 - User Table created
|
||||||
|
2021-02-26 21:33:07 ERROR PSQLException:33 - Connection to postgres.dergeorg.at:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||||
|
2021-02-26 21:33:07 ERROR NullPointerException:33 -
|
||||||
|
2021-02-26 21:35:08 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||||
|
2021-02-26 21:35:08 ERROR PresenterMain:33 -
|
||||||
|
/C:/Users/georg/OneDrive/FH/Swe/Tourplaner/out/production/Tourplaner/tourplaner/ui/tourplaner.fxml:56
|
||||||
|
|
||||||
|
2021-02-26 21:35:08 INFO PostgresHelper:15 - User Table created
|
||||||
|
2021-02-26 21:35:10 ERROR PSQLException:33 - Connection to postgres.dergeorg.at:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||||
|
2021-02-26 21:35:10 ERROR NullPointerException:33 -
|
16
out/production/Tourplaner/log4j.properties
Normal file
16
out/production/Tourplaner/log4j.properties
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Root logger option
|
||||||
|
log4j.rootLogger=DEBUG, stdout, file
|
||||||
|
|
||||||
|
# Redirect log messages to console
|
||||||
|
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||||
|
log4j.appender.stdout.Target=System.out
|
||||||
|
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||||
|
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
|
||||||
|
|
||||||
|
# Redirect log messages to a log file, support file rolling.
|
||||||
|
log4j.appender.file=org.apache.log4j.RollingFileAppender
|
||||||
|
log4j.appender.file.File=log/log4j/log.out
|
||||||
|
log4j.appender.file.MaxFileSize=5MB
|
||||||
|
log4j.appender.file.MaxBackupIndex=10
|
||||||
|
log4j.appender.file.layout=org.apache.log4j.PatternLayout
|
||||||
|
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,237 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Copyright (c) 2015, 2019, Gluon and/or its affiliates.
|
|
||||||
All rights reserved. Use is subject to license terms.
|
|
||||||
|
|
||||||
This file is available and licensed under the following license:
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions
|
|
||||||
are met:
|
|
||||||
|
|
||||||
- Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
- Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in
|
|
||||||
the documentation and/or other materials provided with the distribution.
|
|
||||||
- Neither the name of Oracle Corporation nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived
|
|
||||||
from this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<?import javafx.geometry.Insets?>
|
|
||||||
<?import javafx.scene.control.Button?>
|
|
||||||
<?import javafx.scene.control.Label?>
|
|
||||||
<?import javafx.scene.control.ListView?>
|
|
||||||
<?import javafx.scene.control.Menu?>
|
|
||||||
<?import javafx.scene.control.MenuBar?>
|
|
||||||
<?import javafx.scene.control.MenuItem?>
|
|
||||||
<?import javafx.scene.control.SeparatorMenuItem?>
|
|
||||||
<?import javafx.scene.control.SplitPane?>
|
|
||||||
<?import javafx.scene.control.Tab?>
|
|
||||||
<?import javafx.scene.control.TabPane?>
|
|
||||||
<?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?>
|
|
||||||
<?import javafx.scene.paint.Color?>
|
|
||||||
<?import javafx.scene.text.Font?>
|
|
||||||
|
|
||||||
<VBox prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/15.0.1" xmlns:fx="http://javafx.com/fxml/1">
|
|
||||||
<children>
|
|
||||||
<MenuBar VBox.vgrow="NEVER">
|
|
||||||
<menus>
|
|
||||||
<Menu mnemonicParsing="false" text="File">
|
|
||||||
<items>
|
|
||||||
<MenuItem mnemonicParsing="false" text="New" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Open…" />
|
|
||||||
<Menu mnemonicParsing="false" text="Open Recent" />
|
|
||||||
<SeparatorMenuItem mnemonicParsing="false" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Close" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Save" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Save As…" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Revert" />
|
|
||||||
<SeparatorMenuItem mnemonicParsing="false" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Preferences…" />
|
|
||||||
<SeparatorMenuItem mnemonicParsing="false" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Quit" />
|
|
||||||
</items>
|
|
||||||
</Menu>
|
|
||||||
<Menu mnemonicParsing="false" text="Edit">
|
|
||||||
<items>
|
|
||||||
<MenuItem mnemonicParsing="false" text="Undo" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Redo" />
|
|
||||||
<SeparatorMenuItem mnemonicParsing="false" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Cut" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Copy" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Paste" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Delete" />
|
|
||||||
<SeparatorMenuItem mnemonicParsing="false" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Select All" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Unselect All" />
|
|
||||||
</items>
|
|
||||||
</Menu>
|
|
||||||
<Menu mnemonicParsing="false" text="Options">
|
|
||||||
<items>
|
|
||||||
<MenuItem mnemonicParsing="false" text="Undo" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Redo" />
|
|
||||||
<SeparatorMenuItem mnemonicParsing="false" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Cut" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Copy" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Paste" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Delete" />
|
|
||||||
<SeparatorMenuItem mnemonicParsing="false" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Select All" />
|
|
||||||
<MenuItem mnemonicParsing="false" text="Unselect All" />
|
|
||||||
</items>
|
|
||||||
</Menu>
|
|
||||||
<Menu mnemonicParsing="false" text="Help">
|
|
||||||
<items>
|
|
||||||
<MenuItem mnemonicParsing="false" text="About MyHelloApp" />
|
|
||||||
</items>
|
|
||||||
</Menu>
|
|
||||||
</menus>
|
|
||||||
</MenuBar>
|
|
||||||
<HBox id="HBox" alignment="CENTER_LEFT" layoutX="10.0" layoutY="588.0" spacing="5.0">
|
|
||||||
<children>
|
|
||||||
<AnchorPane prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="ALWAYS">
|
|
||||||
<children>
|
|
||||||
<Button layoutX="58.0" mnemonicParsing="false" text="+" />
|
|
||||||
<Label layoutX="14.0" layoutY="4.0" text="Tours" />
|
|
||||||
<Button layoutX="89.0" mnemonicParsing="false" text="-" />
|
|
||||||
</children></AnchorPane>
|
|
||||||
<TextField text="Suche...." />
|
|
||||||
<Button mnemonicParsing="false" text="Suchen" />
|
|
||||||
</children>
|
|
||||||
<padding>
|
|
||||||
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
|
|
||||||
</padding>
|
|
||||||
</HBox>
|
|
||||||
<SplitPane dividerPositions="0.21492204899777284" focusTraversable="true" prefHeight="522.0" prefWidth="900.0" VBox.vgrow="ALWAYS">
|
|
||||||
<items>
|
|
||||||
<AnchorPane prefHeight="520.0" prefWidth="239.0">
|
|
||||||
<children>
|
|
||||||
<ListView layoutX="-1.0" prefHeight="520.0" prefWidth="190.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
|
||||||
<padding>
|
|
||||||
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
|
|
||||||
</padding>
|
|
||||||
</ListView>
|
|
||||||
</children>
|
|
||||||
</AnchorPane>
|
|
||||||
<SplitPane dividerPositions="0.5" orientation="VERTICAL" prefHeight="496.0" prefWidth="620.0">
|
|
||||||
<items>
|
|
||||||
<VBox prefHeight="200.0" prefWidth="100.0">
|
|
||||||
<children>
|
|
||||||
<AnchorPane prefHeight="51.0" prefWidth="676.0">
|
|
||||||
<children>
|
|
||||||
<HBox id="HBox" alignment="CENTER_LEFT" prefHeight="7.0" prefWidth="44.0" spacing="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
|
||||||
<children>
|
|
||||||
<Label text="Title:">
|
|
||||||
<HBox.margin>
|
|
||||||
<Insets left="10.0" />
|
|
||||||
</HBox.margin>
|
|
||||||
</Label>
|
|
||||||
<TextField />
|
|
||||||
</children>
|
|
||||||
</HBox>
|
|
||||||
</children>
|
|
||||||
</AnchorPane>
|
|
||||||
<AnchorPane prefHeight="200.0" prefWidth="200.0">
|
|
||||||
<children>
|
|
||||||
<TabPane layoutX="1.0" layoutY="69.0" prefHeight="225.0" prefWidth="702.0" tabClosingPolicy="UNAVAILABLE" AnchorPane.bottomAnchor="-67.0" AnchorPane.leftAnchor="1.0" AnchorPane.rightAnchor="1.0" AnchorPane.topAnchor="0.0">
|
|
||||||
<tabs>
|
|
||||||
<Tab text="Route" />
|
|
||||||
<Tab text="Description">
|
|
||||||
<content>
|
|
||||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
|
|
||||||
</content>
|
|
||||||
</Tab>
|
|
||||||
</tabs>
|
|
||||||
</TabPane>
|
|
||||||
</children>
|
|
||||||
</AnchorPane>
|
|
||||||
</children>
|
|
||||||
</VBox>
|
|
||||||
<AnchorPane prefHeight="200.0" prefWidth="200.0">
|
|
||||||
<children>
|
|
||||||
<VBox prefHeight="200.0" prefWidth="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
|
||||||
<children>
|
|
||||||
<AnchorPane prefHeight="51.0" prefWidth="676.0">
|
|
||||||
<children>
|
|
||||||
<HBox id="HBox" alignment="CENTER_LEFT" prefHeight="38.0" prefWidth="702.0" spacing="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
|
||||||
<children>
|
|
||||||
<Label text="Logs:">
|
|
||||||
<HBox.margin>
|
|
||||||
<Insets left="10.0" />
|
|
||||||
</HBox.margin>
|
|
||||||
</Label>
|
|
||||||
<Button mnemonicParsing="false" text="+" textAlignment="CENTER">
|
|
||||||
<HBox.margin>
|
|
||||||
<Insets />
|
|
||||||
</HBox.margin>
|
|
||||||
</Button>
|
|
||||||
<Button mnemonicParsing="false" prefWidth="21.0" text="-" textAlignment="CENTER">
|
|
||||||
<HBox.margin>
|
|
||||||
<Insets right="10.0" />
|
|
||||||
</HBox.margin>
|
|
||||||
</Button>
|
|
||||||
</children>
|
|
||||||
<padding>
|
|
||||||
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
|
|
||||||
</padding>
|
|
||||||
</HBox>
|
|
||||||
</children>
|
|
||||||
</AnchorPane>
|
|
||||||
<AnchorPane prefHeight="200.0" prefWidth="200.0">
|
|
||||||
<children>
|
|
||||||
<TableView prefHeight="209.0" prefWidth="702.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
|
||||||
<columns>
|
|
||||||
<TableColumn prefWidth="238.0" text="Date" />
|
|
||||||
<TableColumn prefWidth="223.0" text="Duration" />
|
|
||||||
<TableColumn prefWidth="240.0" text="Distance" />
|
|
||||||
</columns>
|
|
||||||
</TableView>
|
|
||||||
</children>
|
|
||||||
</AnchorPane>
|
|
||||||
</children>
|
|
||||||
</VBox>
|
|
||||||
</children>
|
|
||||||
</AnchorPane>
|
|
||||||
</items>
|
|
||||||
</SplitPane>
|
|
||||||
</items>
|
|
||||||
</SplitPane>
|
|
||||||
<HBox id="HBox" alignment="CENTER_LEFT" spacing="5.0" VBox.vgrow="NEVER">
|
|
||||||
<children>
|
|
||||||
<Label maxHeight="1.7976931348623157E308" maxWidth="-1.0" text="Left status" HBox.hgrow="ALWAYS">
|
|
||||||
<font>
|
|
||||||
<Font size="11.0" fx:id="x3" />
|
|
||||||
</font>
|
|
||||||
<textFill>
|
|
||||||
<Color red="0.625" green="0.625" blue="0.625" fx:id="x4" />
|
|
||||||
</textFill>
|
|
||||||
</Label>
|
|
||||||
<AnchorPane prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="ALWAYS" />
|
|
||||||
<Label font="$x3" maxWidth="-1.0" text="Right status" textFill="$x4" HBox.hgrow="NEVER" />
|
|
||||||
</children>
|
|
||||||
<padding>
|
|
||||||
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
|
|
||||||
</padding>
|
|
||||||
</HBox>
|
|
||||||
</children>
|
|
||||||
</VBox>
|
|
16
src/log4j.properties
Normal file
16
src/log4j.properties
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Root logger option
|
||||||
|
log4j.rootLogger=DEBUG, stdout, file
|
||||||
|
|
||||||
|
# Redirect log messages to console
|
||||||
|
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||||
|
log4j.appender.stdout.Target=System.out
|
||||||
|
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||||
|
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
|
||||||
|
|
||||||
|
# Redirect log messages to a log file, support file rolling.
|
||||||
|
log4j.appender.file=org.apache.log4j.RollingFileAppender
|
||||||
|
log4j.appender.file.File=log/log4j/log.out
|
||||||
|
log4j.appender.file.MaxFileSize=5MB
|
||||||
|
log4j.appender.file.MaxBackupIndex=10
|
||||||
|
log4j.appender.file.layout=org.apache.log4j.PatternLayout
|
||||||
|
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
|
@ -1,22 +1,19 @@
|
|||||||
package tourplaner;
|
package tourplaner;
|
||||||
|
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
import javafx.fxml.FXMLLoader;
|
|
||||||
import javafx.scene.Parent;
|
|
||||||
import javafx.scene.Scene;
|
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import tourplaner.business.LogHelper;
|
|
||||||
import tourplaner.business.TourPlaner;
|
import tourplaner.business.TourPlaner;
|
||||||
|
|
||||||
public class Main extends Application {
|
public class Main extends Application {
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
launch(args);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage primaryStage) throws Exception{
|
public void start(Stage primaryStage) throws Exception{
|
||||||
TourPlaner tourplaner = new TourPlaner(primaryStage);
|
TourPlaner tourplaner = new TourPlaner(primaryStage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
launch(args);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,95 @@
|
|||||||
package tourplaner.business;
|
package tourplaner.business;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.ini4j.Wini;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dient dem ein und auslesen von .ini Dateien
|
||||||
|
*/
|
||||||
public class ConfigHelper {
|
public class ConfigHelper {
|
||||||
@Value("${configFilesPath:./config}")
|
|
||||||
private String filesPath; // Run with -DconfigFilesPath=<configFilesPath> parameter to override
|
public static String standartConfig = "conf.ini"; // Config.ini befindet sich im Root Verzeichnis
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Liest einen Int aus der Config aus
|
||||||
|
* @param filename Speicherort
|
||||||
|
* @param sectionName Sections Name
|
||||||
|
* @param optionName Options Name
|
||||||
|
* @return Den angeforderten String
|
||||||
|
*/
|
||||||
|
public static int getIniInt(String filename, String sectionName, String optionName){
|
||||||
|
Wini ini = null;
|
||||||
|
try {
|
||||||
|
ini = new Wini(new File(filename));
|
||||||
|
} catch (IOException e) {
|
||||||
|
LogHelper.error(e.getMessage(), e.getClass().getName());
|
||||||
|
}
|
||||||
|
assert ini != null;
|
||||||
|
return ini.get(sectionName, optionName, int.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Liest einen String aus der Config aus
|
||||||
|
* @param filename Speicherort
|
||||||
|
* @param sectionName Sections Name
|
||||||
|
* @param optionName Options Name
|
||||||
|
* @return Den angeforderten String
|
||||||
|
*/
|
||||||
|
public static String getIniString(String filename, String sectionName, String optionName){
|
||||||
|
Wini ini = null;
|
||||||
|
try {
|
||||||
|
ini = new Wini(new File(filename));
|
||||||
|
} catch (IOException e) {
|
||||||
|
LogHelper.error(e.getMessage(), e.getClass().getName());
|
||||||
|
}
|
||||||
|
assert ini != null;
|
||||||
|
return ini.get(sectionName, optionName, String.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setzt ein String in der Config
|
||||||
|
* @param filename Speicherort
|
||||||
|
* @param sectionName Sections Name
|
||||||
|
* @param optionName Options Name
|
||||||
|
* @param value Wert der eingetragen werden soll
|
||||||
|
*/
|
||||||
|
public static void setIniString(String filename, String sectionName, String optionName, String value) {
|
||||||
|
Wini ini = null;
|
||||||
|
try {
|
||||||
|
ini = new Wini(new File(filename));
|
||||||
|
ini.put(sectionName, optionName, value);
|
||||||
|
ini.store();
|
||||||
|
} catch (IOException e) {
|
||||||
|
LogHelper.error(e.getMessage(), e.getClass().getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setzt ein int in der Config
|
||||||
|
* @param filename Speicherort
|
||||||
|
* @param sectionName Sections Name
|
||||||
|
* @param optionName Options Name
|
||||||
|
* @param value Wert der eingetragen werden soll
|
||||||
|
*/
|
||||||
|
public static void setIniInt(String filename, String sectionName, String optionName, int value){
|
||||||
|
Wini ini = null;
|
||||||
|
try {
|
||||||
|
ini = new Wini(new File(filename));
|
||||||
|
ini.put(sectionName, optionName, value);
|
||||||
|
ini.store();
|
||||||
|
} catch (IOException e) {
|
||||||
|
LogHelper.error(e.getMessage(), e.getClass().getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gibt den namen des standard Config file zurück
|
||||||
|
* @return Name des standard config files
|
||||||
|
*/
|
||||||
|
public static String getStandartConfig() {
|
||||||
|
return standartConfig;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,31 +1,54 @@
|
|||||||
package tourplaner.business;
|
package tourplaner.business;
|
||||||
import org.apache.log4j.*;
|
import org.apache.log4j.*;
|
||||||
import org.apache.log4j.xml.DOMConfigurator;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hilft beim Logging mit log4j
|
* Hilft beim Logging mit log4j
|
||||||
*/
|
*/
|
||||||
public class LogHelper{
|
public class LogHelper{
|
||||||
private static Logger logger = Logger.getRootLogger();
|
/**
|
||||||
|
* Log info in file und Console
|
||||||
|
* @param msg Nachricht in dem Log
|
||||||
|
* @param name Name des Log Eintrags
|
||||||
|
*/
|
||||||
|
public static void info(String msg, String name){
|
||||||
|
getLog(name).info(msg);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holt den passenden logger für die Anwendung
|
* Log info in file und Console
|
||||||
* @return Der Aktuelle passende Logger, null bei error
|
* @param msg Nachricht in dem Log
|
||||||
|
* @param name Name des Log Eintrags
|
||||||
*/
|
*/
|
||||||
public static Logger getLogger() {
|
public static void warn(String msg, String name){
|
||||||
try {
|
getLog(name).warn(msg);
|
||||||
SimpleLayout layout = new SimpleLayout();
|
|
||||||
ConsoleAppender consoleAppender = new ConsoleAppender(layout);
|
|
||||||
logger.addAppender(consoleAppender);
|
|
||||||
FileAppender fileAppender = new FileAppender(layout, "../../../logs/tourplaner.log", true);
|
|
||||||
logger.addAppender(fileAppender);
|
|
||||||
// ALL | DEBUG | INFO | WARN | ERROR | FATAL | OFF:
|
|
||||||
logger.setLevel(Level.DEBUG);
|
|
||||||
return logger;
|
|
||||||
} catch (Exception ex) {
|
|
||||||
System.err.println(ex.getMessage());
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Log info in file und Console
|
||||||
|
* @param msg Nachricht in dem Log
|
||||||
|
* @param name Name des Log Eintrags
|
||||||
|
*/
|
||||||
|
public static void error(String msg, String name){
|
||||||
|
getLog(name).error(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Log info in file und Console
|
||||||
|
* @param msg Nachricht in dem Log
|
||||||
|
* @param name Name des Log Eintrags
|
||||||
|
*/
|
||||||
|
public static void fatal(String msg, String name){
|
||||||
|
getLog(name).fatal(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instanziert den Logger
|
||||||
|
* @param name Name des Loggers
|
||||||
|
* @return Den Logger
|
||||||
|
*/
|
||||||
|
private static Logger getLog(String name){
|
||||||
|
return Logger.getLogger(name); // Instanziert den Logger
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
60
src/tourplaner/business/PostgresHelper.java
Normal file
60
src/tourplaner/business/PostgresHelper.java
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
package tourplaner.business;
|
||||||
|
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.DriverManager;
|
||||||
|
import java.sql.Statement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hilfsfunktionen für die verwendung der Postgres DB
|
||||||
|
*/
|
||||||
|
public class PostgresHelper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verbindet mit der Datenbank
|
||||||
|
* @return Das Connection Objekt
|
||||||
|
*/
|
||||||
|
public static Connection con() {
|
||||||
|
Connection c = null;
|
||||||
|
try {
|
||||||
|
Class.forName("org.postgresql.Driver");
|
||||||
|
c = DriverManager
|
||||||
|
.getConnection("jdbc:postgresql://" + ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "url") + ":" + ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "port") + "/" + ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "dbname"),
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "user"), ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "db", "pw"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
LogHelper.error(e.getMessage(), e.getClass().getName());
|
||||||
|
}
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Führt ein Sql statement ohne rückgabe aus, mit message nachricht
|
||||||
|
* @param sql Sql command
|
||||||
|
* @param message Mesasage die vor dem Durchführen angezeigt wird
|
||||||
|
* @return True bei erfolg, sonst false
|
||||||
|
*/
|
||||||
|
public static boolean executeUpdateMessage(String sql, String message){
|
||||||
|
LogHelper.info(message, "PostgresHelper");
|
||||||
|
return executeUpdate(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Führt ein Sql statement ohne rückgabe aus
|
||||||
|
* @param sql Sql command
|
||||||
|
* @return True bei erfolg, sonst false
|
||||||
|
*/
|
||||||
|
public static boolean executeUpdate(String sql){
|
||||||
|
Connection c = con();
|
||||||
|
Statement stmt;
|
||||||
|
try {
|
||||||
|
stmt = c.createStatement();
|
||||||
|
stmt.executeUpdate(sql);
|
||||||
|
stmt.close();
|
||||||
|
c.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
LogHelper.error(e.getMessage(), e.getClass().getName());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,7 @@ package tourplaner.business;
|
|||||||
|
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
import tourplaner.data.DbConnect;
|
||||||
import tourplaner.ui.PresenterMain;
|
import tourplaner.ui.PresenterMain;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -17,8 +18,10 @@ public class TourPlaner{
|
|||||||
* @param primaryStage Stage für den Presenter
|
* @param primaryStage Stage für den Presenter
|
||||||
*/
|
*/
|
||||||
public TourPlaner(Stage primaryStage){
|
public TourPlaner(Stage primaryStage){
|
||||||
logger = LogHelper.getLogger(); // Initialiesiert das Logging
|
String startText = ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "message");
|
||||||
logger.info("Tour planer Startet!");
|
LogHelper.info(startText, "TourPlaner");
|
||||||
PresenterMain presenterMain = new PresenterMain(primaryStage, logger); // Start Presenter/GUI
|
PresenterMain presenterMain = new PresenterMain(primaryStage); // Start Presenter/GUI
|
||||||
|
new DbConnect().init();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,37 @@
|
|||||||
package tourplaner.data;
|
package tourplaner.data;
|
||||||
|
|
||||||
|
import tourplaner.business.PostgresHelper;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.Statement;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verwaltet die Datenbankverbindung zu dem Postgres Server
|
* Verwaltet die Datenbankverbindung zu dem Postgres Server
|
||||||
*/
|
*/
|
||||||
public class DbConnect {
|
public class DbConnect {
|
||||||
|
private Connection c;
|
||||||
|
private Statement stmt;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Erstellt alle Beispieldaten und simuliert somit den
|
||||||
|
* Verbindungsaufbau zu einer DB
|
||||||
|
*/
|
||||||
|
public DbConnect() {
|
||||||
|
this.c = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Erstellt alle Tabellen die für den Betrieb der Software bennötigt werden
|
||||||
|
* @return True bei erfolg, sonst error
|
||||||
|
*/
|
||||||
|
public boolean init() {
|
||||||
|
// TODO: 26.02.2021 Alle sql im init sind noch falsch
|
||||||
|
ArrayList<Boolean> errors = new ArrayList<>();
|
||||||
|
errors.add(PostgresHelper.executeUpdateMessage("CREATE TABLE IF NOT EXISTS USERS (username TEXT PRIMARY KEY NOT NULL, nachname TEXT NOT NULL, email TEXT NOT NULL, password TEXT NOT NULL, bio TEXT, image TEXT, coins integer default 20 not null)", "User Table created"));
|
||||||
|
return !errors.contains(false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import javafx.scene.Parent;
|
|||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
import tourplaner.business.LogHelper;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@ -16,17 +17,18 @@ public class PresenterMain {
|
|||||||
/**
|
/**
|
||||||
* Startet die Gui
|
* Startet die Gui
|
||||||
* @param primaryStage Stage der GUI
|
* @param primaryStage Stage der GUI
|
||||||
* @param logger Aktueller Logger
|
*
|
||||||
*/
|
*/
|
||||||
public PresenterMain(Stage primaryStage, Logger logger){
|
public PresenterMain(Stage primaryStage){
|
||||||
Parent root = null;
|
Parent root = null;
|
||||||
try {
|
try {
|
||||||
root = FXMLLoader.load(getClass().getResource("../ui/tourplaner.fxml"));
|
root = FXMLLoader.load(getClass().getResource("tourplaner.fxml"));
|
||||||
primaryStage.setTitle("DerGeorg Touren Planer");
|
primaryStage.setTitle("DerGeorg Touren Planer");
|
||||||
primaryStage.setScene(new Scene(root, 600, 600));
|
primaryStage.setScene(new Scene(root, 600, 600));
|
||||||
primaryStage.show();
|
primaryStage.show();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.error(e.getMessage());
|
e.printStackTrace();
|
||||||
|
LogHelper.error(e.getMessage(), "PresenterMain");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
<?import javafx.scene.paint.Color?>
|
<?import javafx.scene.paint.Color?>
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
<VBox prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/15.0.1" xmlns:fx="http://javafx.com/fxml/1">
|
<VBox prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
<children>
|
<children>
|
||||||
<MenuBar VBox.vgrow="NEVER">
|
<MenuBar VBox.vgrow="NEVER">
|
||||||
<menus>
|
<menus>
|
||||||
|
Reference in New Issue
Block a user