Skip to content

Commit d76b877

Browse files
authored
Whole web application part of the project uploaded
1 parent 0810e2f commit d76b877

File tree

94 files changed

+35813
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+35813
-0
lines changed

DPFINAL_DB.mwb

15.3 KB
Binary file not shown.

DPFINAL_DB.sql

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
#ΔΗΜΙΟΥΡΓΙΑ ΒΑΣΗΣ ΔΕΔΟΜΕΝΩΝ DPFINAL_DB.
2+
DROP DATABASE IF EXISTS DPFINAL_DB;
3+
CREATE DATABASE DPFINAL_DB;
4+
USE DPFINAL_DB;
5+
6+
7+
#ΔΗΜΙΟΥΡΓΙΑ ΠΙΝΑΚΩΝ ΤΗΣ ΒΑΣΗΣ ΔΕΔΟΜΕΝΩΝ DPFINAL_DB.
8+
CREATE TABLE Admin (
9+
admin_id INT(1) NOT NULL,
10+
admin_username VARCHAR(30) NOT NULL,
11+
admin_password VARCHAR(50) NOT NULL,
12+
PRIMARY KEY (admin_id)
13+
);
14+
15+
CREATE TABLE Professors (
16+
professor_id INT AUTO_INCREMENT NOT NULL,
17+
professor_username VARCHAR(30) NOT NULL,
18+
professor_password VARCHAR(50) NOT NULL,
19+
professor_name VARCHAR(40),
20+
professor_surname VARCHAR(40),
21+
professor_grade VARCHAR(50),
22+
professor_valid TINYINT(1) NOT NULL DEFAULT 1,
23+
PRIMARY KEY (professor_id)
24+
);
25+
26+
CREATE TABLE Courses (
27+
course_id INT AUTO_INCREMENT NOT NULL,
28+
course_title_gr VARCHAR(60) NOT NULL,
29+
course_title_eng VARCHAR(60) NOT NULL,
30+
education_level TINYINT(1) NOT NULL,
31+
course_semester INT(1) NOT NULL,
32+
PRIMARY KEY (course_id)
33+
);
34+
35+
CREATE TABLE Professors_Courses (
36+
course_id INT NOT NULL,
37+
professor_id INT NOT NULL,
38+
FOREIGN KEY (course_id)
39+
REFERENCES Courses (course_id),
40+
FOREIGN KEY (professor_id)
41+
REFERENCES Professors (professor_id),
42+
PRIMARY KEY (course_id , professor_id)
43+
);
44+
45+
CREATE TABLE Learning_Objective_Categories (
46+
learning_objective_category_id INT(7) NOT NULL,
47+
learning_objective_category_title_gr VARCHAR(50) NOT NULL,
48+
learning_objective_category_title_eng VARCHAR(50) NOT NULL,
49+
PRIMARY KEY (learning_objective_category_id)
50+
);
51+
52+
CREATE TABLE Learning_Objectives (
53+
learning_objective_code VARCHAR(15) NOT NULL,
54+
learning_objective_title_gr VARCHAR(150) NOT NULL,
55+
learning_objective_title_eng VARCHAR(150) NOT NULL,
56+
learning_objective_category INT(7) NOT NULL,
57+
learning_objective_course INT(10) NOT NULL,
58+
FOREIGN KEY (learning_objective_category)
59+
REFERENCES Learning_Objective_Categories (learning_objective_category_id),
60+
FOREIGN KEY (learning_objective_course)
61+
REFERENCES Courses (course_id),
62+
PRIMARY KEY (learning_objective_code)
63+
);
64+
65+
CREATE TABLE Prerequisites_Courses (
66+
prerequisite_course_id INT(10) NOT NULL,
67+
course_id INT NOT NULL,
68+
FOREIGN KEY (prerequisite_course_id)
69+
REFERENCES Courses (course_id),
70+
FOREIGN KEY (course_id)
71+
REFERENCES Courses (course_id),
72+
PRIMARY KEY (prerequisite_course_id , course_id)
73+
);
74+
75+
CREATE TABLE Prerequisites_Learning_Objectives (
76+
prerequisite_learning_objective_code VARCHAR(15) NOT NULL,
77+
learning_objective_code VARCHAR(15) NOT NULL,
78+
FOREIGN KEY (prerequisite_learning_objective_code)
79+
REFERENCES Learning_Objectives (learning_objective_code),
80+
FOREIGN KEY (learning_objective_code)
81+
REFERENCES Learning_Objectives (learning_objective_code),
82+
PRIMARY KEY (prerequisite_learning_objective_code , learning_objective_code)
83+
);
84+
85+
CREATE TABLE Students (
86+
student_id INT AUTO_INCREMENT NOT NULL,
87+
student_username VARCHAR(30) NOT NULL,
88+
student_password VARCHAR(50) NOT NULL,
89+
student_name VARCHAR(40),
90+
student_surname VARCHAR(40),
91+
student_valid TINYINT(1) NOT NULL DEFAULT 0,
92+
PRIMARY KEY (student_id)
93+
);
94+
95+
CREATE TABLE Favorite_Courses (
96+
course_id INT NOT NULL,
97+
student_id INT NOT NULL,
98+
FOREIGN KEY (course_id)
99+
REFERENCES Courses (course_id),
100+
FOREIGN KEY (student_id)
101+
REFERENCES Students (student_id),
102+
PRIMARY KEY (course_id , student_id)
103+
);
104+
105+
CREATE TABLE Favorite_Learning_Objectives (
106+
learning_objective_code VARCHAR(15) NOT NULL,
107+
student_id INT NOT NULL,
108+
FOREIGN KEY (learning_objective_code)
109+
REFERENCES Learning_Objectives (learning_objective_code),
110+
FOREIGN KEY (student_id)
111+
REFERENCES Students (student_id),
112+
PRIMARY KEY (learning_objective_code , student_id)
113+
);
114+
115+
CREATE TABLE Login_Instances (
116+
id INT NOT NULL,
117+
user_type VARCHAR(20) NOT NULL,
118+
authentication_key VARCHAR(50) NOT NULL,
119+
expires DATETIME NOT NULL,
120+
PRIMARY KEY (id,user_type)
121+
);
122+
123+
CREATE TABLE Translation(
124+
translation_key VARCHAR(50) NOT NULL,
125+
translation_value TEXT NOT NULL,
126+
PRIMARY KEY (translation_key)
127+
);
128+
129+
#ΕΙΣΑΓΩΓΗ ΔΕΔΟΜΕΝΩΝ ΕΛΕΝΧΟΥ ΣΤΟΥΣ ΠΙΝΑΚΕΣ ΤΗΣ ΒΑΣΗΣ ΔΕΔΟΜΕΝΩΝ DPFINAL_DB.
130+
INSERT INTO Admin VALUES (0,"admin","$31$16$zknPRm-vDHHblTZc9M1qcP4EEMGWNtOO3oFYniJQA5w");
131+
INSERT INTO Students VALUES (1, "billy", "$31$16$BHi9OUU71_4WkqYYHDfjuIymGKON1jmh--KG57NJhPY", "Βασίλειος", "Γιογουρτσόγλου",0);
132+
133+
LOAD DATA LOCAL INFILE 'C:/csv_files/Professors.csv'
134+
INTO TABLE Professors
135+
FIELDS TERMINATED BY ','
136+
OPTIONALLY ENCLOSED BY '"'
137+
LINES TERMINATED BY '\n'
138+
(professor_username, professor_password,professor_name,professor_surname,professor_grade,professor_valid);
139+
140+
LOAD DATA LOCAL INFILE 'C:/csv_files/Courses.csv'
141+
INTO TABLE Courses
142+
FIELDS TERMINATED BY ','
143+
OPTIONALLY ENCLOSED BY '"'
144+
LINES TERMINATED BY '\n'
145+
(course_title_gr, course_title_eng, education_level,course_semester);
146+
147+
LOAD DATA LOCAL INFILE 'C:/csv_files/Professors_Courses.csv'
148+
INTO TABLE Professors_Courses
149+
FIELDS TERMINATED BY ','
150+
OPTIONALLY ENCLOSED BY '"'
151+
LINES TERMINATED BY '\n'
152+
(course_id, professor_id);
153+
154+
LOAD DATA LOCAL INFILE 'C:/csv_files/Prerequisites_Courses.csv'
155+
INTO TABLE Prerequisites_Courses
156+
FIELDS TERMINATED BY ','
157+
OPTIONALLY ENCLOSED BY '"'
158+
LINES TERMINATED BY '\n'
159+
(prerequisite_course_id, course_id);
160+
161+
LOAD DATA LOCAL INFILE 'C:/csv_files/Learning_Objective_Categories.csv'
162+
INTO TABLE Learning_Objective_Categories
163+
FIELDS TERMINATED BY ','
164+
OPTIONALLY ENCLOSED BY '"'
165+
LINES TERMINATED BY '\n'
166+
(learning_objective_category_id, learning_objective_category_title_gr, learning_objective_category_title_eng);
167+
168+
LOAD DATA LOCAL INFILE 'C:/csv_files/Learning_Objectives.csv'
169+
INTO TABLE Learning_Objectives
170+
FIELDS TERMINATED BY ','
171+
OPTIONALLY ENCLOSED BY '"'
172+
LINES TERMINATED BY '\n'
173+
(learning_objective_code, learning_objective_title_gr, learning_objective_title_eng, learning_objective_category, learning_objective_course);
174+
175+
LOAD DATA LOCAL INFILE 'C:/csv_files/Prerequisites_Learning_Objectives.csv'
176+
INTO TABLE Prerequisites_Learning_Objectives
177+
FIELDS TERMINATED BY ','
178+
OPTIONALLY ENCLOSED BY '"'
179+
LINES TERMINATED BY '\n'
180+
(prerequisite_learning_objective_code, learning_objective_code);
181+
182+
LOAD DATA LOCAL INFILE 'C:/csv_files/Translation.csv'
183+
INTO TABLE Translation
184+
FIELDS TERMINATED BY '|'
185+
OPTIONALLY ENCLOSED BY '"'
186+
LINES TERMINATED BY '\n'
187+
(translation_key, translation_value);

FinalDPWebApp/build.xml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- You may freely edit this file. See commented blocks below for -->
3+
<!-- some examples of how to customize the build. -->
4+
<!-- (If you delete it and reopen the project it will be recreated.) -->
5+
<!-- By default, only the Clean and Build commands use this build script. -->
6+
<!-- Commands such as Run, Debug, and Test only use this build script if -->
7+
<!-- the Compile on Save feature is turned off for the project. -->
8+
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
9+
<!-- in the project's Project Properties dialog box.-->
10+
<project name="FinalDPWebApp" default="default" basedir=".">
11+
<description>Builds, tests, and runs the project FinalDPWebApp.</description>
12+
<import file="nbproject/build-impl.xml"/>
13+
<!--
14+
15+
There exist several targets which are by default empty and which can be
16+
used for execution of your tasks. These targets are usually executed
17+
before and after some main targets. They are:
18+
19+
-pre-init: called before initialization of project properties
20+
-post-init: called after initialization of project properties
21+
-pre-compile: called before javac compilation
22+
-post-compile: called after javac compilation
23+
-pre-compile-single: called before javac compilation of single file
24+
-post-compile-single: called after javac compilation of single file
25+
-pre-compile-test: called before javac compilation of JUnit tests
26+
-post-compile-test: called after javac compilation of JUnit tests
27+
-pre-compile-test-single: called before javac compilation of single JUnit test
28+
-post-compile-test-single: called after javac compilation of single JUunit test
29+
-pre-dist: called before archive building
30+
-post-dist: called after archive building
31+
-post-clean: called after cleaning build products
32+
-pre-run-deploy: called before deploying
33+
-post-run-deploy: called after deploying
34+
35+
Example of pluging an obfuscator after the compilation could look like
36+
37+
<target name="-post-compile">
38+
<obfuscate>
39+
<fileset dir="${build.classes.dir}"/>
40+
</obfuscate>
41+
</target>
42+
43+
For list of available properties check the imported
44+
nbproject/build-impl.xml file.
45+
46+
47+
Other way how to customize the build is by overriding existing main targets.
48+
The target of interest are:
49+
50+
init-macrodef-javac: defines macro for javac compilation
51+
init-macrodef-junit: defines macro for junit execution
52+
init-macrodef-debug: defines macro for class debugging
53+
do-dist: archive building
54+
run: execution of project
55+
javadoc-build: javadoc generation
56+
57+
Example of overriding the target for project execution could look like
58+
59+
<target name="run" depends="<PROJNAME>-impl.jar">
60+
<exec dir="bin" executable="launcher.exe">
61+
<arg file="${dist.jar}"/>
62+
</exec>
63+
</target>
64+
65+
Notice that overridden target depends on jar target and not only on
66+
compile target as regular run target does. Again, for list of available
67+
properties which you can use check the target you are overriding in
68+
nbproject/build-impl.xml file.
69+
70+
-->
71+
</project>

FinalDPWebApp/database.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# To change this license header, choose License Headers in Project Properties.
2+
# To change this template file, choose Tools | Templates
3+
# and open the template in the editor.
4+
5+
DB_DRIVER_CLASS=com.mysql.jdbc.Driver
6+
DB_URL=jdbc:mysql://localhost:3306/DPFINAL_DB
7+
DB_USERNAME=root
8+
DB_PASSWORD=2524

FinalDPWebApp/dist/FinalDPWebApp.war

6.77 MB
Binary file not shown.
Binary file not shown.
274 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)