<copyfiles files="${file.reference.junit-4.1.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.log4j-1.2.12.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.logkit-1.0.1.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
- <copyfiles files="${file.reference.servlet-api-2.3.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.junit-4.1.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.log4j-1.2.12.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.logkit-1.0.1.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
- <copyfiles files="${file.reference.servlet-api-2.3.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"/>
-build.xml.data.CRC32=2c4c42bc
+build.xml.data.CRC32=aed63b6a
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=2c4c42bc
-nbproject/build-impl.xml.script.CRC32=d3f674de
+nbproject/build-impl.xml.data.CRC32=aed63b6a
+nbproject/build-impl.xml.script.CRC32=da75e33b
nbproject/build-impl.xml.stylesheet.CRC32=b7883b1f@1.36.1.1
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
file.reference.xml-apis-1.0.b2.jar=lib/xml-apis-1.0.b2.jar
${file.reference.junit-4.1.jar}:\
${file.reference.log4j-1.2.12.jar}:\
${file.reference.logkit-1.0.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}
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
- <file>${file.reference.servlet-api-2.3.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
- <library dirs="200">
<file>${file.reference.unbbayes-4.10.4-1s.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
@Override
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException {
req.setCharacterEncoding("UTF-8");
- //resp.setCharacterEncoding("UTF-8");
+ resp.setCharacterEncoding("UTF-8");
chain.doFilter(req, resp);
}
import org.primefaces.event.FileUploadEvent;
import org.primefaces.model.UploadedFile;
import org.ufcspa.simdecs.entities.Nodo;
+import org.ufcspa.simdecs.entities.PerguntaNodo;
import org.ufcspa.simdecs.entities.Rede;
import org.ufcspa.simdecs.mb.DefaultManagedBean;
import unbbayes.io.exception.LoadException;
Nodo nodo = new Nodo();
nodo.setNome(prs_node.getName());
nodo.setRede(rede);
+ nodo.setPerguntas(new ArrayList<PerguntaNodo>());
nodes.add(nodo);
}
rede.setNodos(nodes);
}
public void addPergunta() {
- try {
- em.getTransaction().begin();
- } finally {
- PerguntaNodo pergunta = new PerguntaNodo();
- pergunta.setTexto("");
- pergunta.setNodo(selectedNodo);
- pergunta.setRespostas(new ArrayList());
- selectedNodo.getPerguntas().add(pergunta);
- em.persist(pergunta);
- em.getTransaction().commit();
+ if (selectedNodo != null) {
+ try {
+ em.getTransaction().begin();
+ } finally {
+ PerguntaNodo pergunta = new PerguntaNodo();
+ pergunta.setTexto("");
+ pergunta.setNodo(selectedNodo);
+ pergunta.setRespostas(new ArrayList());
+ selectedNodo.getPerguntas().add(pergunta);
+ em.persist(pergunta);
+ em.getTransaction().commit();
+ }
+ addInfoMessage("Pergunta Adicionada", "Pergunta adicionada com sucesso.");
+ } else {
+ addErrorMessage("Pergunta não adicionada", "Não existe nodo selecionado.");
}
- addInfoMessage("Pergunta Adicionada", "Pergunta adicionada com sucesso.");
+
}
public void removePergunta(PerguntaNodo pergunta) {
}
public void addResposta() {
- try {
- em.getTransaction().begin();
- } finally {
- RespostaNodo resposta = new RespostaNodo();
- resposta.setTexto("");
- resposta.setPergunta(selectedPergunta);
- resposta.setPesoMinimo(0);
- resposta.setPesoMaximo(1);
- selectedPergunta.getRespostas().add(resposta);
- em.persist(resposta);
- em.getTransaction().commit();
+ if (selectedPergunta != null) {
+ try {
+ em.getTransaction().begin();
+ } finally {
+ RespostaNodo resposta = new RespostaNodo();
+ resposta.setTexto("");
+ resposta.setPergunta(selectedPergunta);
+ resposta.setPesoMinimo(0);
+ resposta.setPesoMaximo(1);
+ selectedPergunta.getRespostas().add(resposta);
+ em.persist(resposta);
+ em.getTransaction().commit();
+ }
+ addInfoMessage("Resposta adicionada", "Resposta adicionada com sucesso.");
+ } else {
+ addErrorMessage("Resposta não adicionada", "Não existe pergunta selecionada.");
}
- addInfoMessage("Resposta adicionada", "Resposta adicionada com sucesso.");
}
public void removeResposta(RespostaNodo resposta) {
}
public void addNodo() {
- try {
- em.getTransaction().begin();
- } finally {
- Nodo nodo = new Nodo();
- nodo.setNome("");
- nodo.setRede(rede);
- nodo.setPerguntas(new ArrayList());
- rede.getNodos().add(nodo);
- em.persist(nodo);
- em.getTransaction().commit();
+ if (rede != null) {
+ try {
+ em.getTransaction().begin();
+ } finally {
+ Nodo nodo = new Nodo();
+ nodo.setNome("");
+ nodo.setRede(rede);
+ nodo.setPerguntas(new ArrayList());
+ rede.getNodos().add(nodo);
+ em.persist(nodo);
+ em.getTransaction().commit();
+ }
+ addInfoMessage("Nodo adicionado", "Nodo adicionado com sucesso.");
+ } else {
+ addErrorMessage("Nodo não adicionado", "Não existe rede selecionada.");
}
- addInfoMessage("Nodo adicionado", "Nodo adicionado com sucesso.");
}
import java.util.ArrayList;
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;
public void setSelectedItems(Rede[] selectedItems) {
this.selectedItems = selectedItems;
- Logger.getLogger(RedeUploadBean.class.getName()).log(Level.INFO, "Set selected items.");
}
public SimdecsDataModel getSelectableItems() {
for (Rede item : selectedItems) {
em.remove(item);
}
- addInfoMessage("Rede removida!", "Rede Bayesiana removida com sucesso!");
+ addInfoMessage("Rede removida", "Rede Bayesiana removida com sucesso.");
em.getTransaction().commit();
}
}
<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>Release</param-value>
+ <param-value>Production</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>