This is a JSF2 + JPA2 + Maven3 project. Developed and tested on Glassfish3 and MySQL
-
1) You need to have at least jdk 1.6 installed and set up on your computer
http://www.oracle.com/technetwork/java/javase/downloads/index.html
-
2) You need to have Maven installed and configured on your computer
http://maven.apache.org/download.cgi
-
3) You need to have Glassfish3 (JBoss should work too) installed on your computer
http://www.oracle.com/technetwork/middleware/glassfish/overview/index.html
-
4) You need to have MySQL Server installed on your computer
http://www.mysql.fr/downloads/mysql/
-
5) You may need to download MySQL Connector too
http://www.mysql.fr/downloads/connector/j/
hint: You may need to reboot your computer
If you set everything up well, these command lines should work in you Terminal/Cmd
$ java -version
$ mvn --version
- Copy the MySQL Connector jar to $Glassfish_Install_dir/glassfish/lib
- Run Glassfish and go to the admin console http://localhost:4848
Create a new Connexion Pool and a Data Source named: jdbc/RMT
'jdbc/RMT' just match the Data Source I declared in the persistence.xml
In your Terminal/Cmd enter this command line:
$ git clone https://github.com/cAhmad/RMT-Supinfo.git
You have now a copy of the entire project
$ cd RMT-Supinfo
$ git checkout tags/Step1
This will give a working exercise 1 project
Open the project with your IDE, Build the project with dependencies if you got error.
You can also go to the RMT-Supinfo project directory and type in your Terminal/Cmd:
$ mvn clean package
Dependencies errors should be gone now and you can Deploy it.
Once you got it deployed, you should have 3 Tables in your DataBase which are Client, RMTUser, WorkTime
You have to insert a Manager to use this application
Open a Terminal/Cmd and type:
$ mysql DATABASE_NAME -uRMT_DATABASE_USER -pRMT_DATABASE_USER_PASSWORD
mysql> INSERT INTO RMTUser
(userType
, id
, dateOfBirth
, email
, firstName
, lastName
, password
, username
, manager_id
) VALUES
('manager', 1, '1975-10-07', '[email protected]', 'Eric', 'Cartman', 'ebfc7910077770c8340f63cd2dca2ac1f120444f', 'manager', NULL);
The password is 'Passw0rd' hashed with SHA1, you can changed it but do not forget to SHA1 it.
Once you set everything up correctly you ready to go :-)