Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
th-app-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oscar Enrique Gonzalez Escurra
th-app-java
Commits
13b70dce
Commit
13b70dce
authored
Nov 02, 2021
by
Cesar Giulano Gonzalez Maqueda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'joel-001' of
https://phoebe.roshka.com/gitlab/hshah/TalentoHumano
into giuli_001
parents
d4d963a8
c253c4b5
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
102 additions
and
94 deletions
+102
-94
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
+0
-4
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
+5
-0
curriculumsearch/src/main/java/com/roshka/modelo/EstudioReconocimiento.java
+3
-0
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
+25
-1
curriculumsearch/src/main/java/com/roshka/modelo/ExperienciaReconocimiento.java
+19
-7
curriculumsearch/src/main/java/com/roshka/modelo/ExperienciaTecnologia.java
+0
-64
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
+7
-1
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
+3
-0
curriculumsearch/src/main/java/com/roshka/repositorio/ExperienciaTecnologiaRepository.java
+0
-10
curriculumsearch/src/main/resources/static/main.js
+11
-3
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+29
-4
No files found.
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
View file @
13b70dce
...
...
@@ -38,10 +38,6 @@ public class PostulanteController {
@PostMapping
(
value
=
"/postulante"
,
consumes
=
"application/json"
)
public
String
guardarPostulante
(
@RequestBody
Postulante
postulante
){
post
.
save
(
postulante
);
for
(
Experiencia
exp:
postulante
.
getExperiencias
()){
exp
.
setPostulante
(
postulante
);
}
post
.
save
(
postulante
);
return
"redirect:/"
;
}
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
View file @
13b70dce
...
...
@@ -12,6 +12,9 @@ import javax.persistence.JoinColumn;
import
javax.persistence.ManyToOne
;
import
javax.persistence.OneToMany
;
import
javax.persistence.Table
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
@Entity
@Table
(
name
=
"estudio"
)
public
class
Estudio
{
...
...
@@ -34,8 +37,10 @@ public class Estudio {
@ManyToOne
@JoinColumn
@JsonBackReference
private
Postulante
postulante
;
@JsonManagedReference
@OneToMany
(
mappedBy
=
"estudio"
)
private
List
<
EstudioReconocimiento
>
estudioReconocimiento
;
...
...
curriculumsearch/src/main/java/com/roshka/modelo/EstudioReconocimiento.java
View file @
13b70dce
...
...
@@ -10,6 +10,8 @@ import javax.persistence.JoinColumn;
import
javax.persistence.ManyToOne
;
import
javax.persistence.Table
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
@Entity
@Table
(
name
=
"estudio_reconocimiento"
)
public
class
EstudioReconocimiento
{
...
...
@@ -21,6 +23,7 @@ public class EstudioReconocimiento {
private
String
nombre
;
@Column
(
name
=
"certificado"
)
private
String
certificado
;
@JsonBackReference
@ManyToOne
@JoinColumn
private
Estudio
estudio
;
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
View file @
13b70dce
...
...
@@ -3,11 +3,16 @@ package com.roshka.modelo;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
import
javax.persistence.*
;
@Entity
...
...
@@ -26,10 +31,17 @@ public class Experiencia {
private
String
referencias
;
@Column
(
name
=
"cargo"
)
private
String
cargo
;
@ManyToOne
@Column
(
name
=
"descripcion"
)
private
String
descripcion
;
@JsonBackReference
@ManyToOne
(
optional
=
false
)
@JoinColumn
private
Postulante
postulante
;
@JsonManagedReference
@OneToMany
(
mappedBy
=
"experiencia"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
ExperienciaReconocimiento
>
reconocimientos
;
public
long
getId
()
{
return
id
;
}
...
...
@@ -92,4 +104,16 @@ public class Experiencia {
public
Postulante
getPostulante
()
{
return
postulante
;
}
public
String
getDescripcion
()
{
return
descripcion
;
}
public
void
setDescripcion
(
String
descripcion
)
{
this
.
descripcion
=
descripcion
;
}
public
void
setReconocimientos
(
List
<
ExperienciaReconocimiento
>
reconocimientos
)
{
this
.
reconocimientos
=
reconocimientos
;
}
public
List
<
ExperienciaReconocimiento
>
getReconocimientos
()
{
return
reconocimientos
;
}
}
curriculumsearch/src/main/java/com/roshka/modelo/ExperienciaReconocimiento.java
View file @
13b70dce
...
...
@@ -2,6 +2,8 @@ package com.roshka.modelo;
import
javax.persistence.*
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
@Entity
@Table
(
name
=
"experiencia_reconocimiento"
)
public
class
ExperienciaReconocimiento
{
...
...
@@ -10,12 +12,16 @@ public class ExperienciaReconocimiento {
@Column
(
name
=
"id"
)
private
long
id
;
@ManyToOne
@ManyToOne
(
optional
=
false
)
@JoinColumn
@JsonBackReference
private
Experiencia
experiencia
;
@Column
(
name
=
"nivel"
)
private
long
nivel
;
@Column
(
name
=
"nombre"
)
private
String
nombre
;
@Column
(
name
=
"certificado"
)
private
String
certificado
;
public
long
getId
()
{
return
id
;
...
...
@@ -29,10 +35,16 @@ public class ExperienciaReconocimiento {
public
void
setExperiencia
(
Experiencia
experiencia
)
{
this
.
experiencia
=
experiencia
;
}
public
long
getNivel
()
{
return
nivel
;
public
String
getCertificado
()
{
return
certificado
;
}
public
String
getNombre
()
{
return
nombre
;
}
public
void
setCertificado
(
String
certificado
)
{
this
.
certificado
=
certificado
;
}
public
void
setN
ivel
(
long
nivel
)
{
this
.
n
ivel
=
nivel
;
public
void
setN
ombre
(
String
nombre
)
{
this
.
n
ombre
=
nombre
;
}
}
curriculumsearch/src/main/java/com/roshka/modelo/ExperienciaTecnologia.java
deleted
100644 → 0
View file @
d4d963a8
package
com
.
roshka
.
modelo
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.Table
;
@Entity
@Table
(
name
=
"experiencia_tecnologia"
)
public
class
ExperienciaTecnologia
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@Column
(
name
=
"id"
)
private
Long
id
;
@ManyToOne
@JoinColumn
private
Experiencia
experencia
;
@ManyToOne
@JoinColumn
private
Tecnologia
tecnologia
;
@Column
(
name
=
"nivel"
)
private
Long
nivel
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Experiencia
getExperencia
()
{
return
experencia
;
}
public
void
setExperencia
(
Experiencia
experencia
)
{
this
.
experencia
=
experencia
;
}
public
Tecnologia
getTecnologia
()
{
return
tecnologia
;
}
public
void
setTecnologia
(
Tecnologia
tecnologia
)
{
this
.
tecnologia
=
tecnologia
;
}
public
Long
getNivel
()
{
return
nivel
;
}
public
void
setNivel
(
Long
nivel
)
{
this
.
nivel
=
nivel
;
}
}
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
View file @
13b70dce
...
...
@@ -3,8 +3,11 @@ package com.roshka.modelo;
import
javax.persistence.*
;
import
javax.validation.constraints.*
;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -69,12 +72,15 @@ public class Postulante {
@Column
(
name
=
"disponibilidad"
)
private
String
disponibilidad
;
@JsonManagedReference
@OneToMany
(
mappedBy
=
"postulante"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
PostulanteTecnologia
>
tecnologias
;
@JsonManagedReference
@OneToMany
(
mappedBy
=
"postulante"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
Experiencia
>
experiencias
;
private
List
<
Experiencia
>
experiencias
=
new
ArrayList
<>()
;
@JsonManagedReference
@OneToMany
(
mappedBy
=
"postulante"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
Estudio
>
estudios
;
...
...
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
View file @
13b70dce
...
...
@@ -8,6 +8,8 @@ import javax.persistence.Id;
import
javax.persistence.JoinColumn
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.Table
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
@Entity
@Table
(
name
=
"postulante_tecnologia"
)
...
...
@@ -23,6 +25,7 @@ public class PostulanteTecnologia {
private
Tecnologia
tecnologia
;
@ManyToOne
()
@JoinColumn
@JsonBackReference
private
Postulante
postulante
;
public
long
getId
()
{
return
id
;
...
...
curriculumsearch/src/main/java/com/roshka/repositorio/ExperienciaTecnologiaRepository.java
deleted
100644 → 0
View file @
d4d963a8
package
com
.
roshka
.
repositorio
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
com.roshka.modelo.ExperienciaTecnologia
;
public
interface
ExperienciaTecnologiaRepository
extends
JpaRepository
<
ExperienciaTecnologia
,
Long
>
{
}
curriculumsearch/src/main/resources/static/main.js
View file @
13b70dce
...
...
@@ -9,9 +9,19 @@ function agregarFieldExpierncia(){
const
pairs
=
{};
const
formexp
=
document
.
querySelector
(
"[name=experiencia-form]"
);
const
formData
=
new
FormData
(
formexp
);
const
reconocimientos
=
[{},{},{}];
let
pos_rec
;
for
(
const
[
name
,
value
]
of
formData
){
pairs
[
name
]
=
value
pos_rec
=
name
.
split
(
"-"
);
//rec-nombre-index
if
(
pos_rec
.
length
>
1
)
{
reconocimientos
[
pos_rec
[
2
]][
pos_rec
[
1
]]
=
value
}
else
{
pairs
[
name
]
=
value
}
}
pairs
[
"reconocimientos"
]
=
reconocimientos
.
filter
(
rec
=>
rec
.
nombre
);
experiencias
[
cont_experiencia
]
=
pairs
;
formexp
.
reset
();
//imprimir lista actualizada
...
...
@@ -40,7 +50,6 @@ function agregarFieldExpierncia(){
function
eliminarExperiencia
(
event
)
{
//eliminar del array
console
.
log
(
event
.
target
.
parentElement
.
id
.
split
(
"-"
)[
1
])
experiencias
[
event
.
target
.
parentElement
.
id
.
split
(
"-"
)[
1
]]
=
null
//eliminar en html
event
.
target
.
parentElement
.
remove
()
...
...
@@ -87,7 +96,6 @@ form.addEventListener("submit",(evt)=>{
postData
(
'postulante'
,
serializeJSON
(
form
))
.
then
(
response
=>
{
console
.
log
(
response
);
// JSON data parsed by `data.json()` call
location
.
replace
(
response
.
url
);
});
evt
.
preventDefault
();
...
...
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
View file @
13b70dce
...
...
@@ -8,10 +8,10 @@
<!-- Bootstrap CSS -->
<link
href=
"https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel=
"stylesheet"
integrity=
"sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin=
"anonymous"
>
<title>
Hello, world!
</title>
<title>
Postulante
</title>
</head>
<body
class=
"container"
>
<h1>
Hello, world!
</h1>
<h1>
Curriculum
</h1>
<form
name=
"postulante"
method=
"post"
>
<div
class=
"mb-3 col-5"
>
...
...
@@ -74,7 +74,7 @@
Agregar Experiencia
</button>
<div
id=
"experiencias"
>
</div>
<button
type=
"submit"
class=
"btn btn-primary"
>
Submit
</button>
</form>
...
...
@@ -97,9 +97,34 @@
<label
for=
"fechaHasta"
class=
"form-label"
>
Fecha Hasta
</label>
<input
type=
"date"
class=
"form-control "
name=
"fechaHasta"
id=
"fechaHasta"
>
<label
for=
"cargo"
class=
"form-label"
>
Cargo
</label>
<input
type=
"
cargo
"
class=
"form-control "
name=
"cargo"
id=
"cargo"
>
<input
type=
"
text
"
class=
"form-control "
name=
"cargo"
id=
"cargo"
>
<label
for=
"refNombre"
class=
"form-label"
>
Referencia Nombre
</label>
<input
type=
"text"
class=
"form-control "
name=
"referencias"
id=
"refNombre"
>
<label
class=
"form-label"
>
Reconocimientos
</label>
<div
class=
"row mb-3"
>
<div
class=
"col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-nombre-0"
placeholder=
"Titulo del reconocimiento"
aria-label=
"First name"
>
</div>
<div
class=
"col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-certificado-0"
placeholder=
"Adjuntar archivo"
aria-label=
"Last name"
>
</div>
</div>
<div
class=
"row mb-3"
>
<div
class=
"col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-nombre-1"
placeholder=
"Titulo del reconocimiento"
aria-label=
"First name"
>
</div>
<div
class=
"col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-certificado-1"
placeholder=
"Adjuntar archivo"
aria-label=
"Last name"
>
</div>
</div>
<div
class=
"row mb-3"
>
<div
class=
"col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-nombre-2"
placeholder=
"Titulo del reconocimiento"
aria-label=
"First name"
>
</div>
<div
class=
"col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-certificado-2"
placeholder=
"Adjuntar archivo"
aria-label=
"Last name"
>
</div>
</div>
</form>
</div>
<div
class=
"modal-footer"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment