-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:ingsw-sarmiento/libro-matriz-digi…
…tal into 112-criterios-persistencia # Conflicts: # src/main/java/ar/edu/unq/sarmiento/hibernate/DataGenerator.java
- Loading branch information
Showing
10 changed files
with
146 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/ar/edu/unq/sarmiento/wicket/materia/ListadoDeMateriasController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package ar.edu.unq.sarmiento.wicket.materia; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
import org.apache.wicket.model.IModel; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.config.ConfigurableBeanFactory; | ||
import org.springframework.context.annotation.Scope; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import ar.edu.unq.sarmiento.hibernate.CarreraHome; | ||
import ar.edu.unq.sarmiento.modelo.Carrera; | ||
import ar.edu.unq.sarmiento.modelo.Materia; | ||
|
||
@Service | ||
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) | ||
@Transactional | ||
public class ListadoDeMateriasController implements Serializable{ | ||
|
||
private Carrera carrera; | ||
|
||
public Carrera getCarrera() { | ||
return carrera; | ||
} | ||
|
||
public void setCarrera(Carrera carrera) { | ||
this.carrera = carrera; | ||
} | ||
|
||
public String getNombreCarrera(){ | ||
return this.getCarrera().getNombre(); | ||
} | ||
|
||
public List<Materia> getMaterias(){ | ||
return this.getCarrera().getListadoMaterias(); | ||
} | ||
|
||
public String convertirString(Boolean promocion) { | ||
return promocion ? "Sí" : "No"; | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/ar/edu/unq/sarmiento/wicket/materia/ListadoDeMateriasPage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<wicket:extend> | ||
<div class="panel panel-primary"> | ||
<div class="panel-heading titulo"> | ||
<h4>Materias de <span wicket:id="nombreCarrera"></span></h4> | ||
</div> | ||
<div class="panel-body"> | ||
<table class="table"> | ||
<thead> | ||
<th>Año</th> | ||
<th>Nombre</th> | ||
<th>Promocionable</th> | ||
<th>Docente</th> | ||
</thead> | ||
<tbody> | ||
<tr wicket:id="materias" class="fila"> | ||
<td wicket:id="año"></td> | ||
<td wicket:id="nombre"></td> | ||
<td wicket:id="promocionable"></td> | ||
<td wicket:id="docente"></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</wicket:extend> |
37 changes: 37 additions & 0 deletions
37
src/main/java/ar/edu/unq/sarmiento/wicket/materia/ListadoDeMateriasPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package ar.edu.unq.sarmiento.wicket.materia; | ||
|
||
import org.apache.wicket.markup.html.basic.Label; | ||
import org.apache.wicket.markup.html.list.ListItem; | ||
import org.apache.wicket.markup.html.list.ListView; | ||
import org.apache.wicket.model.CompoundPropertyModel; | ||
import org.apache.wicket.model.PropertyModel; | ||
import org.apache.wicket.spring.injection.annot.SpringBean; | ||
|
||
import ar.edu.unq.sarmiento.modelo.Carrera; | ||
import ar.edu.unq.sarmiento.modelo.Materia; | ||
import ar.edu.unq.sarmiento.wicket.layout.LayoutPage; | ||
|
||
public class ListadoDeMateriasPage extends LayoutPage{ | ||
|
||
@SpringBean(name="listadoDeMateriasController") | ||
private ListadoDeMateriasController controller; | ||
|
||
public ListadoDeMateriasPage(Carrera carrera) { | ||
controller.setCarrera(carrera); | ||
this.add(new Label("nombreCarrera", new PropertyModel<>(controller, "nombreCarrera"))); | ||
this.add(new ListView<Materia>("materias", new PropertyModel<>(controller, "materias")){ | ||
|
||
@Override | ||
protected void populateItem(ListItem<Materia> item) { | ||
CompoundPropertyModel<Materia> materia = new CompoundPropertyModel<>(item.getModelObject()); | ||
item.add(new Label("nombre", new PropertyModel<>(materia, "nombre"))); | ||
item.add(new Label("año", new PropertyModel<>(materia, "anioEnCarrera"))); | ||
item.add(new Label("promocionable", controller.convertirString(item.getModelObject().getEsPromocionable()))); | ||
item.add(new Label("docente", new PropertyModel<>(materia, "docente"))); | ||
} | ||
|
||
}); | ||
|
||
} | ||
|
||
} |