diff --git a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java index d63bba8..bbb6c96 100644 --- a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java +++ b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java @@ -23,7 +23,7 @@ import com.roshka.repositorio.ExperienciaRepository; import com.roshka.repositorio.InstitucionRepository; import com.roshka.repositorio.PostulanteRepository; import com.roshka.repositorio.TecnologiaRepository; - +import com.roshka.utils.Helper; import org.hibernate.jpa.TypedParameterValue; import org.hibernate.type.IntegerType; @@ -95,30 +95,7 @@ public class PostulanteController { return "postulante-form"; } - private DBFile createFile(MultipartFile file) { - // Normalize file name - String fileName = StringUtils.cleanPath(file.getOriginalFilename()); - - try { - // Check if the file's name contains invalid characters - if(fileName.contains("..")) { - throw new Exception("Sorry! Filename contains invalid path sequence " + fileName); - } - if(file.getSize()==0) throw new Exception("Sorry! File cant be void");; - - DBFile dbFile = new DBFile(fileName, file.getContentType(), file.getBytes()); - - return dbFile; - } catch (IOException ex) { - ex.printStackTrace(); - return null; - } - catch(Exception ex){ - ex.printStackTrace(); - return null; - } - } - + @PostMapping(value = "/work-with-us",consumes = "multipart/form-data") public RedirectView guardarPostulante(@RequestPart(name = "file",required = false) MultipartFile file,@RequestPart("postulante") Postulante postulante, RedirectAttributes redirectAttributes){ //Codigo encargado de modificar postulacion si se envia mismo CI @@ -138,7 +115,7 @@ public class PostulanteController { } if(file!=null){ - DBFile cv = createFile(file); + DBFile cv = Helper.createFile(file); if(cv!=null) cv.setPostulante(postulante); postulante.setCvFile(cv); } diff --git a/curriculumsearch/src/main/java/com/roshka/utils/Helper.java b/curriculumsearch/src/main/java/com/roshka/utils/Helper.java index 78f3197..0c3ae5e 100644 --- a/curriculumsearch/src/main/java/com/roshka/utils/Helper.java +++ b/curriculumsearch/src/main/java/com/roshka/utils/Helper.java @@ -1,5 +1,6 @@ package com.roshka.utils; +import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.YearMonth; @@ -7,6 +8,11 @@ import java.time.ZoneOffset; import java.time.temporal.ChronoUnit; import java.util.Date; +import com.roshka.modelo.DBFile; + +import org.springframework.util.StringUtils; +import org.springframework.web.multipart.MultipartFile; + public class Helper { /** * Se espera fecha en el formato yyyy-MM-dd @@ -31,4 +37,29 @@ public class Helper { return m1.until(m2, ChronoUnit.MONTHS) + 1; } + + public static DBFile createFile(MultipartFile file) { + // Normalize file name + String fileName = StringUtils.cleanPath(file.getOriginalFilename()); + + try { + // Check if the file's name contains invalid characters + if(fileName.contains("..")) { + throw new Exception("Sorry! Filename contains invalid path sequence " + fileName); + } + if(file.getSize()==0) throw new Exception("Sorry! File cant be void");; + + DBFile dbFile = new DBFile(fileName, file.getContentType(), file.getBytes()); + + return dbFile; + } catch (IOException ex) { + ex.printStackTrace(); + return null; + } + catch(Exception ex){ + ex.printStackTrace(); + return null; + } + } + } diff --git a/curriculumsearch/src/main/resources/static/main.js b/curriculumsearch/src/main/resources/static/main.js index f2bb020..8f1e033 100644 --- a/curriculumsearch/src/main/resources/static/main.js +++ b/curriculumsearch/src/main/resources/static/main.js @@ -266,7 +266,7 @@ function agregarFieldExpierncia(event){ const exp = experiencias[index]; if(exp==null) continue; content += ` -
+

Experiencia

Institucion
@@ -379,7 +379,7 @@ function agregarFieldEstudio(){ const est = estudios[index]; if(est==null) continue; content += ` -
+

Estudio

Institucion
@@ -473,7 +473,7 @@ function agregarFieldCargo(){ if(car==null) continue; content1 += `
- ${document.querySelector('[name=cargo-id] > option[value="'+car.id+'"]').innerHTML} + ${document.querySelector('[name=cargo-id] > option[value="'+car.id+'"]').innerHTML}  
@@ -546,7 +546,7 @@ function agregarFieldReferencia(event){ const exp = referencias[index]; if(exp==null) continue; content += ` -
+

Referencia Personal

Nombre
diff --git a/curriculumsearch/src/main/webapp/css/formPostulanteStyle.css b/curriculumsearch/src/main/webapp/css/formPostulanteStyle.css index c34346d..998ff19 100644 --- a/curriculumsearch/src/main/webapp/css/formPostulanteStyle.css +++ b/curriculumsearch/src/main/webapp/css/formPostulanteStyle.css @@ -15,7 +15,7 @@ body { border-radius:4px; transform:translate(-50%,10%);*/ - box-shadow:3px 3px 4px rgba(175, 209, 20, 0.2)} + } .card { border: none } diff --git a/curriculumsearch/src/main/webapp/img/LogoRoshka.jpg b/curriculumsearch/src/main/webapp/img/LogoRoshka.ico similarity index 100% rename from curriculumsearch/src/main/webapp/img/LogoRoshka.jpg rename to curriculumsearch/src/main/webapp/img/LogoRoshka.ico Binary files a/curriculumsearch/src/main/webapp/img/LogoRoshka.jpg and b/curriculumsearch/src/main/webapp/img/LogoRoshka.ico differ diff --git a/curriculumsearch/src/main/webapp/jsp/convocatoria-form.jsp b/curriculumsearch/src/main/webapp/jsp/convocatoria-form.jsp index fa866ef..8fbd0ff 100644 --- a/curriculumsearch/src/main/webapp/jsp/convocatoria-form.jsp +++ b/curriculumsearch/src/main/webapp/jsp/convocatoria-form.jsp @@ -40,6 +40,6 @@
- + diff --git a/curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp b/curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp index 8f031a5..9ad938f 100644 --- a/curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp +++ b/curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp @@ -4,6 +4,7 @@ <%@ taglib uri="http://kwonnam.pe.kr/jsp/template-inheritance" prefix="layout"%> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +

@@ -372,11 +373,8 @@

- - - - + diff --git a/curriculumsearch/src/main/webapp/jsp/exitoRegistro.jsp b/curriculumsearch/src/main/webapp/jsp/exitoRegistro.jsp index f462dbf..22d442c 100644 --- a/curriculumsearch/src/main/webapp/jsp/exitoRegistro.jsp +++ b/curriculumsearch/src/main/webapp/jsp/exitoRegistro.jsp @@ -4,6 +4,7 @@ +