1
0
Fork 0

Initial commit

This commit is contained in:
Ethanell 2022-06-27 21:14:35 +02:00
commit 63feda15b0
152 changed files with 7092 additions and 0 deletions

71
build.xml Normal file
View file

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="Bdd_Spring_HI" default="default" basedir=".">
<description>Builds, tests, and runs the project Bdd_Spring_HI.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-dist: called before archive building
-post-dist: called after archive building
-post-clean: called after cleaning build products
-pre-run-deploy: called before deploying
-post-run-deploy: called after deploying
Example of pluging an obfuscator after the compilation could look like
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Other way how to customize the build is by overriding existing main targets.
The target of interest are:
init-macrodef-javac: defines macro for javac compilation
init-macrodef-junit: defines macro for junit execution
init-macrodef-debug: defines macro for class debugging
do-dist: archive building
run: execution of project
javadoc-build: javadoc generation
Example of overriding the target for project execution could look like
<target name="run" depends="<PROJNAME>-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that overridden target depends on jar target and not only on
compile target as regular run target does. Again, for list of available
properties which you can use check the target you are overriding in
nbproject/build-impl.xml file.
-->
</project>

View file

@ -0,0 +1,2 @@
Manifest-Version: 1.0

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
<!--bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="/WEB-INF/jdbc.properties" />
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="${jdbc.driverClassName}"
p:url="${jdbc.url}"
p:username="${jdbc.username}"
p:password="${jdbc.password}" /-->
<!-- ADD PERSISTENCE SUPPORT HERE (jpa, hibernate, etc) -->
</beans>

Binary file not shown.

View file

@ -0,0 +1,45 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated 8 avr. 2022 15:30:29 by Hibernate Tools 4.3.1 -->
<hibernate-mapping>
<class name="DAO.Customer" table="CUSTOMER" schema="APP">
<id name="customerId" type="int">
<column name="CUSTOMER_ID" />
<generator class="assigned"></generator>
</id>
<property name="discountCode" type="char">
<column name="DISCOUNT_CODE" length="1" not-null="true" />
</property>
<property name="zip" type="string">
<column name="ZIP" length="10" not-null="true" />
</property>
<property name="name" type="string">
<column name="NAME" length="30" />
</property>
<property name="addressline1" type="string">
<column name="ADDRESSLINE1" length="30" />
</property>
<property name="addressline2" type="string">
<column name="ADDRESSLINE2" length="30" />
</property>
<property name="city" type="string">
<column name="CITY" length="25" />
</property>
<property name="state" type="string">
<column name="STATE" length="2" />
</property>
<property name="phone" type="string">
<column name="PHONE" length="12" />
</property>
<property name="fax" type="string">
<column name="FAX" length="12" />
</property>
<property name="email" type="string">
<column name="EMAIL" length="40" />
</property>
<property name="creditLimit" type="java.lang.Integer">
<column name="CREDIT_LIMIT" />
</property>
</class>
</hibernate-mapping>

Binary file not shown.

View file

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated 8 avr. 2022 15:30:29 by Hibernate Tools 4.3.1 -->
<hibernate-mapping>
<class name="DAO.DiscountCode" table="DISCOUNT_CODE" schema="APP">
<id name="discountCode" type="char">
<column name="DISCOUNT_CODE" length="1" />
<generator class="assigned"></generator>
</id>
<property name="rate" type="big_decimal">
<column name="RATE" precision="4" />
</property>
</class>
</hibernate-mapping>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,42 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated 8 avr. 2022 15:30:29 by Hibernate Tools 4.3.1 -->
<hibernate-mapping>
<class name="DAO.Manufacturer" table="MANUFACTURER" schema="APP">
<id name="manufacturerId" type="int">
<column name="MANUFACTURER_ID" />
<generator class="assigned"></generator>
</id>
<property name="name" type="string">
<column name="NAME" length="30" />
</property>
<property name="addressline1" type="string">
<column name="ADDRESSLINE1" length="30" />
</property>
<property name="addressline2" type="string">
<column name="ADDRESSLINE2" length="30" />
</property>
<property name="city" type="string">
<column name="CITY" length="25" />
</property>
<property name="state" type="string">
<column name="STATE" length="2" />
</property>
<property name="zip" type="string">
<column name="ZIP" length="10" />
</property>
<property name="phone" type="string">
<column name="PHONE" length="12" />
</property>
<property name="fax" type="string">
<column name="FAX" length="12" />
</property>
<property name="email" type="string">
<column name="EMAIL" length="40" />
</property>
<property name="rep" type="string">
<column name="REP" length="30" />
</property>
</class>
</hibernate-mapping>

Binary file not shown.

View file

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated 8 avr. 2022 15:30:29 by Hibernate Tools 4.3.1 -->
<hibernate-mapping>
<class name="DAO.MicroMarket" table="MICRO_MARKET" schema="APP">
<id name="zipCode" type="string">
<column name="ZIP_CODE" length="10" />
<generator class="assigned"></generator>
</id>
<property name="radius" type="java.lang.Double">
<column name="RADIUS" precision="52" scale="0" />
</property>
<property name="areaLength" type="java.lang.Double">
<column name="AREA_LENGTH" precision="52" scale="0" />
</property>
<property name="areaWidth" type="java.lang.Double">
<column name="AREA_WIDTH" precision="52" scale="0" />
</property>
</class>
</hibernate-mapping>

Binary file not shown.

View file

@ -0,0 +1,33 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated 8 avr. 2022 15:30:29 by Hibernate Tools 4.3.1 -->
<hibernate-mapping>
<class name="DAO.Product" table="PRODUCT" schema="APP">
<id name="productId" type="int">
<column name="PRODUCT_ID" />
<generator class="assigned"></generator>
</id>
<property name="manufacturerId" type="int">
<column name="MANUFACTURER_ID" not-null="true" />
</property>
<property name="productCode" type="string">
<column name="PRODUCT_CODE" length="2" not-null="true" />
</property>
<property name="purchaseCost" type="big_decimal">
<column name="PURCHASE_COST" precision="12" />
</property>
<property name="quantityOnHand" type="java.lang.Integer">
<column name="QUANTITY_ON_HAND" />
</property>
<property name="markup" type="big_decimal">
<column name="MARKUP" precision="4" />
</property>
<property name="available" type="string">
<column name="AVAILABLE" length="5" />
</property>
<property name="description" type="string">
<column name="DESCRIPTION" length="50" />
</property>
</class>
</hibernate-mapping>

Binary file not shown.

View file

@ -0,0 +1,18 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated 8 avr. 2022 15:30:29 by Hibernate Tools 4.3.1 -->
<hibernate-mapping>
<class name="DAO.ProductCode" table="PRODUCT_CODE" schema="APP">
<id name="prodCode" type="string">
<column name="PROD_CODE" length="2" />
<generator class="assigned"></generator>
</id>
<property name="discountCode" type="char">
<column name="DISCOUNT_CODE" length="1" not-null="true" />
</property>
<property name="description" type="string">
<column name="DESCRIPTION" length="10" />
</property>
</class>
</hibernate-mapping>

Binary file not shown.

View file

@ -0,0 +1,33 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated 8 avr. 2022 15:30:29 by Hibernate Tools 4.3.1 -->
<hibernate-mapping>
<class name="DAO.PurchaseOrder" table="PURCHASE_ORDER" schema="APP">
<id name="orderNum" type="int">
<column name="ORDER_NUM" />
<generator class="assigned"></generator>
</id>
<property name="customerId" type="int">
<column name="CUSTOMER_ID" not-null="true" />
</property>
<property name="productId" type="int">
<column name="PRODUCT_ID" not-null="true" />
</property>
<property name="quantity" type="java.lang.Short">
<column name="QUANTITY" />
</property>
<property name="shippingCost" type="big_decimal">
<column name="SHIPPING_COST" precision="12" />
</property>
<property name="salesDate" type="date">
<column name="SALES_DATE" length="10" />
</property>
<property name="shippingDate" type="date">
<column name="SHIPPING_DATE" length="10" />
</property>
<property name="freightCompany" type="string">
<column name="FREIGHT_COMPANY" length="30" />
</property>
</class>
</hibernate-mapping>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
<!--bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="/WEB-INF/jdbc.properties" />
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="${jdbc.driverClassName}"
p:url="${jdbc.url}"
p:username="${jdbc.username}"
p:password="${jdbc.password}" /-->
<!-- ADD PERSISTENCE SUPPORT HERE (jpa, hibernate, etc) -->
</beans>

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
<bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/>
<!--
Most controllers will use the ControllerClassNameHandlerMapping above, but
for the index controller we are using ParameterizableViewController, so we must
define an explicit mapping for it.
-->
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="index.htm">indexController</prop>
<prop key="*.htm">BddController</prop>
</props>
</property>
</bean>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/jsp/"
p:suffix=".jsp" />
<!--
The index controller.
-->
<bean name="indexController"
class="org.springframework.web.servlet.mvc.ParameterizableViewController"
p:viewName="index"/>
<bean name="BddController" class="controller.BddController" />
</beans>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
<description>Keep a copy of the generated servlet class' java code.</description>
</property>
</jsp-config>
</glassfish-web-app>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.DerbyDialect</property>
<property name="hibernate.connection.driver_class">org.apache.derby.jdbc.ClientDriver</property>
<property name="hibernate.connection.url">jdbc:derby://localhost:1527/sample</property>
<property name="hibernate.connection.username">app</property>
<property name="hibernate.connection.password">app</property>
<mapping resource="DAO/DiscountCode.hbm.xml"/>
<mapping resource="DAO/Product.hbm.xml"/>
<mapping resource="DAO/PurchaseOrder.hbm.xml"/>
<mapping resource="DAO/Manufacturer.hbm.xml"/>
<mapping resource="DAO/MicroMarket.hbm.xml"/>
<mapping resource="DAO/Customer.hbm.xml"/>
<mapping resource="DAO/ProductCode.hbm.xml"/>
</session-factory>
</hibernate-configuration>

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd">
<hibernate-reverse-engineering>
<schema-selection match-schema="APP"/>
<table-filter match-name="MANUFACTURER"/>
<table-filter match-name="PRODUCT"/>
<table-filter match-name="DISCOUNT_CODE"/>
<table-filter match-name="PRODUCT_CODE"/>
<table-filter match-name="MICRO_MARKET"/>
<table-filter match-name="PURCHASE_ORDER"/>
<table-filter match-name="CUSTOMER"/>
</hibernate-reverse-engineering>

View file

@ -0,0 +1,34 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Achats</title>
</head>
<body>
<%@include file="header.jsp" %>
<H1>Achats du client n°<%=request.getParameter("numero")%></H1>
<table border="1" cellpadding="10">
<c:forEach items="${achats}" var="cli">
<TR>
<TD>${cli.orderNum}</TD>
<TD>${cli.customerId}</TD>
<TD>${cli.productId}</TD>
<TD>${cli.quantity}</TD>
<TD>${cli.shippingCost}</TD>
<TD>${cli.salesDate}</TD>
<TD>${cli.shippingDate}</TD>
<TD>${cli.freightCompany}</TD>
</TR>
</c:forEach>
</table>
</body>
</html>

View file

@ -0,0 +1,22 @@
<%--
Document : confirm
Created on : 5 mars 2018, 22:16:48
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Confirmation</title>
</head>
<body>
<%@include file="header.jsp" %>
<h1>${confirm} </h1>
<form action="list.htm" method="POST">
<input type="submit" value="Afficher tous les enregistrements" />
</form>
</body>
</html>

View file

@ -0,0 +1,18 @@
<%--
Document : deconnexion
Created on : 1 juin 2020, 17:09:38
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Deconnexion</title>
</head>
<body>
<h1>Vous etes deconnecte</h1>
<%response.sendRedirect("/Bdd_Spring_HI/");%>
</body>
</html>

View file

@ -0,0 +1,55 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Detail</title>
</head>
<body>
<%@include file="header.jsp" %>
<form name="detail" method="POST">
<p>
<label for="numero">Numero</label>
<input type="text" name="numero" value="${client.customerId}" size="30" id="numero" />
</p>
<p>
<label for="nom">Nom</label>
<input type="text" name="nom" value="${client.name}" size="30" id="nom" />
</p>
<p>
<label for="adresse">Adresse</label>
<input type="text" name="adresse" value="${client.addressline1}" size="30" id="adresse" />
</p>
<p>
<label for="telephone">Téléphone</label>
<input type="text" name="telephone" value="${client.phone}" size="30" id="tel" />
</p>
<p>
<label for="email">E-mail</label>
<input type="text" name="email" value="${client.email}" size="30" id="email"/>
</p>
<p>
<label for="Remise">Remise</label>
<select name="code_remise" id="dc">
<c:forEach items="${code}" var="dc">
<option <c:if test="${dc==client.discountCode}"> selected </c:if>>${dc}</option>
</c:forEach>
</select>
</p>
<p>
<label for="cp">Code Postal</label>
<select name="CP" id="cp">
<c:forEach items="${cpostaux}" var="cp">
<option <c:if test="${cp==client.zip}"> selected </c:if>>${cp}</option>
</c:forEach>
</select>
</p>
<input type="submit" value="Modifier" formaction="update.htm" />
<input type="submit" value="Supprimer" formaction="delete.htm" />
<input type="submit" value="Afficher les achats" formaction="achats.htm" />
</form>
</body>
</html>

View file

@ -0,0 +1,17 @@
<%--
Document : errlogin
Created on : 1 juin 2020, 11:41:58
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Erreur de connexion</h1>
</body>
</html>

View file

@ -0,0 +1,18 @@
<%--
Document : error
Created on : 4 mars 2018, 20:54:56
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Erreur</title>
</head>
<body>
<%@include file="header.jsp" %>
<h1>${erreur} </h1>
</body>
</html>

View file

@ -0,0 +1,55 @@
<%--
Document : form_inscription
Created on : 5 mars 2018, 20:34:28
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Enregistrement</title>
</head>
<body>
Bienvenue ${user.login}
<form name="inscription" method="POST">
<p>
<label for="nom">Nom</label>
<input type="text" name="nom" value="" size="10" id="nom" />
</p>
<p>
<label for="adresse">Adresse</label>
<input type="text" name="adresse" value="" size="10" id="adresse" />
</p>
<p>
<label for="telephone">Téléphone</label>
<input type="text" name="telephone" value="" size="10" id="tel" />
</p>
<p>
<label for="email">E-mail</label>
<input type="text" name="email" value="" size="10" id="email"/>
</p>
<p><label for="code_remise">Code Remise</label>
<select name="code_remise" id="dc">
<c:forEach items="${discount}" var="dc">
<option>${dc}</option>
</c:forEach>
</select>
</p>
<p>
<label for="cp">Code Postal</label>
<select name="CP" id="cp">
<c:forEach items="${code}" var="cp">
<option>${cp}</option>
</c:forEach>
</select>
</p>
<input type="submit" value="Enregistrer" formaction="save.htm" />
</form>
</body>
</html>

View file

@ -0,0 +1,21 @@
<%--
Document : heqder
Created on : 26 juin 2022, 18:37:00
Author : flifloo
--%>
<header>
<nav style="display: flex; flex-direction: row; justify-content: space-between">
<div style="display: flex; flex-direction: row">
<p>Bienvenue ${user.login}</p>
</div>
<div style="display: flex; flex-direction: row; justify-content: flex-end">
<form name="form" method="POST">
<input type="submit" formaction="logout.htm" value="Se déconnecter" />
<input type="text" name="search" />
<input type="submit" formaction="search.htm" value="Chercher" />
</form>
</div>
</nav>
</header>

View file

@ -0,0 +1,6 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<% response.sendRedirect("menu.htm"); %>

View file

@ -0,0 +1,32 @@
<%--
Document : login
Created on : 1 juin 2020, 11:40:47
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Connexion</title>
</head>
<body>
<form method="POST" action="j_security_check">
<table>
<tr>
<td>Utilisateur :</td>
<td><input type="text" name="j_username"></td>
</tr>
<tr>
<td>Mot de passe :</td>
<td><input type="password" name="j_password" ></td>
</tr>
<tr>
<td><input type="submit" value="Entrer" ></td>
<td><input type="reset" value="Annuler"></td>
</tr>
</table>
</form>
</body>
</html>

View file

@ -0,0 +1,25 @@
<%--
Document : menu
Created on : 4 mars 2018, 16:59:09
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Menu</title>
</head>
<body>
<%@include file="header.jsp" %>
<h1>choisissez une opération dans la liste suivante</h1>
<form name="form" method="POST">
<input type="submit" formaction="purchase.htm" value="Ventes" /> <br />
<input type="submit" formaction="product.htm" value="Produits" /> <br />
<input type="submit" formaction="discount.htm" value="Références produits" /> <br />
<input type="submit" formaction="customer.htm" value="Clients" />
</form>
</body>
</html>

View file

@ -0,0 +1,26 @@
<%--
Document : recherche
Created on : 7 juin 2019, 11:52:07
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Recherche</title>
</head>
<body>
<%@include file="header.jsp" %>
<form name="recherche" action="find.htm" method="POST">
<p>
<label for="nom">Nom de l'entreprise</label>
<input type="text" name="nom" size="30" id="nom" />
</p>
<input type="submit" value="rechercher" />
</form>
</body>
</html>

View file

@ -0,0 +1,56 @@
<%--
Document : resultat
Created on : 4 mars 2018, 20:29:48
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Resultat</title>
</head>
<body>
<%@include file="header.jsp" %>
<table border="1" cellpadding="10">
<TR>
<c:forEach items="${colonnes}" var="col">
<TD>${col}</TD>
</c:forEach>
</TR>
<c:forEach items="${results}" var="values" varStatus="row" >
<TR>
<c:forEach items="${values}" var="v" >
<TD>${v}
</TD>
</c:forEach>
<TD>
<form name="Detail" action="detail.htm" method="POST">
<input type=hidden name="type" value="${type}"/>
<input type=hidden name="num" value="${list[row.index][0]}"/>
<input type=submit value="Détail" />
</form>
</TD>
</TR>
</c:forEach>
<%-- <c:forEach items="${liste}" var="client">
<TR>
<TD>${client.customerId}</TD>
<TD>${client.discountCode}</TD>
<TD>${client.zip}</TD>
<TD>${client.name}</TD>
</TR>
</c:forEach> --%>
</table>
</body>
</html>

Binary file not shown.

View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>redirect.jsp</welcome-file>
</welcome-file-list>
<security-constraint>
<display-name>Constraint1</display-name>
<web-resource-collection>
<web-resource-name>Application</web-resource-name>
<description/>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<description/>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>file</realm-name>
<form-login-config>
<form-login-page>/WEB-INF/jsp/login.jsp</form-login-page>
<form-error-page>/WEB-INF/jsp/errlogin.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description/>
<role-name>user</role-name>
</security-role>
</web-app>

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
<bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/>
<!--
Most controllers will use the ControllerClassNameHandlerMapping above, but
for the index controller we are using ParameterizableViewController, so we must
define an explicit mapping for it.
-->
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="index.htm">indexController</prop>
<prop key="*.htm">BddController</prop>
</props>
</property>
</bean>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/jsp/"
p:suffix=".jsp" />
<!--
The index controller.
-->
<bean name="indexController"
class="org.springframework.web.servlet.mvc.ParameterizableViewController"
p:viewName="index"/>
<bean name="BddController" class="controller.BddController" />
</beans>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
<description>Keep a copy of the generated servlet class' java code.</description>
</property>
</jsp-config>
</glassfish-web-app>

View file

@ -0,0 +1,34 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Achats</title>
</head>
<body>
<%@include file="header.jsp" %>
<H1>Achats du client n°<%=request.getParameter("numero")%></H1>
<table border="1" cellpadding="10">
<c:forEach items="${achats}" var="cli">
<TR>
<TD>${cli.orderNum}</TD>
<TD>${cli.customerId}</TD>
<TD>${cli.productId}</TD>
<TD>${cli.quantity}</TD>
<TD>${cli.shippingCost}</TD>
<TD>${cli.salesDate}</TD>
<TD>${cli.shippingDate}</TD>
<TD>${cli.freightCompany}</TD>
</TR>
</c:forEach>
</table>
</body>
</html>

View file

@ -0,0 +1,22 @@
<%--
Document : confirm
Created on : 5 mars 2018, 22:16:48
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Confirmation</title>
</head>
<body>
<%@include file="header.jsp" %>
<h1>${confirm} </h1>
<form action="list.htm" method="POST">
<input type="submit" value="Afficher tous les enregistrements" />
</form>
</body>
</html>

View file

@ -0,0 +1,18 @@
<%--
Document : deconnexion
Created on : 1 juin 2020, 17:09:38
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Deconnexion</title>
</head>
<body>
<h1>Vous etes deconnecte</h1>
<%response.sendRedirect("/Bdd_Spring_HI/");%>
</body>
</html>

View file

@ -0,0 +1,55 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Detail</title>
</head>
<body>
<%@include file="header.jsp" %>
<form name="detail" method="POST">
<p>
<label for="numero">Numero</label>
<input type="text" name="numero" value="${client.customerId}" size="30" id="numero" />
</p>
<p>
<label for="nom">Nom</label>
<input type="text" name="nom" value="${client.name}" size="30" id="nom" />
</p>
<p>
<label for="adresse">Adresse</label>
<input type="text" name="adresse" value="${client.addressline1}" size="30" id="adresse" />
</p>
<p>
<label for="telephone">Téléphone</label>
<input type="text" name="telephone" value="${client.phone}" size="30" id="tel" />
</p>
<p>
<label for="email">E-mail</label>
<input type="text" name="email" value="${client.email}" size="30" id="email"/>
</p>
<p>
<label for="Remise">Remise</label>
<select name="code_remise" id="dc">
<c:forEach items="${code}" var="dc">
<option <c:if test="${dc==client.discountCode}"> selected </c:if>>${dc}</option>
</c:forEach>
</select>
</p>
<p>
<label for="cp">Code Postal</label>
<select name="CP" id="cp">
<c:forEach items="${cpostaux}" var="cp">
<option <c:if test="${cp==client.zip}"> selected </c:if>>${cp}</option>
</c:forEach>
</select>
</p>
<input type="submit" value="Modifier" formaction="update.htm" />
<input type="submit" value="Supprimer" formaction="delete.htm" />
<input type="submit" value="Afficher les achats" formaction="achats.htm" />
</form>
</body>
</html>

View file

@ -0,0 +1,17 @@
<%--
Document : errlogin
Created on : 1 juin 2020, 11:41:58
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Erreur de connexion</h1>
</body>
</html>

View file

@ -0,0 +1,18 @@
<%--
Document : error
Created on : 4 mars 2018, 20:54:56
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Erreur</title>
</head>
<body>
<%@include file="header.jsp" %>
<h1>${erreur} </h1>
</body>
</html>

View file

@ -0,0 +1,55 @@
<%--
Document : form_inscription
Created on : 5 mars 2018, 20:34:28
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Enregistrement</title>
</head>
<body>
Bienvenue ${user.login}
<form name="inscription" method="POST">
<p>
<label for="nom">Nom</label>
<input type="text" name="nom" value="" size="10" id="nom" />
</p>
<p>
<label for="adresse">Adresse</label>
<input type="text" name="adresse" value="" size="10" id="adresse" />
</p>
<p>
<label for="telephone">Téléphone</label>
<input type="text" name="telephone" value="" size="10" id="tel" />
</p>
<p>
<label for="email">E-mail</label>
<input type="text" name="email" value="" size="10" id="email"/>
</p>
<p><label for="code_remise">Code Remise</label>
<select name="code_remise" id="dc">
<c:forEach items="${discount}" var="dc">
<option>${dc}</option>
</c:forEach>
</select>
</p>
<p>
<label for="cp">Code Postal</label>
<select name="CP" id="cp">
<c:forEach items="${code}" var="cp">
<option>${cp}</option>
</c:forEach>
</select>
</p>
<input type="submit" value="Enregistrer" formaction="save.htm" />
</form>
</body>
</html>

View file

@ -0,0 +1,21 @@
<%--
Document : heqder
Created on : 26 juin 2022, 18:37:00
Author : flifloo
--%>
<header>
<nav style="display: flex; flex-direction: row; justify-content: space-between">
<div style="display: flex; flex-direction: row">
<p>Bienvenue ${user.login}</p>
</div>
<div style="display: flex; flex-direction: row; justify-content: flex-end">
<form name="form" method="POST">
<input type="submit" formaction="logout.htm" value="Se déconnecter" />
<input type="text" name="search" />
<input type="submit" formaction="search.htm" value="Chercher" />
</form>
</div>
</nav>
</header>

View file

@ -0,0 +1,6 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<% response.sendRedirect("menu.htm"); %>

View file

@ -0,0 +1,32 @@
<%--
Document : login
Created on : 1 juin 2020, 11:40:47
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Connexion</title>
</head>
<body>
<form method="POST" action="j_security_check">
<table>
<tr>
<td>Utilisateur :</td>
<td><input type="text" name="j_username"></td>
</tr>
<tr>
<td>Mot de passe :</td>
<td><input type="password" name="j_password" ></td>
</tr>
<tr>
<td><input type="submit" value="Entrer" ></td>
<td><input type="reset" value="Annuler"></td>
</tr>
</table>
</form>
</body>
</html>

View file

@ -0,0 +1,25 @@
<%--
Document : menu
Created on : 4 mars 2018, 16:59:09
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Menu</title>
</head>
<body>
<%@include file="header.jsp" %>
<h1>choisissez une opération dans la liste suivante</h1>
<form name="form" method="POST">
<input type="submit" formaction="purchase.htm" value="Ventes" /> <br />
<input type="submit" formaction="product.htm" value="Produits" /> <br />
<input type="submit" formaction="discount.htm" value="Références produits" /> <br />
<input type="submit" formaction="customer.htm" value="Clients" />
</form>
</body>
</html>

View file

@ -0,0 +1,26 @@
<%--
Document : recherche
Created on : 7 juin 2019, 11:52:07
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Recherche</title>
</head>
<body>
<%@include file="header.jsp" %>
<form name="recherche" action="find.htm" method="POST">
<p>
<label for="nom">Nom de l'entreprise</label>
<input type="text" name="nom" size="30" id="nom" />
</p>
<input type="submit" value="rechercher" />
</form>
</body>
</html>

View file

@ -0,0 +1,56 @@
<%--
Document : resultat
Created on : 4 mars 2018, 20:29:48
Author : faycal
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Resultat</title>
</head>
<body>
<%@include file="header.jsp" %>
<table border="1" cellpadding="10">
<TR>
<c:forEach items="${colonnes}" var="col">
<TD>${col}</TD>
</c:forEach>
</TR>
<c:forEach items="${results}" var="values" varStatus="row" >
<TR>
<c:forEach items="${values}" var="v" >
<TD>${v}
</TD>
</c:forEach>
<TD>
<form name="Detail" action="detail.htm" method="POST">
<input type=hidden name="type" value="${type}"/>
<input type=hidden name="num" value="${list[row.index][0]}"/>
<input type=submit value="Détail" />
</form>
</TD>
</TR>
</c:forEach>
<%-- <c:forEach items="${liste}" var="client">
<TR>
<TD>${client.customerId}</TD>
<TD>${client.discountCode}</TD>
<TD>${client.zip}</TD>
<TD>${client.name}</TD>
</TR>
</c:forEach> --%>
</table>
</body>
</html>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

51
build/web/WEB-INF/web.xml Normal file
View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>redirect.jsp</welcome-file>
</welcome-file-list>
<security-constraint>
<display-name>Constraint1</display-name>
<web-resource-collection>
<web-resource-name>Application</web-resource-name>
<description/>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<description/>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>file</realm-name>
<form-login-config>
<form-login-page>/WEB-INF/jsp/login.jsp</form-login-page>
<form-error-page>/WEB-INF/jsp/errlogin.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description/>
<role-name>user</role-name>
</security-role>
</web-app>

25
build/web/gfv3ee6.dpf Normal file
View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<!--
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<glassfish-web-app error-url="">
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
<description>Keep a copy of the generated servlet class' java code.</description>
</property>
</jsp-config>
</glassfish-web-app>

Some files were not shown because too many files have changed in this diff Show more