Browse Source

Webjars y plantillas

master
Juanjo 1 year ago
parent
commit
92a81135cd
14 changed files with 128 additions and 67 deletions
  1. +43
    -18
      pom.xml
  2. +7
    -8
      src/main/java/es/fp/edu/conecta2/modelo2/IbexEntity.java
  3. +2
    -3
      src/main/java/es/fp/edu/conecta2/modelo2/Tabla1Entity.java
  4. +3
    -3
      src/main/java/es/fp/edu/conecta2/modelo2/Tabla2Entity.java
  5. +3
    -3
      src/main/java/es/fp/edu/conecta2/modelo2/Tabla3Entity.java
  6. +4
    -4
      src/main/java/es/fp/edu/conecta2/modelo2/VTabla1Entity.java
  7. +2
    -2
      src/main/resources/application.properties
  8. +12
    -0
      src/main/resources/static/hola.html
  9. +6
    -0
      src/main/resources/templates/foot/javascript.html
  10. +19
    -0
      src/main/resources/templates/head/head.html
  11. +7
    -7
      src/main/resources/templates/inicio.html
  12. +6
    -6
      src/main/resources/templates/opcionales.html
  13. +7
    -6
      src/main/resources/templates/parametros.html
  14. +7
    -7
      src/main/resources/templates/usuarios.html

+ 43
- 18
pom.xml View File

@ -17,58 +17,82 @@
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>2.7.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<scope>runtime</scope>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-mongodb -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>4.0.1</version>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>5.2.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-mongodb -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<version>3.0.2</version>
<groupId>org.webjars.bower</groupId>
<artifactId>jquery</artifactId>
<version>3.6.1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>font-awesome</artifactId>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
<version>0.46</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
@ -76,6 +100,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${project.parent.version}</version>
</plugin>
</plugins>
</build>


+ 7
- 8
src/main/java/es/fp/edu/conecta2/modelo2/IbexEntity.java View File

@ -7,6 +7,7 @@ import jakarta.persistence.Table;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.Objects;
@Entity
@Table(name = "ibex", schema = "bolsa", catalog = "")
@ -97,14 +98,12 @@ public class IbexEntity {
IbexEntity that = (IbexEntity) o;
if (volume != that.volume) return false;
if (date != null ? !date.equals(that.date) : that.date != null) return false;
if (open != null ? !open.equals(that.open) : that.open != null) return false;
if (high != null ? !high.equals(that.high) : that.high != null) return false;
if (low != null ? !low.equals(that.low) : that.low != null) return false;
if (close != null ? !close.equals(that.close) : that.close != null) return false;
if (adjClose != null ? !adjClose.equals(that.adjClose) : that.adjClose != null) return false;
return true;
if (!Objects.equals(date, that.date)) return false;
if (!Objects.equals(open, that.open)) return false;
if (!Objects.equals(high, that.high)) return false;
if (!Objects.equals(low, that.low)) return false;
if (!Objects.equals(close, that.close)) return false;
return Objects.equals(adjClose, that.adjClose);
}
@Override


+ 2
- 3
src/main/java/es/fp/edu/conecta2/modelo2/Tabla1Entity.java View File

@ -3,6 +3,7 @@ package es.fp.edu.conecta2.modelo2;
import jakarta.persistence.*;
import java.util.Collection;
import java.util.Objects;
@Entity
@Table(name = "tabla1", schema = "bolsa", catalog = "")
@ -41,9 +42,7 @@ public class Tabla1Entity {
Tabla1Entity that = (Tabla1Entity) o;
if (id != that.id) return false;
if (nombre != null ? !nombre.equals(that.nombre) : that.nombre != null) return false;
return true;
return Objects.equals(nombre, that.nombre);
}
@Override


+ 3
- 3
src/main/java/es/fp/edu/conecta2/modelo2/Tabla2Entity.java View File

@ -2,6 +2,8 @@ package es.fp.edu.conecta2.modelo2;
import jakarta.persistence.*;
import java.util.Objects;
@Entity
@Table(name = "tabla2", schema = "bolsa", catalog = "")
public class Tabla2Entity {
@ -52,9 +54,7 @@ public class Tabla2Entity {
if (id != that.id) return false;
if (tabla1Id != that.tabla1Id) return false;
if (nombre != null ? !nombre.equals(that.nombre) : that.nombre != null) return false;
return true;
return Objects.equals(nombre, that.nombre);
}
@Override


+ 3
- 3
src/main/java/es/fp/edu/conecta2/modelo2/Tabla3Entity.java View File

@ -2,6 +2,8 @@ package es.fp.edu.conecta2.modelo2;
import jakarta.persistence.*;
import java.util.Objects;
@Entity
@Table(name = "tabla3", schema = "bolsa", catalog = "")
public class Tabla3Entity {
@ -37,9 +39,7 @@ public class Tabla3Entity {
Tabla3Entity that = (Tabla3Entity) o;
if (id != that.id) return false;
if (nombre != null ? !nombre.equals(that.nombre) : that.nombre != null) return false;
return true;
return Objects.equals(nombre, that.nombre);
}
@Override


+ 4
- 4
src/main/java/es/fp/edu/conecta2/modelo2/VTabla1Entity.java View File

@ -3,6 +3,8 @@ package es.fp.edu.conecta2.modelo2;
import jakarta.persistence.*;
import org.hibernate.annotations.Immutable;
import java.util.Objects;
@Entity
@Immutable
@Table(name = "v_tabla1", schema = "bolsa", catalog = "")
@ -50,10 +52,8 @@ public class VTabla1Entity {
VTabla1Entity that = (VTabla1Entity) o;
if (id != that.id) return false;
if (nombre != null ? !nombre.equals(that.nombre) : that.nombre != null) return false;
if (genero != null ? !genero.equals(that.genero) : that.genero != null) return false;
return true;
if (!Objects.equals(nombre, that.nombre)) return false;
return Objects.equals(genero, that.genero);
}
@Override


+ 2
- 2
src/main/resources/application.properties View File

@ -1,5 +1,6 @@
server.port=9000
server.port=9001
spring.thymeleaf.cache=false
server.compression.enabled=true
server.http2.enabled=true
@ -20,7 +21,6 @@ persistente.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDBDialec
temporal.datasource.url=jdbc:h2:mem:test
temporal.datasource.username=sa
temporal.datasource.password=
temporal.jpa.show-sql=true


+ 12
- 0
src/main/resources/static/hola.html View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="es"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>

+ 6
- 0
src/main/resources/templates/foot/javascript.html View File

@ -0,0 +1,6 @@
<div th:fragment="javascript">
Pie de página
<script src="webjars/jsquery/jquery.min.js"></script>
<script src="webjars/bootstrap/js/bootstrap.bundle.min.js"></script>
</div>

+ 19
- 0
src/main/resources/templates/head/head.html View File

@ -0,0 +1,19 @@
<head th:fragment="mihead">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title th:text="${titulo}">Título de la página</title>
<meta name="description" content="">
<link href="/webjars/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="/webjars/font-awesome/css/all.css" rel="stylesheet">
</head>
<head th:fragment="otrohead">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title th:text="${titulo}">Título de la página</title>
<meta name="description" content="">
<link href="/webjars/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="/webjars/font-awesome/css/all.css" rel="stylesheet">
</head>

+ 7
- 7
src/main/resources/templates/inicio.html View File

@ -1,11 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html lang="es"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<head th:replace="head/head :: mihead"></head>
<body>
Hola mundo
<img src="img/que-significa-sonar-que-muerde-perro_98.avif">
<footer th:replace="foot/javascript :: javascript"></footer>
</body>
</html>

+ 6
- 6
src/main/resources/templates/opcionales.html View File

@ -1,13 +1,13 @@
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html lang="es"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<head th:replace="head/head :: mihead"></head>
<body>
Parámetros opcionales:
<h1 th:text="${a}">aaaaa</h1>
<h2 th:text="${b}">bbbb</h2>
<h3 th:text="${c}">cccc</h3>
<footer th:replace="foot/javascript :: javascript"></footer>
</body>
</html>

+ 7
- 6
src/main/resources/templates/parametros.html View File

@ -1,13 +1,14 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8" />
</head>
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html lang="es"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<head th:replace="head/head :: mihead"></head>
<body>
Parámetros:
<h1 th:text="${a}">aaaaa</h1>
<h2 th:text="${b}">bbbb</h2>
<h3 th:text="${c}">cccc</h3>
<footer th:replace="foot/javascript :: javascript"></footer>
</body>
</html>

+ 7
- 7
src/main/resources/templates/usuarios.html View File

@ -1,12 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html lang="es"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<head th:replace="head/head :: mihead"></head>
<body>
Listado de usuarios.
<footer th:replace="foot/javascript :: javascript"></footer>
</body>
</html>

Loading…
Cancel
Save