Skip to content
Snippets Groups Projects
Commit a5713a44 authored by ginquin's avatar ginquin
Browse files

modificada vista busqueda publicaciones y controlador

parent b649195f
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,11 @@ import org.zkoss.zkplus.spring.DelegatingVariableResolver;
import org.zkoss.zul.East;
import org.zkoss.zul.ListModelList;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Textbox;
import es.uva.inf.tfg.ginquin.smellswisdom.domain.Article;
import es.uva.inf.tfg.ginquin.smellswisdom.domain.Author;
import es.uva.inf.tfg.ginquin.smellswisdom.domain.Authorinstitution;
import es.uva.inf.tfg.ginquin.smellswisdom.services.ArticleService;
@VariableResolver(DelegatingVariableResolver.class)
......@@ -27,6 +30,11 @@ public class BusquedaDesignSmellsController extends SelectorComposer<Component>
@Wire
Listbox articlesListBox;
@Wire
Textbox articleTitle;
@Wire
Listbox authorInstituionListBox;
@Wire
East selectedArticleBlock;
......@@ -34,6 +42,7 @@ public class BusquedaDesignSmellsController extends SelectorComposer<Component>
ArticleService articleService;
ListModelList<Article> articlesListModel;
ListModelList<Authorinstitution> authorInstituionListModel;
Article selectedArticle;
......@@ -75,10 +84,18 @@ public class BusquedaDesignSmellsController extends SelectorComposer<Component>
// Hace invisible la vista detalle.
selectedArticleBlock.setVisible(false);
authorInstituionListModel = null;
authorInstituionListBox.setModel(authorInstituionListModel);
} else {
// Hace visible la vista detalle.
selectedArticleBlock.setVisible(true);
articleTitle.setText(selectedArticle.getTitle());
authorInstituionListModel = new ListModelList<Authorinstitution>(selectedArticle.getAuthorinstitutions());
authorInstituionListBox.setModel(authorInstituionListModel);
}
}
......
......@@ -3,6 +3,7 @@ package es.uva.inf.tfg.ginquin.smellswisdom.domain;
import java.io.Serializable;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
......
......@@ -69,4 +69,14 @@ public class Authorinstitution implements Serializable {
public String getFullNameAuthor() {
return this.author.getFullName();
}
public String getFullNameInstitution() {
return !this.institution.getFullname().
equals("NO DATA")?
this.institution.getFullname():this.institution.getAcronym();
}
public boolean getIsAcademic() {
return this.institution.getIsacademic()>0?true:false;
}
}
\ No newline at end of file
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<borderlayout apply="es.uva.inf.tfg.ginquin.smellswisdom.controller.BusquedaDesignSmellsController">
<borderlayout
apply="es.uva.inf.tfg.ginquin.smellswisdom.controller.BusquedaDesignSmellsController">
<north border="none">
<div>
<textbox id="descripcionBusqueda" maxlength="250"
hflex="1" placeholder="Buscar..." />
<textbox id="descripcionBusqueda" maxlength="250" hflex="1"
placeholder="Buscar..." />
<button id="bBuscar" label="Buscar" />
</div>
</north>
......@@ -12,29 +13,29 @@
pagingPosition="bottom" autopaging="true" vflex="1">
<listhead>
<listheader width="30px" />
<listheader label="Título"
width="70%" />
<listheader label="Autores"
width="20%"/>
<listheader
label="Año" width="10%" />
<listheader label="Título" width="70%" />
<listheader label="Autores" width="20%" />
<listheader label="Año" width="10%" />
</listhead>
<template name="model">
<listitem>
<listcell />
<listcell label="${each.title}" />
<listcell label="${each.autoresRes}" tooltiptext="${each.autores}"/>
<listcell label="${each.autoresRes}"
tooltiptext="${each.autores}" />
<listcell label="${each.year}" />
</listitem>
</template>
</listbox>
</center>
<east id="selectedArticleBlock" visible="false" width="65%"
border="none" collapsible="false" splittable="true" autoscroll="true">
border="none" collapsible="false" splittable="true"
autoscroll="true">
<vlayout vflex="1" hflex="1">
<groupbox id="groupBoxSelectedPublicacion" contentStyle="border:0" closable="false" vflex="1" hflex="1">
<groupbox id="groupBoxSelectedPublicacion"
contentStyle="border:0" closable="false" vflex="1" hflex="1">
<caption label="Detalle de artículo" />
<grid sclass="no-border">
......@@ -46,28 +47,43 @@
</columns>
<rows>
<row>
<cell></cell><cell></cell><cell></cell>
<cell><button id="cancelDetail" label="Cancelar"></button></cell>
<cell></cell>
<cell></cell>
<cell></cell>
<cell>
<button id="cancelDetail"
label="Cancelar">
</button>
</cell>
</row>
<row>
<cell>Título</cell>
<cell><textbox id="articleTitle" maxlength="255" readonly="true" hflex="1" /></cell>
<cell>Autores</cell>
<cell>
<listbox id="authorListBox" rows="2" checkmark="true" hflex="1" >
<cell colspan="3">
<textbox id="articleTitle"
maxlength="255" readonly="true" hflex="1" />
</cell>
</row>
<row>
<cell colspan="4">
<listbox id="authorInstituionListBox" rows="2" hflex="1">
<listhead>
<listheader label="Autor" width="40%"/>
<listheader label="Institución" width="40%" />
<listheader
label="Es academico" width="20%"/>
</listhead>
<template name="model">
<listitem
label="${each.fullName}" checkable="false"/>
<listitem>
<listcell
label="${each.fullNameAuthor}" />
<listcell
label="${each.fullNameInstitution}" />
<listcell><checkbox checked="${each.isAcademic}"/></listcell>
</listitem>
</template>
</listbox>
</cell>
</row>
<row>
<cell>Institución</cell>
<cell><textbox id="instiName" maxlength="255" readonly="true" hflex="1"/></cell>
<cell>Academico</cell>
<cell><textbox id="instiAcademic" maxlength="255" readonly="true" hflex="1"/></cell>
</row>
</rows>
</grid>
</groupbox>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment