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 jdbcTemplate = new JdbcTemplate(dataSource);
jdbcTemplate.execute("CREATE FULLTEXT INDEX keywords_index ON empresas(keywords,nombre)"); 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 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; package com.example.proyectofinal.controllers;
import com.example.proyectofinal.models.empresas.Alumno; import com.example.proyectofinal.models.empresas.*;
import com.example.proyectofinal.models.empresas.Oferta; import com.example.proyectofinal.repositories.empresas.*;
import com.example.proyectofinal.repositories.empresas.AlumnoRepository; import jakarta.servlet.http.HttpSession;
import com.example.proyectofinal.repositories.empresas.OfertaRepository;
import org.springframework.ui.Model; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -22,12 +19,19 @@ public class BuscadorController {
@Autowired @Autowired
private EmpressaRepository empressaRepository; private EmpressaRepository empressaRepository;
@Autowired @Autowired
private AlumnoRepository alumnoRepository; private AlumnoRepository alumnoRepository;
@Autowired @Autowired
private OfertaRepository ofertaRepository; private OfertaRepository ofertaRepository;
@Autowired
private SectorRepository sectorRepository;
@Autowired
private SucursalRepository sucursalRepository;
@Autowired
private SkillRepository skillRepository;
@Autowired
private ContactoRepository contactoRepository;
@GetMapping @GetMapping
public String buscador(){ public String buscador(){
@ -35,41 +39,108 @@ public class BuscadorController {
} }
@GetMapping("/search") @GetMapping("/search")
public String search(@RequestParam String query, @RequestParam(required = false) String optempresa, String optskill, String optalumno, String optoferta, Model model) { public String search(@RequestParam String query, @RequestParam String searchOption, Model model, HttpSession session) {
if(optempresa != null){ String[] word = query.split("\\b(y|o)\\b|[,/]");
String[] words = query.split("[,/]|and|or"); session.setAttribute("query", query);
Set<Empresa> empresas = new HashSet<>(); session.setAttribute("searchOption", searchOption);
if (searchOption.equals("OptEmpresa")) {
for (String word : words) { if(word.length == 1 && word[0].equalsIgnoreCase("all") || word[0].equalsIgnoreCase("todas")){
empresas.addAll(empressaRepository.getEmpressaByKeywordsOrName("*"+word.trim()+"*")); Set<Empresa> empresas = new HashSet<>(empressaRepository.findAll());
model.addAttribute("empresas", empresas);
return "list_empresas";
} }
model.addAttribute("empresas", empresas); System.out.println("Buscando empresas");
} if(word.length == 1){
if(optalumno != null){ Set<Empresa> empresas = new HashSet<>(empressaRepository.getEmpressaByKeywordsOrName(word[0]));
// System.out.println("Alumno: TEST TEST TEST"); model.addAttribute("empresas", empresas);
String[] words = query.split("[,/]|and|or"); return "list_empresas";
Set<Alumno> alumnos = new HashSet<>(); }else if(word.length == 2){
Set<Empresa> empresas = new HashSet<>(empressaRepository.getEmpressaByKeywordsOrName(word[0]));
for(String word : words){ empresas.addAll(empressaRepository.getEmpressaByKeywordsOrName(word[1]));
alumnos.addAll(alumnoRepository.getAlumnoByKeywordsOrName("*"+word.trim()+"*")); model.addAttribute("empresas", empresas);
// System.out.println("Alumno: " + alumnos.toString()); return "list_empresas";
}
} 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";
}
}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";
} }
model.addAttribute("alumnos", alumnos); 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";
}
} 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";
}
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());
}
model.addAttribute("ofertas", ofertas);
}
return "list_alumnos";
}
} }

@ -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 @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Data @Data
@Table(name = "Ciclo") @Table(name = "ciclos")
public class Ciclo { public class Ciclo {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)

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

@ -37,7 +37,7 @@ public class Empresa {
@Column(length = 2500) @Column(length = 2500)
private String keywords; 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") @JoinColumn(name = "Sector_id",referencedColumnName = "id")
private Sector sector; private Sector sector;

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

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

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

@ -11,7 +11,7 @@ import lombok.NonNull;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Data @Data
@Table(name = "Sucursal") @Table(name = "sucursales")
public class Sucursal { public class Sucursal {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @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 //TODO alter query so in like all the other elemnts are included
@Query(value = "SELECT * FROM alumnos u WHERE MATCH(u.nombre, u.keywords, " + @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); public ArrayList<Alumno> getAlumnoByKeywordsOrName(String keyword1);
} }

@ -2,6 +2,11 @@ package com.example.proyectofinal.repositories.empresas;
import com.example.proyectofinal.models.empresas.Contacto; import com.example.proyectofinal.models.empresas.Contacto;
import org.springframework.data.jpa.repository.JpaRepository; 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> { 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 //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); 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> { 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); public ArrayList<Oferta> getOfertaByKeywordsOrName(String word);
} }

@ -2,6 +2,10 @@ package com.example.proyectofinal.repositories.empresas;
import com.example.proyectofinal.models.empresas.Sector; import com.example.proyectofinal.models.empresas.Sector;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
public interface SectorRepository extends JpaRepository<Sector, Long> { 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; package com.example.proyectofinal.repositories.empresas;
import com.example.proyectofinal.models.empresas.Empresa;
import com.example.proyectofinal.models.empresas.Sucursal; import com.example.proyectofinal.models.empresas.Sucursal;
import org.springframework.data.jpa.repository.JpaRepository; 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> { 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; margin-right: 10px;
font-size: 18px; font-size: 18px;
} }
.checkboxes { select {
display: flex; width: 100%;
flex-direction: row; padding: 15px;
justify-content: space-between; font-size: 18px;
align-items: center;
width: 50%;
margin-top: 20px; 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> </style>
</head> </head>
<body> <body>
@ -45,19 +56,20 @@
<input type="text" name="query" placeholder="Buscar..."> <input type="text" name="query" placeholder="Buscar...">
<input type="submit" value="Buscar"> <input type="submit" value="Buscar">
</div> </div>
<div class="checkboxes"> <select name="searchOption">
<input type="checkbox" id="optionEmpresa" name="optempresa" value="OptEmpresa"> <option value="OptEmpresa">Empresa por nombre y/o keywords</option>
<label for="optionEmpresa"> Empresa por nombre y/o keywords</label><br> <option value="OptSector">Sector</option>
<input type="checkbox" id="optionEmpresaPorSector" name="optempporsector" value="optionEmpresaPorSector"> <option value="OptAlumno">Alumno</option>
<label for="optionEmpresaPorSector"> Empresa por Sector</label><br> <option value="OptOferta">Oferta</option>
<input type="checkbox" id="optionAlumno" name="optalumno" value="OptAlumno"> <option value="OptSucursal">Sucursal</option>
<label for="optionAlumno">Alumno</label><br> <option value="OptSkill">Skill</option>
<input type="checkbox" id="optionOferta" name="optoferta" value="OptOferta"> <option value="OptContactos">Contactos</option>
<label for="optionOferta"> Oferta</label><br> </select>
<input type="checkbox" id="optionSkill" name="optskill" value="OptSkill" disabled> <a th:href="@{/buscador/paginaEditar}" class="edit-button">
<label for="optionSkill"> Skill</label><br> EDITAR
</div> </a>
</form> </form>
<script> <script>
window.onload = function() { window.onload = function() {
document.querySelector('form').reset(); 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"> <meta charset="UTF-8">
<title>Title</title> <title>Title</title>
<style> <style>
.keywords-cell { .empresa-cell {
max-height: 10px; max-height: 10px;
overflow-y: auto; overflow-y: auto;
} }

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

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