Terminando con las busquedas simples, tambien puedes acceder a contactos de una empresa, empresas de un sector. Tambien cambiamos de checkboxes a un drop down scroll que es mas comodo para usar. Preparamos el menu de administrador para hace cambios a entidaes que tiene la base de datos

master
vicsash 5 months ago
parent 4d8902df1c
commit d638d2321e

@ -100,6 +100,9 @@ public class DatabaseTest {
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
jdbcTemplate.execute("CREATE FULLTEXT INDEX keywords_index ON empresas(keywords,nombre)");
jdbcTemplate.execute("CREATE FULLTEXT INDEX keywords_index ON alumnos(keywords,nombre,apellido,apellido2,dni,nia,correo,correo2,nacionalidad,genero)");
jdbcTemplate.execute("CREATE FULLTEXT INDEX keywords_index ON ofertas(nombre,fecha)");
jdbcTemplate.execute("CREATE FULLTEXT INDEX keywords_index ON sucursales(nombre,localidad,direccion)");
};
}

@ -1,13 +1,10 @@
package com.example.proyectofinal.controllers;
import com.example.proyectofinal.models.empresas.Alumno;
import com.example.proyectofinal.models.empresas.Oferta;
import com.example.proyectofinal.repositories.empresas.AlumnoRepository;
import com.example.proyectofinal.repositories.empresas.OfertaRepository;
import com.example.proyectofinal.models.empresas.*;
import com.example.proyectofinal.repositories.empresas.*;
import jakarta.servlet.http.HttpSession;
import org.springframework.ui.Model;
import com.example.proyectofinal.models.empresas.Empresa;
import com.example.proyectofinal.repositories.empresas.EmpressaRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@ -22,12 +19,19 @@ public class BuscadorController {
@Autowired
private EmpressaRepository empressaRepository;
@Autowired
private AlumnoRepository alumnoRepository;
@Autowired
private OfertaRepository ofertaRepository;
@Autowired
private SectorRepository sectorRepository;
@Autowired
private SucursalRepository sucursalRepository;
@Autowired
private SkillRepository skillRepository;
@Autowired
private ContactoRepository contactoRepository;
@GetMapping
public String buscador(){
@ -35,41 +39,108 @@ public class BuscadorController {
}
@GetMapping("/search")
public String search(@RequestParam String query, @RequestParam(required = false) String optempresa, String optskill, String optalumno, String optoferta, Model model) {
if(optempresa != null){
String[] words = query.split("[,/]|and|or");
Set<Empresa> empresas = new HashSet<>();
for (String word : words) {
empresas.addAll(empressaRepository.getEmpressaByKeywordsOrName("*"+word.trim()+"*"));
public String search(@RequestParam String query, @RequestParam String searchOption, Model model, HttpSession session) {
String[] word = query.split("\\b(y|o)\\b|[,/]");
session.setAttribute("query", query);
session.setAttribute("searchOption", searchOption);
if (searchOption.equals("OptEmpresa")) {
if(word.length == 1 && word[0].equalsIgnoreCase("all") || word[0].equalsIgnoreCase("todas")){
Set<Empresa> empresas = new HashSet<>(empressaRepository.findAll());
model.addAttribute("empresas", empresas);
return "list_empresas";
}
System.out.println("Buscando empresas");
if(word.length == 1){
Set<Empresa> empresas = new HashSet<>(empressaRepository.getEmpressaByKeywordsOrName(word[0]));
model.addAttribute("empresas", empresas);
return "list_empresas";
}else if(word.length == 2){
Set<Empresa> empresas = new HashSet<>(empressaRepository.getEmpressaByKeywordsOrName(word[0]));
empresas.addAll(empressaRepository.getEmpressaByKeywordsOrName(word[1]));
model.addAttribute("empresas", empresas);
return "list_empresas";
}
if(optalumno != null){
// System.out.println("Alumno: TEST TEST TEST");
String[] words = query.split("[,/]|and|or");
Set<Alumno> alumnos = new HashSet<>();
for(String word : words){
alumnos.addAll(alumnoRepository.getAlumnoByKeywordsOrName("*"+word.trim()+"*"));
// System.out.println("Alumno: " + alumnos.toString());
} else if (searchOption.equals("OptAlumno")) {
if (word.length == 1 && word[0].equalsIgnoreCase("all") || word[0].equalsIgnoreCase("todos")) {
Set<Alumno> alumnos = new HashSet<>(alumnoRepository.findAll());
model.addAttribute("alumnos", alumnos);
return "list_alumnos";
}
if (word.length == 1) {
System.out.println("Buscando alumnos");
Set<Alumno> alumnos = new HashSet<>(alumnoRepository.getAlumnoByKeywordsOrName(word[0]));
model.addAttribute("alumnos", alumnos);
return "list_alumnos";
} else if (word.length == 2) {
System.out.println("Buscando alumnos");
Set<Alumno> alumnos = new HashSet<>(alumnoRepository.getAlumnoByKeywordsOrName(word[0]));
alumnos.addAll(alumnoRepository.getAlumnoByKeywordsOrName(word[1]));
model.addAttribute("alumnos", alumnos);
return "list_alumnos";
}
if(optoferta != null){
// System.out.println("Oferta: TEST TEST TEST");
String[] words = query.split("[,/]|and|or");
Set<Oferta> ofertas = new HashSet<>();
for(String word : words){
ofertas.addAll(ofertaRepository.getOfertaByKeywordsOrName("*"+word.trim()+"*"));
// System.out.println("Oferta: " + ofertas.toString());
}else if(searchOption.equals("OptOferta")) {
if (word.length == 1 && word[0].equalsIgnoreCase("all") || word[0].equalsIgnoreCase("todas")) {
Set<Oferta> ofertas = new HashSet<>(ofertaRepository.findAll());
model.addAttribute("ofertas", ofertas);
return "list_ofertas";
}
if (word.length == 1) {
Set<Oferta> ofertas = new HashSet<>(ofertaRepository.getOfertaByKeywordsOrName(word[0]));
model.addAttribute("ofertas", ofertas);
return "list_ofertas";
} else if (word.length == 2) {
Set<Oferta> ofertas = new HashSet<>(ofertaRepository.getOfertaByKeywordsOrName(word[0]));
ofertas.addAll(ofertaRepository.getOfertaByKeywordsOrName(word[1]));
model.addAttribute("ofertas", ofertas);
return "list_ofertas";
}
return "list_alumnos";
} else if (searchOption.equals("OptSector")) {
if (word.length == 1 && word[0].equalsIgnoreCase("all") || word[0].equalsIgnoreCase("todas")) {
Set<Sector> sectores = new HashSet<>(sectorRepository.findAll());
model.addAttribute("sectores", sectores);
return "list_sectores";
} else {
Sector sector = sectorRepository.findByNombre(word[0]);
model.addAttribute("sectores", sector);
return "list_sectores";
}
}else if(searchOption.equals("OptSucursal")) {
if (word.length == 1 && word[0].equalsIgnoreCase("all") || word[0].equalsIgnoreCase("todas")) {
Set<Sucursal> sucursalSet = new HashSet<>(sucursalRepository.findAll());
model.addAttribute("sucursales", sucursalSet);
return "/list/list_sucursales";
} else {
Set<Sucursal> sucursalSet = new HashSet<>(sucursalRepository.getSucursalByKeywordsOrName(word[0]));
model.addAttribute("sucursales", sucursalSet);
return "/list/list_sucursales";
}
}else if(searchOption.equals("OptSkill")){
if (word.length == 1 && word[0].equalsIgnoreCase("all") || word[0].equalsIgnoreCase("todas")) {
Set<Skill> skills = new HashSet<>(skillRepository.findAll());
model.addAttribute("skills", skills);
return "/list/list_skills";
}
}else if(searchOption.equals("OptContactos")){
if (word.length == 1 && word[0].equalsIgnoreCase("all") || word[0].equalsIgnoreCase("todas")) {
Set<Contacto> contactos = new HashSet<>(contactoRepository.findAll());
model.addAttribute("contactos", contactos);
return "/list/list_contactos";
}
}else{
System.out.println("ERROR EN BUSQUEDA DE UNA PALABRA");
return "error";
}
return "error";
}
@GetMapping("/paginaEditar")
public String openNewPage() {
System.out.println("Abriendo pagina de edicion");
return "/admin/edit";
}
}

@ -0,0 +1,28 @@
package com.example.proyectofinal.controllers;
import com.example.proyectofinal.models.empresas.Contacto;
import com.example.proyectofinal.models.empresas.Empresa;
import com.example.proyectofinal.repositories.empresas.ContactoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.HashSet;
import java.util.Set;
@Controller
@RequestMapping("/empresa")
public class EmpressaController {
@Autowired
private ContactoRepository contactoRepository;
@GetMapping("/{id}")
public String getEmpressaBySector(@PathVariable Long id, Model model) {
Set<Contacto> contactoSet = new HashSet<>(contactoRepository.findBySector(id));
model.addAttribute("contactos", contactoSet);
return "/list/specific/list_empresa_contactos";
}
}

@ -0,0 +1,30 @@
package com.example.proyectofinal.controllers;
import com.example.proyectofinal.models.empresas.Empresa;
import com.example.proyectofinal.repositories.empresas.EmpressaRepository;
import com.example.proyectofinal.repositories.empresas.SectorRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.HashSet;
import java.util.Set;
@Controller
@RequestMapping("/sector")
public class SectorController {
@Autowired
private SectorRepository sectorRepository;
@Autowired
private EmpressaRepository empressaRepository;
@GetMapping("/{id}")
public String getEmpressaBySector(@PathVariable Long id, Model model) {
Set<Empresa> empresaSet = new HashSet<>(empressaRepository.findBySector(id));
model.addAttribute("empresas", empresaSet);
return "/list/specific/list_sector_empresas";
}
}

@ -11,7 +11,7 @@ import lombok.NonNull;
@AllArgsConstructor
@NoArgsConstructor
@Data
@Table(name = "Ciclo")
@Table(name = "ciclos")
public class Ciclo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)

@ -11,7 +11,7 @@ import lombok.NonNull;
@AllArgsConstructor
@NoArgsConstructor
@Data
@Table(name = "Contactos")
@Table(name = "contactos")
public class Contacto {
@Id
@ -24,7 +24,7 @@ public class Contacto {
@NonNull
@Column(length = 70)
private String apellido1;
private String apellido;
@Column(length = 70)
private String apellido2;
@ -41,7 +41,7 @@ public class Contacto {
public Contacto(@NonNull String nombre, @NonNull String apellido1, String apellido2, String correo, String telefono, Empresa empresa) {
this.nombre = nombre;
this.apellido1 = apellido1;
this.apellido = apellido1;
this.apellido2 = apellido2;
this.correo = correo;
this.telefono = telefono;
@ -50,7 +50,7 @@ public class Contacto {
public Contacto(@NonNull String nombre, @NonNull String apellido1, String correo, String telefono, Empresa empresa) {
this.nombre = nombre;
this.apellido1 = apellido1;
this.apellido = apellido1;
this.correo = correo;
this.telefono = telefono;
this.empresa = empresa;

@ -37,7 +37,7 @@ public class Empresa {
@Column(length = 2500)
private String keywords;
@ManyToOne(cascade = {CascadeType.PERSIST,CascadeType.MERGE, CascadeType.REMOVE,CascadeType.REFRESH})
@ManyToOne(cascade = {CascadeType.PERSIST,CascadeType.MERGE, CascadeType.REMOVE,CascadeType.REFRESH},fetch = FetchType.LAZY)
@JoinColumn(name = "Sector_id",referencedColumnName = "id")
private Sector sector;

@ -10,7 +10,7 @@ import lombok.NonNull;
@AllArgsConstructor
@NoArgsConstructor
@Data
@Table(name = "Familia")
@Table(name = "familias")
public class Familia {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)

@ -13,7 +13,7 @@ import java.util.Set;
@AllArgsConstructor
@NoArgsConstructor
@Data
@Table(name = "Oferta")
@Table(name = "ofertas")
public class Oferta {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)

@ -10,7 +10,7 @@ import lombok.NonNull;
@AllArgsConstructor
@NoArgsConstructor
@Data
@Table(name = "Sector")
@Table(name = "sectores")
public class Sector {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)

@ -11,7 +11,7 @@ import lombok.NonNull;
@AllArgsConstructor
@NoArgsConstructor
@Data
@Table(name = "Sucursal")
@Table(name = "sucursales")
public class Sucursal {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)

@ -11,6 +11,6 @@ public interface AlumnoRepository extends JpaRepository<Alumno, Long> {
//TODO alter query so in like all the other elemnts are included
@Query(value = "SELECT * FROM alumnos u WHERE MATCH(u.nombre, u.keywords, " +
"u.apellido, u.apellido2, u.correo, u.correo2, u.nacionalidad, u.genero, u.dni, u.nia ) AGAINST(?1 IN BOOLEAN MODE) OR u.nombre LIKE %?1% OR u.keywords LIKE %?1%", nativeQuery = true)
"u.apellido, u.apellido2, u.correo, u.correo2, u.nacionalidad, u.genero, u.dni, u.nia ) AGAINST(?1 IN BOOLEAN MODE)", nativeQuery = true)
public ArrayList<Alumno> getAlumnoByKeywordsOrName(String keyword1);
}

@ -2,6 +2,11 @@ package com.example.proyectofinal.repositories.empresas;
import com.example.proyectofinal.models.empresas.Contacto;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.ArrayList;
public interface ContactoRepository extends JpaRepository<Contacto, Long> {
@Query("SELECT c FROM Contacto c WHERE c.empresa.sector.id = ?1")
ArrayList<Contacto> findBySector(Long id);
}

@ -10,7 +10,10 @@ public interface EmpressaRepository extends JpaRepository<Empresa, Long> {
//there is value = and nativeQuery = true so the query is written in SQL refering to the table in the database
@Query(value = "SELECT * FROM empresas u WHERE MATCH(u.nombre, u.keywords) AGAINST(?1 IN BOOLEAN MODE) OR u.nombre LIKE %?1% OR u.keywords LIKE %?1%", nativeQuery = true)
@Query(value = "SELECT * FROM empresas u WHERE MATCH(u.nombre, u.keywords) AGAINST(?1 IN BOOLEAN MODE)", nativeQuery = true)
public ArrayList<Empresa> getEmpressaByKeywordsOrName(String word);
@Query(value = "SELECT * FROM empresas u WHERE u.sector_id = ?1", nativeQuery = true)
public ArrayList<Empresa> findBySector(Long id);
}

@ -9,6 +9,6 @@ import java.util.ArrayList;
public interface OfertaRepository extends JpaRepository<Oferta, Long> {
@Query(value = "SELECT * FROM ofertas u WHERE MATCH(u.nombre, u.fecha) AGAINST(?1 IN BOOLEAN MODE) OR u.nombre LIKE %?1% OR u.fecha LIKE %?1%", nativeQuery = true)
@Query(value = "SELECT * FROM ofertas u WHERE MATCH(u.nombre, u.fecha) AGAINST(?1 IN BOOLEAN MODE)", nativeQuery = true)
public ArrayList<Oferta> getOfertaByKeywordsOrName(String word);
}

@ -2,6 +2,10 @@ package com.example.proyectofinal.repositories.empresas;
import com.example.proyectofinal.models.empresas.Sector;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
public interface SectorRepository extends JpaRepository<Sector, Long> {
@Query("SELECT s FROM Sector s WHERE s.nombre = ?1")
Sector findByNombre(String nombre);
}

@ -1,7 +1,15 @@
package com.example.proyectofinal.repositories.empresas;
import com.example.proyectofinal.models.empresas.Empresa;
import com.example.proyectofinal.models.empresas.Sucursal;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.ArrayList;
public interface SucursalRepository extends JpaRepository<Sucursal, Long> {
//there is value = and nativeQuery = true so the query is written in SQL refering to the table in the database
@Query(value = "SELECT * FROM sucursales u WHERE MATCH(u.nombre, u.localidad,u.direccion) AGAINST(?1 IN BOOLEAN MODE)", nativeQuery = true)
public ArrayList<Sucursal> getSucursalByKeywordsOrName(String word);
}

@ -0,0 +1,53 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>EDITOR DE INFORMACIÓN</title>
<style>
.back-button {
width: 200px; /* Adjust as needed */
height: 50px; /* Adjust as needed */
font-size: 20px; /* Adjust as needed */
background-color: blue;
color: white;
text-decoration: none;
border-radius: 5px;
justify-content: center; /* Add this line */
align-items: center; /* Add this line */
}
.grid-container {
display: grid;
grid-template-columns: repeat(3,100px);
grid-gap: 2px; /* Reduced from 5px to 2px */
justify-content: center;
align-items: center;
height: 50vh;
}
a {
display: flex;
justify-content: center;
align-items: center;
font-size: 20px;
background-color: #f0f0f0;
border: 1px solid black;
text-decoration: none;
}
</style>
</head>
<body>
<div class="grid-container">
<a>Empresa</a>
<a>Alumno</a>
<a>Oferta</a>
<a>Sector</a>
<a>Sucursal</a>
<a>Skill</a>
<a>Contactos</a>
<a>Ciclo</a>
<a>Familia</a>
</div>
<a href="/buscador" class="back-button">Atras</a>
</body>
</html>

@ -29,14 +29,25 @@
margin-right: 10px;
font-size: 18px;
}
.checkboxes {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width: 50%;
select {
width: 100%;
padding: 15px;
font-size: 18px;
margin-top: 20px;
}
.edit-button {
width: 200px; /* Adjust as needed */
height: 50px; /* Adjust as needed */
font-size: 20px; /* Adjust as needed */
background-color: blue;
color: white;
text-decoration: none;
border-radius: 5px;
display: flex; /* Add this line */
justify-content: center; /* Add this line */
align-items: center; /* Add this line */
margin-top: 40px; /* Increase the distance between the button and the select element */
}
</style>
</head>
<body>
@ -45,19 +56,20 @@
<input type="text" name="query" placeholder="Buscar...">
<input type="submit" value="Buscar">
</div>
<div class="checkboxes">
<input type="checkbox" id="optionEmpresa" name="optempresa" value="OptEmpresa">
<label for="optionEmpresa"> Empresa por nombre y/o keywords</label><br>
<input type="checkbox" id="optionEmpresaPorSector" name="optempporsector" value="optionEmpresaPorSector">
<label for="optionEmpresaPorSector"> Empresa por Sector</label><br>
<input type="checkbox" id="optionAlumno" name="optalumno" value="OptAlumno">
<label for="optionAlumno">Alumno</label><br>
<input type="checkbox" id="optionOferta" name="optoferta" value="OptOferta">
<label for="optionOferta"> Oferta</label><br>
<input type="checkbox" id="optionSkill" name="optskill" value="OptSkill" disabled>
<label for="optionSkill"> Skill</label><br>
</div>
<select name="searchOption">
<option value="OptEmpresa">Empresa por nombre y/o keywords</option>
<option value="OptSector">Sector</option>
<option value="OptAlumno">Alumno</option>
<option value="OptOferta">Oferta</option>
<option value="OptSucursal">Sucursal</option>
<option value="OptSkill">Skill</option>
<option value="OptContactos">Contactos</option>
</select>
<a th:href="@{/buscador/paginaEditar}" class="edit-button">
EDITAR
</a>
</form>
<script>
window.onload = function() {
document.querySelector('form').reset();

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ERROR</title>
</head>
<body>
</body>
</html>

@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<meta charset="UTF-8">
<title>Title</title>
<style>
.empresa-cell {
max-height: 10px;
overflow-y: auto;
}
.cell{
height: 10px;
}
h1 {
text-align: center;
}
.back-button {
position: fixed;
bottom: 10px;
left: 10px;
padding: 10px 20px;
background-color: #007BFF;
color: white;
text-decoration: none;
border-radius: 5px;
}
.table {
border: 1px solid black;
height: 75vh; /* Default height */
max-height: 100vh; /* Maximum height */
overflow-y: auto; /* Enable vertical scrolling */
}
</style>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
<h1>Listado de Alumnos</h1>
<div class="table">
<table class ="table table-hover table-responsive-xl">
<thead class="thread-light">
<tr>
<th>Id</th>
<th>Nombre</th>
<th>Apellido 1</th>
<th>Apellido 2</th>
<th>Correo</th>
<th>Telefono</th>
<th>Empressa</th>
</tr>
</thead>
<tbody>
<tr class="cell" th:each="contacto :${contactos}">
<td>[[${contacto.id}]]</td>
<td>[[${contacto.nombre}]]</td>
<td>[[${contacto.apellido}]]</td>
<td>[[${contacto.apellido2}]]</td>
<td>[[${contacto.correo}]]</td>
<td>[[${contacto.telefono}]]</td>
<td>[[${contacto.empresa.nombre}]]</td>
</tr>
</tbody>
</table>
</div>
<a href="/buscador" class="back-button">Back to Buscador</a>
</body>
</html>

@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<meta charset="UTF-8">
<title>Title</title>
<style>
.empresa-cell {
max-height: 10px;
overflow-y: auto;
}
.cell{
height: 10px;
}
h1 {
text-align: center;
}
.back-button {
position: fixed;
bottom: 10px;
left: 10px;
padding: 10px 20px;
background-color: #007BFF;
color: white;
text-decoration: none;
border-radius: 5px;
}
.table {
border: 1px solid black;
height: 75vh; /* Default height */
max-height: 100vh; /* Maximum height */
overflow-y: auto; /* Enable vertical scrolling */
}
</style>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
<h1>Listado de Skills</h1>
<div class="table">
<table class ="table table-hover table-responsive-xl">
<thead class="thread-light">
<tr>
<th>Id</th>
<th>Nombre</th>
</tr>
</thead>
<tbody>
<tr class="cell" th:each="skill :${skills}">
<td>[[${skill.id}]]</td>
<td>[[${skill.nombre}]]</td>
</tr>
</tbody>
</table>
</div>
<a href="/buscador" class="back-button">Atras</a>
</body>
</html>

@ -0,0 +1,67 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<meta charset="UTF-8">
<title>Title</title>
<style>
.empresa-cell {
max-height: 10px;
overflow-y: auto;
}
.cell{
height: 10px;
}
h1 {
text-align: center;
}
.back-button {
position: fixed;
bottom: 10px;
left: 10px;
padding: 10px 20px;
background-color: #007BFF;
color: white;
text-decoration: none;
border-radius: 5px;
}
.table {
border: 1px solid black;
height: 75vh; /* Default height */
max-height: 100vh; /* Maximum height */
overflow-y: auto; /* Enable vertical scrolling */
}
</style>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
<h1>Listado de Sucursales</h1>
<div class="table">
<table class ="table table-hover table-responsive-xl">
<thead class="thread-light">
<tr>
<th>Id</th>
<th>Nombre</th>
<th>Localidad</th>
<th>Dirección</th>
<th>SedeCentral</th>
<th>Empressa</th>
</tr>
</thead>
<tbody>
<tr class="cell" th:each="sucursal :${sucursales}">
<td>[[${sucursal.id}]]</td>
<td>[[${sucursal.nombre}]]</td>
<td>[[${sucursal.localidad}]]</td>
<td>[[${sucursal.direccion}]]</td>
<td>[[${sucursal.sedeCentral}]]</td>
<td>[[${sucursal.empresa.nombre}]]</td>
</tr>
</tbody>
</table>
</div>
<a href="/buscador" class="back-button">Atras</a>
</body>
</html>

@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<meta charset="UTF-8">
<title>Title</title>
<style>
.empresa-cell {
max-height: 10px;
overflow-y: auto;
}
.cell{
height: 10px;
}
h1 {
text-align: center;
}
.back-button {
position: fixed;
bottom: 10px;
left: 10px;
padding: 10px 20px;
background-color: #007BFF;
color: white;
text-decoration: none;
border-radius: 5px;
}
.table {
border: 1px solid black;
height: 75vh; /* Default height */
max-height: 100vh; /* Maximum height */
overflow-y: auto; /* Enable vertical scrolling */
}
</style>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
<h1>Listado de Contactos</h1>
<div class="table">
<table class ="table table-hover table-responsive-xl">
<thead class="thread-light">
<tr>
<th>Id</th>
<th>Nombre</th>
<th>Apellido 1</th>
<th>Apellido 2</th>
<th>Correo</th>
<th>Telefono</th>
<th>Empressa</th>
</tr>
</thead>
<tbody>
<tr class="cell" th:each="contacto :${contactos}">
<td>[[${contacto.id}]]</td>
<td>[[${contacto.nombre}]]</td>
<td>[[${contacto.apellido}]]</td>
<td>[[${contacto.apellido2}]]</td>
<td>[[${contacto.correo}]]</td>
<td>[[${contacto.telefono}]]</td>
<td>[[${contacto.empresa.nombre}]]</td>
</tr>
</tbody>
</table>
</div>
<a th:href="@{/buscador/search(query=${session.query}, searchOption=${session.searchOption})}" class="back-button">Atras a empressas</a>
</body>
</html>

@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<meta charset="UTF-8">
<title>Title</title>
<style>
.empresa-cell {
max-height: 10px;
overflow-y: auto;
}
.cell{
height: 10px;
}
h1 {
text-align: center;
}
.back-button {
position: fixed;
bottom: 10px;
left: 10px;
padding: 10px 20px;
background-color: #007BFF;
color: white;
text-decoration: none;
border-radius: 5px;
}
.table {
border: 1px solid black;
height: 75vh; /* Default height */
max-height: 100vh; /* Maximum height */
overflow-y: auto; /* Enable vertical scrolling */
}
</style>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
<h1>Listado de Empresas</h1>
<div class="table">
<table class ="table table-hover table-responsive-xl">
<thead class="thread-light">
<tr>
<th>Id</th>
<th>Nombre</th>
<th>Cif</th>
<th>Correo</th>
<th>Telefono</th>
<th class="keywords-cell">Keywords</th>
<th>Sector</th>
</tr>
</thead>
<tbody>
<tr class="cell" th:each="empresa :${empresas}">
<td>[[${empresa.id}]]</td>
<td>[[${empresa.nombre}]]</td>
<td>[[${empresa.cif}]]</td>
<td>[[${empresa.correo}]]</td>
<td>[[${empresa.telefono}]]</td>
<td class="keywords-cell">
<div th:each="keyword : ${#strings.arraySplit(empresa.keywords, ',')}">[[${keyword}]]</div>
</td>
<td>[[${empresa.sector.nombre}]]</td>
</tr>
</tbody>
</table>
</div>
<a th:href="@{/buscador/search(query=${session.query}, searchOption=${session.searchOption})}" class="back-button">Atras a sectores</a>
</body>
</html>

@ -5,7 +5,7 @@
<meta charset="UTF-8">
<title>Title</title>
<style>
.keywords-cell {
.empresa-cell {
max-height: 10px;
overflow-y: auto;
}

@ -5,7 +5,7 @@
<meta charset="UTF-8">
<title>Title</title>
<style>
.keywords-cell {
.empresa-cell {
max-height: 10px;
overflow-y: auto;
}
@ -53,7 +53,7 @@
<tbody>
<tr class="cell" th:each="empresa :${empresas}">
<td>[[${empresa.id}]]</td>
<td>[[${empresa.nombre}]]</td>
<td><a th:href="@{/empresa/{id}(id=${empresa.id})}">[[${empresa.nombre}]]</a></td>
<td>[[${empresa.cif}]]</td>
<td>[[${empresa.correo}]]</td>
<td>[[${empresa.telefono}]]</td>

@ -5,7 +5,7 @@
<meta charset="UTF-8">
<title>Title</title>
<style>
.keywords-cell {
.empresa-cell {
max-height: 10px;
overflow-y: auto;
}
@ -48,7 +48,7 @@
</tr>
</thead>
<tbody>
<tr class="cell" th:each="empresa :${empresas}">
<tr class="cell" th:each="oferta :${ofertas}">
<td>[[${oferta.id}]]</td>
<td>[[${oferta.nombre}]]</td>
<td>[[${oferta.descripcion}]]</td>

@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<meta charset="UTF-8">
<title>Title</title>
<style>
.empresa-cell {
max-height: 10px;
overflow-y: auto;
}
.cell{
height: 10px;
}
h1 {
text-align: center;
}
.back-button {
position: fixed;
bottom: 10px;
left: 10px;
padding: 10px 20px;
background-color: #007BFF;
color: white;
text-decoration: none;
border-radius: 5px;
}
.table {
border: 1px solid black;
height: 75vh; /* Default height */
max-height: 100vh; /* Maximum height */
overflow-y: auto; /* Enable vertical scrolling */
}
</style>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
<h1>Listado de Ofertas</h1>
<div class="table">
<table class ="table table-hover table-responsive-xl">
<thead class="thread-light">
<tr>
<th>Id</th>
<th>Nombre</th>
</tr>
</thead>
<tbody>
<tr class="cell" th:each="sector :${sectores}">
<td>[[${sector.id}]]</td>
<td><a th:href="@{/sector/{id}(id=${sector.id})}">[[${sector.nombre}]]</a></td>
</tr>
</tbody>
</table>
</div>
<a href="/buscador" class="back-button">Back to Buscador</a>
</body>
</html>
Loading…
Cancel
Save

Powered by INFORMATICA.FP.EDU.ES.