</target>
<target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
<target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
- <copyfiles files="${libs.primefaces.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${libs.hibernate-support.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.primefaces-3.1-SNAPSHOT.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.avalon-framework-4.1.3.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.commons-fileupload-1.2.2.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.commons-io-2.1.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.unbbayes-4.10.4-1s.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.xalan-2.7.0.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.xml-apis-1.0.b2.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.casablanca-1.0.3.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<mkdir dir="${build.web.dir}/META-INF"/>
<manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
</target>
<target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
- <copyfiles files="${libs.primefaces.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.hibernate-support.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.primefaces-3.1-SNAPSHOT.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.avalon-framework-4.1.3.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.commons-fileupload-1.2.2.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.commons-io-2.1.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.unbbayes-4.10.4-1s.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.xalan-2.7.0.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.xml-apis-1.0.b2.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${file.reference.casablanca-1.0.3.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
</target>
<target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
<delete dir="${build.web.dir}/WEB-INF/lib"/>
-build.xml.data.CRC32=8ce0c982
+build.xml.data.CRC32=04b72030
build.xml.script.CRC32=9f680c47
build.xml.stylesheet.CRC32=651128d4@1.36.1.1
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=8ce0c982
-nbproject/build-impl.xml.script.CRC32=6bf12d49
+nbproject/build-impl.xml.data.CRC32=04b72030
+nbproject/build-impl.xml.script.CRC32=ee0ab292
nbproject/build-impl.xml.stylesheet.CRC32=b7883b1f@1.36.1.1
${libs.javaee-endorsed-api-6.0.classpath}
excludes=
file.reference.avalon-framework-4.1.3.jar=lib/avalon-framework-4.1.3.jar
+file.reference.casablanca-1.0.3.jar=lib/casablanca-1.0.3.jar
file.reference.commons-fileupload-1.2.2.jar=lib/commons-fileupload-1.2.2.jar
file.reference.commons-io-2.1.jar=lib/commons-io-2.1.jar
file.reference.commons-lang3-3.1.jar=lib/commons-lang3-3.1.jar
file.reference.junit-4.1.jar=lib/junit-4.1.jar
file.reference.log4j-1.2.12.jar=lib/log4j-1.2.12.jar
file.reference.logkit-1.0.1.jar=lib/logkit-1.0.1.jar
+file.reference.primefaces-3.1-SNAPSHOT.jar=lib/primefaces-3.1-SNAPSHOT.jar
file.reference.servlet-api-2.3.jar=lib/servlet-api-2.3.jar
file.reference.unbbayes-4.10.4-1s.jar=lib/unbbayes-4.10.4-1s.jar
file.reference.xalan-2.7.0.jar=lib/xalan-2.7.0.jar
j2ee.server.type=gfv3ee6
jar.compress=false
javac.classpath=\
- ${libs.primefaces.classpath}:\
${libs.hibernate-support.classpath}:\
+ ${file.reference.primefaces-3.1-SNAPSHOT.jar}:\
${file.reference.avalon-framework-4.1.3.jar}:\
${file.reference.commons-fileupload-1.2.2.jar}:\
${file.reference.commons-io-2.1.jar}:\
${file.reference.servlet-api-2.3.jar}:\
${file.reference.unbbayes-4.10.4-1s.jar}:\
${file.reference.xalan-2.7.0.jar}:\
- ${file.reference.xml-apis-1.0.b2.jar}
+ ${file.reference.xml-apis-1.0.b2.jar}:\
+ ${file.reference.casablanca-1.0.3.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.debug=true
<minimum-ant-version>1.6.5</minimum-ant-version>
<web-module-libraries>
<library dirs="200">
- <file>${libs.primefaces.classpath}</file>
+ <file>${libs.hibernate-support.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
- <file>${libs.hibernate-support.classpath}</file>
+ <file>${file.reference.primefaces-3.1-SNAPSHOT.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${file.reference.xml-apis-1.0.b2.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
+ <library dirs="200">
+ <file>${file.reference.casablanca-1.0.3.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
</web-module-libraries>
<web-module-additional-libraries/>
<source-roots>
@Column(length=100, nullable=false)
private String arquivo;
+
+ @Column(length=100, nullable=true)
+ private String descricao;
@OneToMany(cascade = javax.persistence.CascadeType.ALL, mappedBy="rede")
private List<Nodo> nodos;
public Long getId() {
return id;
+
}
public void setId(Long id) {
public void setArquivo(String arquivo) {
this.arquivo = arquivo;
}
+
+ public String getNomeArquivo() {
+ String nomeArquivo = arquivo.substring(arquivo.lastIndexOf('/') + 1);
+ return nomeArquivo.substring(nomeArquivo.indexOf("_") + 1);
+ }
public String getNome() {
return nome;
this.nome = nome;
}
-
public List<Nodo> getNodos() {
return nodos;
}
public void setNodos(List<Nodo> nodos) {
this.nodos = nodos;
}
+
+ public String getDescricao() {
+ return descricao;
+ }
+
+ public void setDescricao(String descricao) {
+ this.descricao = descricao;
+ }
}
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
-package org.ufcspa.simdecs.bn.ui;
+package org.ufcspa.simdecs.mb.bn;
import java.io.*;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
-import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
-import javax.faces.context.FacesContext;
-import javax.persistence.EntityManager;
+import javax.faces.bean.RequestScoped;
import javax.xml.bind.JAXBException;
import org.primefaces.event.FileUploadEvent;
import org.primefaces.model.UploadedFile;
import org.ufcspa.simdecs.entities.Nodo;
import org.ufcspa.simdecs.entities.Rede;
-import org.ufcspa.simdecs.util.DbUtil;
+import org.ufcspa.simdecs.mb.DefaultManagedBean;
import unbbayes.io.exception.LoadException;
import unbbayes.io.xmlbif.version6.XMLBIFIO;
import unbbayes.prs.bn.ProbabilisticNetwork;
-/**
- *
- * @author mchelem
- */
-@ManagedBean(name = "fileUploadController")
-public class FileUploadController implements Serializable {
-
- private static final Logger logger = Logger.getLogger("" + FileUploadController.class);
- EntityManager em = null;
+@ManagedBean
+@RequestScoped
+public class FileUploadController extends DefaultManagedBean {
- public FileUploadController() {
- em = DbUtil.getInstance().getEntityManager();
- }
+ private static final Logger logger = Logger.getLogger("" + FileUploadController.class);
private File saveUploadedFile(UploadedFile uploadedFile) throws IOException{
long unixTime = System.currentTimeMillis() / 1000L;
InputStream in = new BufferedInputStream(uploadedFile.getInputstream());
- File file = new File("bn_"+ unixTime + "_" + uploadedFile.getFileName());
+ File file = new File("bn"+ unixTime + "_" + uploadedFile.getFileName());
FileOutputStream fout = new FileOutputStream(file);
while(in.available() != 0){
fout.write(in.read());
}
private void persist(Rede redeBayesiana){
- em.getTransaction().begin();
- em.persist(redeBayesiana);
- em.getTransaction().commit();
+ try
+ {
+ em.getTransaction().begin();
+ }
+ finally {
+ em.persist(redeBayesiana);
+ em.getTransaction().commit();
+ }
+
logger.log(Level.INFO, "Bayesian Network {0} persisted.", redeBayesiana.getNome());
}
rede.setNodos(nodes);
persist(rede);
- FacesMessage msg = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded.");
- FacesContext.getCurrentInstance().addMessage(null, msg);
+ addInfoMessage("Rede Adicionada!", "Rede Bayesiana adicionada com sucesso!");
} catch (LoadException ex) {
Logger.getLogger(FileUploadController.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
--- /dev/null
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.ufcspa.simdecs.mb.bn;
+
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import javax.persistence.Query;
+import javax.persistence.criteria.CriteriaQuery;
+import org.primefaces.component.commandbutton.CommandButton;
+import org.primefaces.event.SelectEvent;
+import org.primefaces.event.UnselectEvent;
+import org.ufcspa.simdecs.entities.Nodo;
+import org.ufcspa.simdecs.entities.Rede;
+import org.ufcspa.simdecs.mb.DefaultManagedBean;
+
+@ManagedBean
+@SessionScoped
+public class RedeController extends DefaultManagedBean {
+
+ private Rede[] selectedItems;
+ private static final Logger logger = Logger.getLogger("" + RedeDataModel.class);
+
+ public List<Rede> getItems() {
+ CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
+ cq.select(cq.from(Rede.class));
+ Query q = em.createQuery(cq);
+ return q.getResultList();
+ }
+
+
+ public Rede getSelectedItem() {
+ assert selectedItems.length == 1;
+ return selectedItems[0];
+ }
+
+ public Rede[] getSelectedItems() {
+ return selectedItems;
+ }
+
+ public void setSelectedItems(Rede[] selectedItems) {
+ this.selectedItems = selectedItems;
+ logger.log(Level.INFO, "Set selected items.");
+ }
+
+ public RedeDataModel getSelectableItems() {
+ return new RedeDataModel(this.getItems());
+ }
+
+ public void destroy() {
+ try {
+ em.getTransaction().begin();
+ } finally {
+ for (Rede item : selectedItems) {
+ em.remove(item);
+ }
+ addInfoMessage("Rede removida!", "Rede Bayesiana removida com sucesso!");
+ em.getTransaction().commit();
+ }
+ }
+
+ public String close(){
+ return "/rede/index";
+ }
+
+ public String edit() {
+ return "/rede/editarRede";
+ }
+
+ public List<Nodo> getNodos(){
+ Rede rede = getSelectedItem();
+ return rede.getNodos();
+ }
+
+ public boolean getViewButtonDisabled(){
+ return selectedItems == null || selectedItems.length != 1;
+ }
+
+ private void setViewButton(){
+ CommandButton verButton = (CommandButton) getComponentById(
+ "formRedeTable:redeTable:verButton");
+ assert verButton != null;
+ assert selectedItems != null;
+ verButton.setDisabled(getViewButtonDisabled());
+ }
+
+ public void onRowSelect(SelectEvent event) throws Exception {
+ setViewButton();
+ }
+
+ public void onRowUnselect(UnselectEvent event) throws Exception {
+ setViewButton();
+ }
+}
--- /dev/null
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.ufcspa.simdecs.mb.bn;
+
+/**
+ *
+ * @author mchelem
+ */
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.faces.model.ListDataModel;
+import org.primefaces.model.SelectableDataModel;
+import org.ufcspa.simdecs.entities.Rede;
+
+public class RedeDataModel extends ListDataModel<Rede> implements SelectableDataModel<Rede> {
+
+ private static final Logger logger = Logger.getLogger("" + RedeDataModel.class);
+
+ public RedeDataModel() {
+ }
+
+ public RedeDataModel(List<Rede> data) {
+ super(data);
+ }
+
+ @Override
+ public Rede getRowData(String rowKey) {
+ //In a real app, a more efficient way like a query by rowKey should be implemented to deal with huge data
+ List<Rede> redes = (List<Rede>) getWrappedData();
+ for(Rede rede : redes) {
+ if(rowKey.equals(rede.getId().toString())){
+ logger.log(Level.INFO, "Selected network {0}", rede.getId());
+ return rede;
+ }
+ }
+ logger.log(Level.INFO, "Did not select network");
+ return null;
+ }
+
+ @Override
+ public Object getRowKey(Rede rede) {
+ return rede.getId().toString();
+ }
+}
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
- <param-value>Development</param-value>
+ <param-value>Release</param-value>
</context-param>
+ <context-param>
+ <param-name>primefaces.THEME</param-name>
+ <param-value>casablanca</param-value>
+ </context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:p="http://primefaces.prime.com.tr/ui"
+ xmlns:p="http://primefaces.org/ui"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<ul>
<ui:repeat id="listaCasos" var="caso" value="#{selecioneCasoBean.listaCasos}">
<li>
- <p:commandLink update="fEditarCaso" oncomplete="dialogEditarCaso.show()" actionListener="#{selecioneCasoBean.prepararEditarCasoClinico()}" value="#{caso.nome}" title="Editar Caso Clínico">
+ <p:commandLink update=":fEditarCaso" oncomplete="dialogEditarCaso.show()" actionListener="#{selecioneCasoBean.prepararEditarCasoClinico()}" value="#{caso.nome}" title="Editar Caso Clínico">
<f:param name="pIDCaso" value="#{caso.id}" />
</p:commandLink>
</li>
</ui:repeat>
<li>
- <p:commandLink oncomplete="dialogEditarCaso.show();" actionListener="#{selecioneCasoBean.preparaNovoCaso()}" update="fEditarCaso" >
+ <p:commandLink oncomplete="dialogEditarCaso.show();" actionListener="#{selecioneCasoBean.preparaNovoCaso()}" update=":fEditarCaso" >
Criar um novo caso clínico
</p:commandLink>
</li>
<p:commandButton onclick="dialogEditarCaso.hide();" value="Cancelar" type="button" />
- <p:commandButton id="excluir" update="listaCasos" actionListener="#{selecioneCasoBean.excluirCasoClinico()}" value="Excluir" title="Excluir Caso Clínico" ajax="false">
+ <p:commandButton id="excluir" update=":fSelecionaCaso:listaCasos" actionListener="#{selecioneCasoBean.excluirCasoClinico()}" value="Excluir" title="Excluir Caso Clínico" ajax="false">
<f:param name="pIDCaso" value="#{selecioneCasoBean.idCaso}" />
</p:commandButton>
</center>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:p="http://primefaces.prime.com.tr/ui"
+ xmlns:p="http://primefaces.org/ui"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
--- /dev/null
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:p="http://primefaces.org/ui"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <h:head>
+ <title>SimDeCS: Redes Bayesianas</title>
+ </h:head>
+ <h:body>
+ <h:form>
+ <h2>Rede Bayesiana: #{redeController.selectedItem.nome}</h2>
+ <p:dataTable var="nodo" value="#{redeController.nodos}" id="nodoTable"
+ paginator="true" rows="10"
+ style="width:70%"
+ paginatorPosition="top"
+ paginatorAlwaysVisible="false"
+ emptyMessage="Não existem nodos cadastrados.">
+
+ <f:facet name="header">
+ <h:outputText value="Nodos"/>
+ <p:separator/>
+ <p:commandButton icon="ui-icon-close" action="#{redeController.close}" ajax="false"/>
+ <p:commandButton icon="ui-icon-plus" action="#{redeController.close}" ajax="false"/>
+ </f:facet>
+
+ <p:column headerText="Nome">
+ <p:cellEditor>
+ <f:facet name="output">
+ <h:outputText value="#{nodo.nome}" />
+ </f:facet>
+ <f:facet name="input">
+ <p:inputText value="#{nodo.nome}"/>
+ </f:facet>
+ </p:cellEditor>
+ </p:column>
+ <p:column headerText="Nome Alternativo">
+ <p:cellEditor>
+ <f:facet name="output">
+ <h:outputText value="#{nodo.nomeAmigavel}" />
+ </f:facet>
+ <f:facet name="input">
+ <p:inputText value="#{nodo.nomeAmigavel}"/>
+ </f:facet>
+ </p:cellEditor>
+ </p:column>
+ <p:column headerText="Custo">
+ <p:cellEditor>
+ <f:facet name="output">
+ <h:outputText value="#{nodo.custo}" />
+ </f:facet>
+ <f:facet name="input">
+ <p:inputText value="#{nodo.custo}"/>
+ </f:facet>
+ </p:cellEditor>
+ </p:column>
+ <p:column headerText="Tipo">
+ <p:cellEditor>
+ <f:facet name="output">
+ <h:outputText value="#{nodo.tipo}" />
+ </f:facet>
+ <f:facet name="input">
+ <p:inputText value="#{nodo.tipo}"/>
+ </f:facet>
+ </p:cellEditor>
+ </p:column>
+ <p:column headerText="Bogus">
+ <p:cellEditor>
+ <f:facet name="output">
+ <h:outputText value="#{nodo.bogus}" />
+ </f:facet>
+ <f:facet name="input">
+ <p:inputText value="#{nodo.bogus}"/>
+ </f:facet>
+ </p:cellEditor>
+ </p:column>
+
+ <p:column headerText="">
+ <p:rowEditor />
+
+ </p:column>
+ </p:dataTable>
+ </h:form>
+
+ </h:body>
+</html>
+
--- /dev/null
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:p="http://primefaces.org/ui"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+ <h:form>
+ <p:menubar style="width:70%">
+ <p:menuitem value="Project" url="#"/>
+ <p:menuitem value="Other" url="#"/>
+ <p:menuitem value="Undo" url="#"/>
+ <p:menuitem value="Redo" url="#"/>
+ <p:menuitem value="Quit" url="http://www.primefaces.org"/>
+ </p:menubar>
+
+ </h:form>
+</ui:composition>
+
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:p="http://primefaces.prime.com.tr/ui"
- xmlns:h="http://java.sun.com/jsf/html">
+ xmlns:p="http://primefaces.org/ui"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:f="http://java.sun.com/jsf/core">
<h:head>
- <title>Facelet Title</title>
+ <title>SimDeCS: Redes Bayesianas</title>
</h:head>
<h:body>
- Hello from Facelets
- <h:form enctype="multipart/form-data">
- <p:fileUpload fileUploadListener="#{fileUploadController.handleFileUpload}"
- update="messages"/>
-
+<!-- <ui:include src="header.xhtml"/>-->
+ <h:form id="formUpload" enctype="multipart/form-data">
+ <h2>Upload de Redes Bayesianas</h2>
+ <p:fileUpload fileUploadListener="#{fileUploadController.handleFileUpload}"
+ mode="advanced"
+ update=":formRedeTable,:formUpload:messages"
+ style="width:70%; height: 50px"
+ multiple="true"
+ allowTypes="/(\.|\/)(xml)$/"
+ uploadLabel="Enviar"
+ cancelLabel="Cancelar"
+ label="Selecionar"/>
<p:growl id="messages" showDetail="true"/>
+ </h:form>
+
+ <br></br><br></br>
+ <h:form id="formRedeTable">
+ <p:dataTable id="redeTable" var="rede" value="#{redeController.selectableItems}" paginator="true" rows="30"
+ selection="#{redeController.selectedItems}" style="width:70%"
+ paginatorPosition="top"
+ paginatorAlwaysVisible="false"
+ emptyMessage="Não existem redes cadastradas.">
+
+ <p:ajax event="rowSelect" listener="#{redeController.onRowSelect}"
+ update=":formRedeTable,:formUpload:messages"/>
+ <p:ajax event="rowUnselect" listener="#{redeController.onRowUnselect}"
+ update=":formRedeTable,:formUpload:messages"/>
+
+ <f:facet name="header">
+ <h:outputText value="Redes Bayesianas"/>
+
+ <p:separator />
+ <p:commandButton id="verButton" icon="ui-icon-folder-open"
+ action="#{redeController.edit}"
+ disabled="#{redeController.viewButtonDisabled}" ajax="false"/>
+ <p:commandButton icon="ui-icon-trash" actionListener="#{redeController.destroy}"
+ update=":formRedeTable,:formUpload:messages"/>
+ </f:facet>
+
+ <p:column selectionMode="multiple" />
+
+ <p:column headerText="Nome">
+ <p:cellEditor>
+ <f:facet name="output">
+ <p:commandLink value="#{rede.nome}"/>
+ </f:facet>
+ <f:facet name="input">
+ <p:inputText value="#{rede.nome}"/>
+ </f:facet>
+ </p:cellEditor>
+ </p:column>
+
+ <p:column headerText="Arquivo">
+ #{rede.nomeArquivo}
+ </p:column>
+
+ <p:column headerText="Descrição">
+ <p:cellEditor>
+ <f:facet name="output">
+ <h:outputText value="#{rede.descricao}"/>
+ </f:facet>
+ <f:facet name="input">
+ <p:inputText value="#{rede.descricao}"/>
+ </f:facet>
+ </p:cellEditor>
+
+ </p:column>
+
+ <p:column headerText="">
+ <p:rowEditor />
+ </p:column>
+
+ </p:dataTable>
+
</h:form>
</h:body>
</html>