Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (6)
commit création projet prodigiup_gescollab
· 45ae6581
cberge
authored
Jun 11, 2024
45ae6581
commit de test pour initialiser le projet
· 0563a848
asolanas
authored
Jun 11, 2024
0563a848
commit de test pour initialiser le projet
· 58e0e5f2
asolanas
authored
Jun 11, 2024
58e0e5f2
commit sur branche dev
· e0af7ef1
asolanas
authored
Jun 11, 2024
e0af7ef1
commit creation Dao
· dca3b410
cberge
authored
Jun 11, 2024
dca3b410
Merge origin/developpement into main
· e12d7354
cberge
authored
Jun 11, 2024
e12d7354
Show whitespace changes
Inline
Side-by-side
prodigiup_gescollab/nb-configuration.xml
0 → 100644
View file @
e12d7354
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties
xmlns=
"http://www.netbeans.org/ns/maven-properties-data/1"
>
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
10-web
</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
Tomcat
</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
<org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>
ide
</org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>
</properties>
</project-shared-configuration>
prodigiup_gescollab/pom.xml
0 → 100644
View file @
e12d7354
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.mycompany
</groupId>
<artifactId>
prodigiup_gescollab
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<packaging>
war
</packaging>
<name>
prodigiup_gescollab2-1.0-SNAPSHOT
</name>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<jakartaee>
10.0.0
</jakartaee>
</properties>
<dependencies>
<dependency>
<groupId>
org.mariadb.jdbc
</groupId>
<artifactId>
mariadb-java-client
</artifactId>
<version>
3.3.3
</version>
</dependency>
<dependency>
<groupId>
jstl
</groupId>
<artifactId>
jstl
</artifactId>
<version>
1.2
</version>
</dependency>
<dependency>
<groupId>
jakarta.platform
</groupId>
<artifactId>
jakarta.jakartaee-api
</artifactId>
<version>
${jakartaee}
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.8.1
</version>
<configuration>
<source>
11
</source>
<target>
11
</target>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-war-plugin
</artifactId>
<version>
3.3.2
</version>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
prodigiup_gescollab/src/main/java/com/mycompany/prodigiup_gescollab/JakartaRestConfiguration.java
0 → 100644
View file @
e12d7354
package
com.mycompany.prodigiup_gescollab
;
import
jakarta.ws.rs.ApplicationPath
;
import
jakarta.ws.rs.core.Application
;
/**
* Configures Jakarta RESTful Web Services for the application.
* @author Juneau
*/
@ApplicationPath
(
"resources"
)
public
class
JakartaRestConfiguration
extends
Application
{
}
prodigiup_gescollab/src/main/java/com/mycompany/prodigiup_gescollab/resources/JakartaEE10Resource.java
0 → 100644
View file @
e12d7354
package
com.mycompany.prodigiup_gescollab.resources
;
import
jakarta.ws.rs.GET
;
import
jakarta.ws.rs.Path
;
import
jakarta.ws.rs.core.Response
;
/**
*
* @author
*/
@Path
(
"jakartaee10"
)
public
class
JakartaEE10Resource
{
@GET
public
Response
ping
(){
return
Response
.
ok
(
"ping Jakarta EE"
)
.
build
();
}
}
prodigiup_gescollab/src/main/java/dao/Dao.java
0 → 100644
View file @
e12d7354
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Other/File.java to edit this template
*/
package
dao
;
import
entities.Identifiable
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.util.Properties
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
/**
*
* @author cberge
*/
public
abstract
class
Dao
<
T
extends
Identifiable
>
{
protected
Connection
connexion
;
protected
String
table
;
protected
static
Properties
config
;
public
Dao
(
String
table
){
connexion
=
MariadbConnection
.
getInstance
();
this
.
table
=
table
;
}
protected
abstract
T
createObject
(
ResultSet
rs
)
throws
SQLException
;
public
T
read
(
Integer
id
){
T
obj
=
null
;
String
sql
=
"SELECT * FROM "
+
table
+
"WHERE id_"
+
table
+
"=?"
;
try
(
PreparedStatement
pstmt
=
connexion
.
prepareStatement
(
sql
)){
// try{ PreparedStatement pstmt = connexion.prepareStatement(sql)){
pstmt
.
setInt
(
1
,
id
);
ResultSet
rs
=
pstmt
.
executeQuery
();
if
(
rs
.
first
())
{
obj
=
createObject
(
rs
);
}
}
catch
(
SQLException
ex
)
{
Logger
.
getLogger
(
Dao
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
.
getMessage
());
}
return
obj
;
}}
prodigiup_gescollab/src/main/java/dao/DaoFactory.java
0 → 100644
View file @
e12d7354
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Other/File.java to edit this template
*/
package
dao
;
/**
*
* @author cberge
*/
public
class
DaoFactory
{
}
prodigiup_gescollab/src/main/java/dao/MariadbConnection.java
0 → 100644
View file @
e12d7354
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Other/File.java to edit this template
*/
package
dao
;
import
java.sql.Connection
;
import
java.sql.DriverManager
;
import
java.sql.SQLException
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
/**
*
* @author cberge
*/
public
class
MariadbConnection
{
private
static
Connection
connection
;
private
MariadbConnection
()
{
}
public
static
Connection
getInstance
(){
if
(
connection
==
null
){
String
url
=
String
.
format
(
"%s://%s:%s/%s"
,
"jdbc:mariadb"
,
"localhost"
,
"3306"
,
"bd_gescollab"
);
try
{
Class
.
forName
(
"org.mariadb.jdbc.Driver"
);
connection
=
DriverManager
.
getConnection
(
url
,
"root"
,
""
);
}
catch
(
SQLException
ex
){
Logger
.
getLogger
(
MariadbConnection
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
System
.
exit
(
2
);
}
catch
(
ClassNotFoundException
ex
){
Logger
.
getLogger
(
MariadbConnection
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
}
}
return
connection
;
}
public
static
void
closeConnection
(){
if
(
connection
!=
null
){
Logger
.
getLogger
(
MariadbConnection
.
class
.
getName
()).
log
(
Level
.
INFO
,
"Fermeture de la connexion."
);
try
{
connection
.
close
();
}
catch
(
SQLException
ex
){
Logger
.
getLogger
(
MariadbConnection
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
}
}
}
}
prodigiup_gescollab/src/main/java/entities/Identifiable.java
0 → 100644
View file @
e12d7354
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Other/File.java to edit this template
*/
package
entities
;
/**
*
* @author cberge
*/
public
interface
Identifiable
{
Integer
getId
();
void
setId
(
Integer
id
);
}
prodigiup_gescollab/src/main/resources/META-INF/persistence.xml
0 → 100644
View file @
e12d7354
<?xml version="1.0" encoding="UTF-8"?>
<persistence
version=
"3.0"
xmlns=
"https://jakarta.ee/xml/ns/persistence"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd"
>
<!-- Define Persistence Unit -->
<persistence-unit
name=
"my_persistence_unit"
>
</persistence-unit>
</persistence>
prodigiup_gescollab/src/main/webapp/META-INF/context.xml
0 → 100644
View file @
e12d7354
<?xml version="1.0" encoding="UTF-8"?>
<Context
path=
"/prodigiup_gescollab"
/>
prodigiup_gescollab/src/main/webapp/WEB-INF/beans.xml
0 → 100644
View file @
e12d7354
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd"
bean-discovery-mode=
"all"
>
</beans>
\ No newline at end of file
prodigiup_gescollab/src/main/webapp/WEB-INF/web.xml
0 → 100644
View file @
e12d7354
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns=
"https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version=
"6.0"
>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
</web-app>
prodigiup_gescollab/src/main/webapp/index.html
0 → 100644
View file @
e12d7354
<!DOCTYPE html>
<html>
<head>
<title>
Start Page
</title>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
</head>
<body>
<h1>
Hello World!
</h1>
</body>
</html>
src/main/java/entities/ResponsableActivite.java
0 → 100644
View file @
e12d7354
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package
entities
;
/**
*
* @author Amélie Solanas Pruvost <future CDA>
*/
public
class
ResponsableActivite
{
}
src/main/webapp/index.html
0 → 100644
View file @
e12d7354
<!DOCTYPE html>
<html>
<head>
<title>
Start Page
</title>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
</head>
<body>
<h1>
Hello Amélie!
</h1>
</body>
</html>