</h:commandButton>
<s:button propagation="end"
id="done"
- value="Concluído"
+ value="Voltar"
view="/seguro/admin/rede/RedeBayesianaList.xhtml"/>
</div>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<page xmlns="http://jboss.com/products/seam/pages"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd">
+
+ <param name="nodoFrom"/>
+ <param name="nodoId" value="#{nodoHome.nodoId}"/>
+
+
+</page>
--- /dev/null
+<!DOCTYPE composition 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:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ template="/layout/template.xhtml">
+
+<ui:define name="body">
+
+ <rich:panel>
+ <f:facet name="header">Nodos</f:facet>
+
+
+ <s:decorate id="redeBayesianaId" template="/layout/display.xhtml">
+ <ui:define name="label">Rede bayesiana</ui:define>
+ <h:outputText value="#{nodoHome.instance.redeBayesiana.nome}"/>
+ </s:decorate>
+
+ <s:decorate id="nome" template="/layout/display.xhtml">
+ <ui:define name="label">Nome</ui:define>
+ <h:outputText value="#{nodoHome.instance.nome}"/>
+ </s:decorate>
+
+ <s:decorate id="custo" template="/layout/display.xhtml">
+ <ui:define name="label">Custo</ui:define>
+ <h:outputText value="#{nodoHome.instance.custo}"/>
+ </s:decorate>
+
+ <s:decorate id="tempo" template="/layout/display.xhtml">
+ <ui:define name="label">Tempo</ui:define>
+ <h:outputText value="#{nodoHome.instance.tempo}"/>
+ </s:decorate>
+
+ <div style="clear:both"/>
+
+ </rich:panel>
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="#{nodoHome.instance.perguntas.size()} Perguntas(s)"></h:outputText>
+ </f:facet>
+ <rich:dataList value="#{nodoHome.instance.perguntas}" var="_dataListPerguntas" rendered="#{nodoHome.instance.perguntas.size()>0}">
+ <h:column>
+ <s:link value="#{_dataListPerguntas.texto}" view="/seguro/admin/rede/PerguntaNodo.xhtml">
+ <f:param name="perguntaNodoId" value="${_dataListPerguntas.id}"/>
+ </s:link>
+ </h:column>
+ </rich:dataList>
+ <s:div styleClass="actionButtons" rendered="#{empty from}">
+ <s:button view="/seguro/admin/rede/PerguntaNodoEdit.xhtml"
+ id="create"
+ propagation="none"
+ value="Criar pergunta">
+ <f:param name="perguntaNodoId"/>
+ <f:param name="nodoId"/>
+ </s:button>
+ </s:div>
+ </rich:panel>
+ <div class="actionButtons">
+
+ <s:button view="/seguro/admin/rede/NodoEdit.xhtml"
+ id="edit"
+ value="Edit"/>
+
+ <s:button view="/seguro/admin/rede/RedeBayesianaList.xhtml"
+ id="done"
+ value="Done"/>
+
+ </div>
+
+</ui:define>
+
+</ui:composition>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<page xmlns="http://jboss.com/products/seam/pages"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd"
+ no-conversation-view-id="/seguro/admin/rede/NodoList.xhtml"
+ login-required="true">
+
+ <begin-conversation join="true" flush-mode="MANUAL"/>
+
+ <action execute="#{nodoHome.wire}"/>
+
+ <param name="nodoFrom"/>
+ <param name="nodoId" value="#{nodoHome.nodoId}"/>
+
+
+ <navigation from-action="#{nodoHome.persist}">
+ <rule if-outcome="persisted">
+ <end-conversation/>
+ <redirect view-id="/seguro/admin/rede/Nodo.xhtml"/>
+ </rule>
+ </navigation>
+
+ <navigation from-action="#{nodoHome.update}">
+ <rule if-outcome="updated">
+ <end-conversation/>
+ <redirect view-id="/seguro/admin/rede/Nodo.xhtml"/>
+ </rule>
+ </navigation>
+
+ <navigation from-action="#{nodoHome.remove}">
+ <rule if-outcome="removed">
+ <end-conversation/>
+ <redirect view-id="/seguro/admin/rede/NodoList.xhtml"/>
+ </rule>
+ </navigation>
+
+</page>
--- /dev/null
+<!DOCTYPE composition 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:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:a="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ template="/layout/template.xhtml">
+
+<ui:define name="body">
+
+ <h:form id="nodo" styleClass="edit">
+
+ <rich:panel>
+ <f:facet name="header">#{nodoHome.managed ? 'Edit' : 'Add'} Nodo</f:facet>
+
+
+
+ <s:decorate id="redeBayesianaIdField" template="/layout/edit.xhtml">
+ <ui:define name="label">Rede bayesiana id</ui:define>
+ <h:outputText id="redeBayesianaId"
+ value="#{nodoHome.instance.redeBayesiana.id}">
+ </h:outputText>
+ </s:decorate>
+
+
+ <s:decorate id="nomeField" template="/layout/edit.xhtml">
+ <ui:define name="label">Nome</ui:define>
+ <h:outputText id="nome"
+ size="45"
+ maxlength="45"
+ value="#{nodoHome.instance.nome}">
+ <a:support event="onblur" reRender="nomeField" bypassUpdates="true" ajaxSingle="true"/>
+ </h:outputText>
+ </s:decorate>
+
+
+ <s:decorate id="custoField" template="/layout/edit.xhtml">
+ <ui:define name="label">Custo</ui:define>
+ <h:inputText id="custo"
+ value="#{nodoHome.instance.custo}">
+ <a:support event="onblur" reRender="custoField" bypassUpdates="true" ajaxSingle="true"/>
+ </h:inputText>
+ </s:decorate>
+
+
+ <s:decorate id="tempoField" template="/layout/edit.xhtml">
+ <ui:define name="label">Tempo</ui:define>
+ <h:inputText id="tempo"
+ value="#{nodoHome.instance.tempo}">
+ <a:support event="onblur" reRender="tempoField" bypassUpdates="true" ajaxSingle="true"/>
+ </h:inputText>
+ </s:decorate>
+
+ <div style="clear:both">
+ <span class="required">*</span>
+ required fields
+ </div>
+
+ </rich:panel>
+
+ <div class="actionButtons">
+
+ <h:commandButton id="save"
+ value="Save"
+ action="#{nodoHome.persist}"
+ disabled="#{!nodoHome.wired}"
+ rendered="#{!nodoHome.managed}"/>
+
+ <h:commandButton id="update"
+ value="Save"
+ action="#{nodoHome.update}"
+ rendered="#{nodoHome.managed}"/>
+
+ <s:button id="cancelEdit"
+ value="Cancel"
+ propagation="end"
+ view="/seguro/admin/rede/Nodo.xhtml"
+ rendered="#{nodoHome.managed}"/>
+
+ <s:button id="cancelAdd"
+ value="Cancel"
+ propagation="end"
+ view="/seguro/admin/rede/RedeBayesianaList.xhtml"
+ rendered="#{!nodoHome.managed}"/>
+
+ </div>
+ </h:form>
+
+</ui:define>
+
+</ui:composition>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<page xmlns="http://jboss.com/products/seam/pages"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd">
+
+ <param name="perguntaNodoFrom"/>
+ <param name="perguntaNodoId" value="#{perguntaNodoHome.perguntaNodoId}"/>
+
+
+</page>
--- /dev/null
+<!DOCTYPE composition 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:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ template="/layout/template.xhtml">
+
+<ui:define name="body">
+
+ <rich:panel>
+ <f:facet name="header">Pergunta nodo Details</f:facet>
+
+
+ <s:decorate id="nodoId" template="/layout/display.xhtml">
+ <ui:define name="label">Nodo id</ui:define>
+ <h:outputText value="#{perguntaNodoHome.instance.nodo.id}"/>
+ </s:decorate>
+
+ <s:decorate id="texto" template="/layout/display.xhtml">
+ <ui:define name="label">Texto</ui:define>
+ <h:outputText value="#{perguntaNodoHome.instance.texto}"/>
+ </s:decorate>
+
+ <div style="clear:both"/>
+
+ </rich:panel>
+
+ <div class="actionButtons">
+
+ <s:button view="/seguro/admin/rede/PerguntaNodoEdit.xhtml"
+ id="edit"
+ value="Edit"/>
+
+ <s:button view="/#{empty perguntaNodoFrom ? 'seguro/admin/rede/PerguntaNodoList' : perguntaNodoFrom}.xhtml"
+ id="done"
+ value="Done"/>
+
+ </div>
+
+</ui:define>
+
+</ui:composition>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<page xmlns="http://jboss.com/products/seam/pages"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd"
+ no-conversation-view-id="/seguro/admin/rede/Nodo.xhtml"
+ login-required="true">
+
+ <begin-conversation join="true" flush-mode="MANUAL"/>
+
+ <action execute="#{perguntaNodoHome.wire}"/>
+
+ <param name="perguntaNodoFrom"/>
+ <param name="perguntaNodoId" value="#{perguntaNodoHome.perguntaNodoId}"/>
+
+
+ <navigation from-action="#{perguntaNodoHome.persist}">
+ <rule if-outcome="persisted">
+ <end-conversation/>
+ <redirect view-id="/seguro/admin/rede/PerguntaNodo.xhtml"/>
+ </rule>
+ </navigation>
+
+ <navigation from-action="#{perguntaNodoHome.update}">
+ <rule if-outcome="updated">
+ <end-conversation/>
+ <redirect view-id="/seguro/admin/rede/PerguntaNodo.xhtml"/>
+ </rule>
+ </navigation>
+
+ <navigation from-action="#{perguntaNodoHome.remove}">
+ <rule if-outcome="removed">
+ <end-conversation/>
+ <redirect view-id="/seguro/admin/rede/Nodo.xhtml"/>
+ </rule>
+ </navigation>
+
+</page>
--- /dev/null
+<!DOCTYPE composition 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:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:a="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ template="/layout/template.xhtml">
+
+<ui:define name="body">
+
+ <h:form id="perguntaNodo" styleClass="edit">
+
+ <rich:panel>
+ <f:facet name="header">#{perguntaNodoHome.managed ? 'Edit' : 'Add'} Pergunta nodo</f:facet>
+
+
+
+ <s:decorate id="nodoIdField" template="/layout/edit.xhtml">
+ <ui:define name="label">Nodo</ui:define>
+ <h:inputText id="nodoId"
+ value="#{nodoHome.instance.id}">
+ </h:inputText>
+ </s:decorate>
+
+
+ <s:decorate id="textoField" template="/layout/edit.xhtml">
+ <ui:define name="label">Texto</ui:define>
+ <h:inputTextarea id="texto"
+ cols="80"
+ rows="3"
+ value="#{perguntaNodoHome.instance.texto}"/>
+ </s:decorate>
+
+ <div style="clear:both">
+ <span class="required">*</span>
+ required fields
+ </div>
+
+ </rich:panel>
+
+ <div class="actionButtons">
+
+ <h:commandButton id="save"
+ value="Save"
+ action="#{perguntaNodoHome.persist}"
+ disabled="#{!perguntaNodoHome.wired}"
+ rendered="#{!perguntaNodoHome.managed}"/>
+
+ <h:commandButton id="update"
+ value="Save"
+ action="#{perguntaNodoHome.update}"
+ rendered="#{perguntaNodoHome.managed}"/>
+
+ <h:commandButton id="delete"
+ value="Delete"
+ action="#{perguntaNodoHome.remove}"
+ immediate="true"
+ rendered="#{perguntaNodoHome.managed}"/>
+
+ <s:button id="cancelEdit"
+ value="Cancel"
+ propagation="end"
+ view="/seguro/admin/rede/PerguntaNodo.xhtml"
+ rendered="#{perguntaNodoHome.managed}"/>
+
+ <s:button id="cancelAdd"
+ value="Cancel"
+ propagation="end"
+ view="/#{empty perguntaNodoFrom ? 'seguro/admin/rede/PerguntaNodoList' : perguntaNodoFrom}.xhtml"
+ rendered="#{!perguntaNodoHome.managed}"/>
+
+ </div>
+ </h:form>
+
+</ui:define>
+
+</ui:composition>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<page xmlns="http://jboss.com/products/seam/pages"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd">
+
+ <param name="firstResult" value="#{perguntaNodoList.firstResult}"/>
+ <param name="sort" value="#{perguntaNodoList.orderColumn}"/>
+ <param name="dir" value="#{perguntaNodoList.orderDirection}"/>
+ <param name="logic" value="#{perguntaNodoList.restrictionLogicOperator}"/>
+
+ <param name="from"/>
+ <param name="texto" value="#{perguntaNodoList.perguntaNodo.texto}"/>
+
+</page>
--- /dev/null
+<!DOCTYPE composition 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:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ template="/layout/template.xhtml">
+
+<ui:define name="body">
+
+ <h:form id="perguntaNodoSearch" styleClass="edit">
+
+ <rich:simpleTogglePanel label="PerguntaNodo Search Filter" switchType="ajax">
+
+ <s:decorate template="/layout/display.xhtml">
+ <ui:define name="label">Texto</ui:define>
+ <h:inputText id="texto" value="#{perguntaNodoList.perguntaNodo.texto}"/>
+ </s:decorate>
+
+ <s:decorate template="/layout/display.xhtml">
+ <ui:define name="label">Match</ui:define>
+ <h:selectOneRadio id="logic" value="#{perguntaNodoList.restrictionLogicOperator}" styleClass="radio">
+ <f:selectItem itemLabel="All" itemValue="and"/>
+ <f:selectItem itemLabel="Any" itemValue="or"/>
+ </h:selectOneRadio>
+ </s:decorate>
+
+ </rich:simpleTogglePanel>
+
+ <div class="actionButtons">
+ <h:commandButton id="search" value="Search" action="/seguro/admin/rede/PerguntaNodoList.xhtml"/>
+ <s:button id="reset" value="Reset" includePageParams="false"/>
+ </div>
+
+ </h:form>
+
+ <rich:panel>
+ <f:facet name="header">PerguntaNodo Search Results (#{empty perguntaNodoList.resultList ? 0 : (perguntaNodoList.paginated ? perguntaNodoList.resultCount : perguntaNodoList.resultList.size)})</f:facet>
+ <div class="results" id="perguntaNodoList">
+
+ <h:outputText value="The perguntaNodo search returned no results."
+ rendered="#{empty perguntaNodoList.resultList}"/>
+
+ <rich:dataTable id="perguntaNodoList"
+ var="_perguntaNodo"
+ value="#{perguntaNodoList.resultList}"
+ rendered="#{not empty perguntaNodoList.resultList}">
+ <h:column>
+ <f:facet name="header">
+ <ui:include src="/layout/sort.xhtml">
+ <ui:param name="entityList" value="#{perguntaNodoList}"/>
+ <ui:param name="propertyLabel" value="Id"/>
+ <ui:param name="propertyPath" value="perguntaNodo.id"/>
+ </ui:include>
+ </f:facet>
+ <h:outputText value="#{_perguntaNodo.id}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <ui:include src="/layout/sort.xhtml">
+ <ui:param name="entityList" value="#{perguntaNodoList}"/>
+ <ui:param name="propertyLabel" value="Nodo id"/>
+ <ui:param name="propertyPath" value="perguntaNodo.nodo.id"/>
+ </ui:include>
+ </f:facet>
+ <h:outputText value="#{_perguntaNodo.nodo.id}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <ui:include src="/layout/sort.xhtml">
+ <ui:param name="entityList" value="#{perguntaNodoList}"/>
+ <ui:param name="propertyLabel" value="Texto"/>
+ <ui:param name="propertyPath" value="perguntaNodo.texto"/>
+ </ui:include>
+ </f:facet>
+ <h:outputText value="#{_perguntaNodo.texto}"/>
+ </h:column>
+ <rich:column styleClass="action">
+ <f:facet name="header">Action</f:facet>
+ <s:link view="/#{empty from ? 'seguro/admin/rede/PerguntaNodo' : from}.xhtml"
+ value="#{empty from ? 'View' : 'Select'}"
+ propagation="#{empty from ? 'none' : 'default'}"
+ id="perguntaNodoViewId">
+ <f:param name="perguntaNodoId"
+ value="#{_perguntaNodo.id}"/>
+ </s:link>
+ #{' '}
+ <s:link view="/seguro/admin/rede/PerguntaNodoEdit.xhtml"
+ value="Edit"
+ propagation="none"
+ id="perguntaNodoEdit"
+ rendered="#{empty from}">
+ <f:param name="perguntaNodoId"
+ value="#{_perguntaNodo.id}"/>
+ </s:link>
+ </rich:column>
+ </rich:dataTable>
+
+ </div>
+ </rich:panel>
+
+ <div class="tableControl">
+
+ <s:link view="/seguro/admin/rede/PerguntaNodoList.xhtml"
+ rendered="#{perguntaNodoList.previousExists}"
+ value="#{messages.left}#{messages.left} First Page"
+ id="firstPage">
+ <f:param name="firstResult" value="0"/>
+ </s:link>
+
+ <s:link view="/seguro/admin/rede/PerguntaNodoList.xhtml"
+ rendered="#{perguntaNodoList.previousExists}"
+ value="#{messages.left} Previous Page"
+ id="previousPage">
+ <f:param name="firstResult"
+ value="#{perguntaNodoList.previousFirstResult}"/>
+ </s:link>
+
+ <s:link view="/seguro/admin/rede/PerguntaNodoList.xhtml"
+ rendered="#{perguntaNodoList.nextExists}"
+ value="Next Page #{messages.right}"
+ id="nextPage">
+ <f:param name="firstResult"
+ value="#{perguntaNodoList.nextFirstResult}"/>
+ </s:link>
+
+ <s:link view="/seguro/admin/rede/PerguntaNodoList.xhtml"
+ rendered="#{perguntaNodoList.nextExists}"
+ value="Last Page #{messages.right}#{messages.right}"
+ id="lastPage">
+ <f:param name="firstResult"
+ value="#{perguntaNodoList.lastFirstResult}"/>
+ </s:link>
+
+ </div>
+
+ <s:div styleClass="actionButtons" rendered="#{empty from}">
+ <s:button view="/seguro/admin/rede/PerguntaNodoEdit.xhtml"
+ id="create"
+ propagation="none"
+ value="Create perguntaNodo">
+ <f:param name="perguntaNodoId"/>
+ </s:button>
+ </s:div>
+
+</ui:define>
+
+</ui:composition>
<s:decorate id="nameField" template="/layout/edit.xhtml">
<ui:define name="label">Nome</ui:define>
- <h:inputText id="name" required="true"
+ <h:outputText id="name" required="true"
value="#{redeBayesianaHome.instance.nome}"/>
</s:decorate>
value="#{redeBayesiana.id}"/>
</s:link>
</rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="#{redeBayesiana.nodos.size()} Nodo(s)"></h:outputText>
+ </f:facet>
+ <rich:dataList value="#{redeBayesiana.nodos}" var="_dataListNodos" rendered="#{redeBayesiana.nodos.size()>0}">
+ <h:column>
+ <s:link value="#{_dataListNodos.nome}" view="/seguro/admin/rede/Nodo.xhtml">
+ <f:param name="nodoId" value="${_dataListNodos.id}"/>
+ </s:link>
+ </h:column>
+ </rich:dataList>
+ </rich:column>
<rich:column>
<f:facet name="header">Arquivo</f:facet>
<f:param name="arquivoRedeBayesianaId" value="${redeBayesiana.arquivo.id}" />
</s:link>
<br></br>
- <s:link value="Delete" action="#{arquivoRedeBayesianaHome.remove}">
- <f:param name="arquivoRedeBayesianaId" value="${redeBayesiana.arquivo.id}" />
+ <s:link value="Delete" action="#{redeBayesianaHome.remove}">
+ <f:param name="redeBayesianaId" value="${redeBayesiana.id}" />
</s:link>
</rich:column>
</rich:dataTable>
.setParameter("senha", credentials.getPassword())
.getSingleResult();
} catch (NoResultException ne) {
- log.info("Não encontrou usuário");
+ log.info("N�o encontrou usu�rio");
return false;
}
-log.info("usuario nao é nulo");
+log.info("usuario nao � nulo");
- Iterator rolesIt = entityManager.createQuery("Select reg From Regra as reg inner join reg.grupos gru inner join gru.usuarios usu where usu.id=:idUsuario")
+ Iterator<Regra> rolesIt = entityManager.createQuery("Select reg From Regra as reg inner join reg.grupos gru inner join gru.usuarios usu where usu.id=:idUsuario")
.setParameter("idUsuario", usuario.getId())
.getResultList()
.iterator();
while(rolesIt.hasNext())
- identity.addRole(((Regra) rolesIt.next()).getToken());
+ identity.addRole(rolesIt.next().getToken());
log.info("authenticating {0}", credentials.getUsername());
}
}
- @Override @Begin
+ @Override @Begin(join=true)
public void create() {
super.create();
}
RedeBayesiana rede = new RedeBayesiana();
rede.setNome(name);
rede.setArquivo(super.getInstance());
-
- entityManager.persist(rede);
-
+ ArrayList<Nodo> nodos = new ArrayList<Nodo>();
+
for (int i = 0; i < nodes.size(); i++){
Nodo nodo = new Nodo();
nodo.setNome(nodes.get(i));
nodo.setRedeBayesiana(rede);
entityManager.persist(nodo);
+ nodos.add(nodo);
}
+ rede.setNodos(nodos);
+ entityManager.persist(rede);
super.persist();
}
@Name("arquivoRedeBayesianaList")
public class ArquivoRedeBayesianaList extends SimDeCSEntityQuery<ArquivoRedeBayesiana>
{
- public ArquivoRedeBayesianaList()
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3839477205091884054L;
+
+ public ArquivoRedeBayesianaList()
{
setEjbql("select arquivoRedeBayesiana from ArquivoRedeBayesiana arquivoRedeBayesiana");
}
import javax.faces.model.SelectItem;
import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-
import org.jboss.seam.annotations.In;
-import org.jboss.annotation.factory.*;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Out;
import org.jboss.seam.international.StatusMessages;
import org.jboss.seam.log.Log;
import org.ufcspa.simdecs.entities.Grupo;
if (listaOrigem == null) {
listaOrigem = new ArrayList<SelectItem>();
- /* Criei esse objeto apenas a título de exemplo.
- * Num caso real, você poderia buscar a lista do banco.
+ /* Criei esse objeto apenas a t�tulo de exemplo.
+ * Num caso real, voc� poderia buscar a lista do banco.
*/
Grupo o = new Grupo();
@Name("grupoHome")\r
public class GrupoHome extends SimDeCSEntityHome<Grupo> {\r
\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = 4764263148832027018L;\r
+\r
public void setGrupoId(Long id) {\r
setId(id);\r
}\r
@Name("grupoList")\r
public class GrupoList extends SimDeCSEntityQuery<Grupo> {\r
\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = 3622169468069361029L;\r
+\r
private static final String EJBQL = "select grupo from Grupo grupo";\r
\r
private static final String[] RESTRICTIONS = { "lower(grupo.nome) like lower(concat(#{grupoList.grupo.nome},'%'))", };\r
@Name("instituicaoHome")\r
public class InstituicaoHome extends SimDeCSEntityHome<Instituicao> {\r
\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = -8521176442499809609L;\r
+\r
public void setInstituicaoId(Long id) {\r
setId(id);\r
}\r
@Name("instituicaoList")\r
public class InstituicaoList extends SimDeCSEntityQuery<Instituicao> {\r
\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = -2917808467482202659L;\r
+\r
private static final String EJBQL = "select instituicao from Instituicao instituicao";\r
\r
private static final String[] RESTRICTIONS = {\r
package org.ufcspa.simdecs.session.crud.admin;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.List;
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.ejb.Stateless;
-import javax.faces.model.SelectItem;
import javax.persistence.EntityManager;
-import org.hibernate.loader.custom.Return;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
-import org.jboss.annotation.factory.*;
-import org.jboss.seam.annotations.Begin;
-import org.jboss.seam.annotations.Destroy;
-import org.jboss.seam.annotations.End;
-import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.datamodel.DataModel;
-import org.jboss.seam.annotations.datamodel.DataModelSelection;
import org.jboss.seam.international.StatusMessages;
import org.jboss.seam.log.Log;
-import org.omg.Security.Public;
import org.ufcspa.simdecs.entities.Grupo;
-import org.ufcspa.simdecs.entities.Usuario;
@Name("listBeanPendente")
// @Destroy
// private void destruicaoObrigatoria() {
// // TODO Auto-generated method stub
-// log.info("Cahmado metodo de destruição obrigatoria");
+// log.info("Cahmado metodo de destrui��o obrigatoria");
//
// }
--- /dev/null
+package org.ufcspa.simdecs.session.crud.admin;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.framework.EntityHome;
+import org.ufcspa.simdecs.entities.Nodo;
+
+@Name("nodoHome")
+public class NodoHome extends EntityHome<Nodo> {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 722853289364906655L;
+
+ public void setNodoId(Long id) {
+ setId(id);
+ }
+
+ public Long getNodoId() {
+ return (Long) getId();
+ }
+
+ @Override
+ protected Nodo createInstance() {
+ Nodo nodo = new Nodo();
+ return nodo;
+ }
+
+ public void load() {
+ if (isIdDefined()) {
+ wire();
+ }
+ }
+
+ public void wire() {
+ getInstance();
+ }
+
+ public boolean isWired() {
+ return true;
+ }
+
+ public Nodo getDefinedInstance() {
+ return isIdDefined() ? getInstance() : null;
+ }
+
+}
--- /dev/null
+package org.ufcspa.simdecs.session.crud.admin;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.framework.EntityQuery;
+import org.ufcspa.simdecs.entities.Nodo;
+
+import java.util.Arrays;
+
+@Name("nodoList")
+public class NodoList extends EntityQuery<Nodo> {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 4305188605243779977L;
+
+ private static final String EJBQL = "select nodo from Nodo nodo";
+
+ private static final String[] RESTRICTIONS = { "lower(nodo.nome) like lower(concat(#{nodoList.nodo.nome},'%'))", };
+
+ private Nodo nodo = new Nodo();
+
+ public NodoList() {
+ setEjbql(EJBQL);
+ setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
+ setMaxResults(25);
+ }
+
+ public Nodo getNodo() {
+ return nodo;
+ }
+}
--- /dev/null
+package org.ufcspa.simdecs.session.crud.admin;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.framework.EntityHome;
+import org.ufcspa.simdecs.entities.PerguntaNodo;
+
+@Name("perguntaNodoHome")
+public class PerguntaNodoHome extends EntityHome<PerguntaNodo> {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 74375829986025270L;
+
+ public void setPerguntaNodoId(Long id) {
+ setId(id);
+ }
+
+ public Long getPerguntaNodoId() {
+ return (Long) getId();
+ }
+
+ @Override
+ protected PerguntaNodo createInstance() {
+ PerguntaNodo perguntaNodo = new PerguntaNodo();
+ return perguntaNodo;
+ }
+
+ public void load() {
+ if (isIdDefined()) {
+ wire();
+ }
+ }
+
+ public void wire() {
+ getInstance();
+ }
+
+ public boolean isWired() {
+ return true;
+ }
+
+ public PerguntaNodo getDefinedInstance() {
+ return isIdDefined() ? getInstance() : null;
+ }
+
+}
--- /dev/null
+package org.ufcspa.simdecs.session.crud.admin;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.framework.EntityQuery;
+import org.ufcspa.simdecs.entities.PerguntaNodo;
+
+import java.util.Arrays;
+
+@Name("perguntaNodoList")
+public class PerguntaNodoList extends EntityQuery<PerguntaNodo> {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -8739179110184909334L;
+
+ private static final String EJBQL = "select perguntaNodo from PerguntaNodo perguntaNodo";
+
+ private static final String[] RESTRICTIONS = { "lower(perguntaNodo.texto) like lower(concat(#{perguntaNodoList.perguntaNodo.texto},'%'))", };
+
+ private PerguntaNodo perguntaNodo = new PerguntaNodo();
+
+ public PerguntaNodoList() {
+ setEjbql(EJBQL);
+ setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
+ setMaxResults(25);
+ }
+
+ public PerguntaNodo getPerguntaNodo() {
+ return perguntaNodo;
+ }
+}
@Name("privilegioHome")\r
public class PrivilegioHome extends SimDeCSEntityHome<Privilegio> {\r
\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = -2362914081641360734L;\r
+\r
public void setPrivilegioId(Long id) {\r
setId(id);\r
}\r
@Name("privilegioList")\r
public class PrivilegioList extends SimDeCSEntityQuery<Privilegio> {\r
\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = -2876283560310541559L;\r
+\r
private static final String EJBQL = "select privilegio from Privilegio privilegio";\r
\r
private static final String[] RESTRICTIONS = {\r
@Name("redeBayesianaHome")
public class RedeBayesianaHome extends EntityHome<RedeBayesiana>
{
- @RequestParameter Long redeBayesianaId;
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3958851307369078847L;
+ @RequestParameter Long redeBayesianaId;
@Override
public Object getId()
@Name("redeBayesianaList")
public class RedeBayesianaList extends EntityQuery<RedeBayesiana>
{
- public RedeBayesianaList()
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3591201472381575234L;
+
+ public RedeBayesianaList()
{
setEjbql("select redeBayesiana from RedeBayesiana redeBayesiana");
}
@Name("regraHome")\r
public class RegraHome extends SimDeCSEntityHome<Regra> {\r
\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = 499630688178460740L;\r
+\r
public void setRegraId(Long id) {\r
setId(id);\r
}\r
@Name("regraList")\r
public class RegraList extends SimDeCSEntityQuery<Regra> {\r
\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = -4966244468793558853L;\r
+\r
private static final String EJBQL = "select regra from Regra regra";\r
\r
private static final String[] RESTRICTIONS = {\r
--- /dev/null
+package org.ufcspa.simdecs.session.crud.admin;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.framework.EntityHome;
+import org.ufcspa.simdecs.entities.RespostaNodo;
+
+@Name("respostaNodoHome")
+public class RespostaNodoHome extends EntityHome<RespostaNodo> {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3492778340553592740L;
+
+ public void setRespostaNodoId(Long id) {
+ setId(id);
+ }
+
+ public Long getRespostaNodoId() {
+ return (Long) getId();
+ }
+
+ @Override
+ protected RespostaNodo createInstance() {
+ RespostaNodo respostaNodo = new RespostaNodo();
+ return respostaNodo;
+ }
+
+ public void load() {
+ if (isIdDefined()) {
+ wire();
+ }
+ }
+
+ public void wire() {
+ getInstance();
+ }
+
+ public boolean isWired() {
+ return true;
+ }
+
+ public RespostaNodo getDefinedInstance() {
+ return isIdDefined() ? getInstance() : null;
+ }
+
+}
--- /dev/null
+package org.ufcspa.simdecs.session.crud.admin;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.framework.EntityQuery;
+import org.ufcspa.simdecs.entities.RespostaNodo;
+
+import java.util.Arrays;
+
+@Name("respostaNodoList")
+public class RespostaNodoList extends EntityQuery<RespostaNodo> {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5827278245645390204L;
+
+ private static final String EJBQL = "select respostaNodo from RespostaNodo respostaNodo";
+
+ private static final String[] RESTRICTIONS = { "lower(respostaNodo.texto) like lower(concat(#{respostaNodoList.respostaNodo.texto},'%'))", };
+
+ private RespostaNodo respostaNodo = new RespostaNodo();
+
+ public RespostaNodoList() {
+ setEjbql(EJBQL);
+ setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
+ setMaxResults(25);
+ }
+
+ public RespostaNodo getRespostaNodo() {
+ return respostaNodo;
+ }
+}
package org.ufcspa.simdecs.session.crud.admin;\r
\r
import java.util.Arrays;\r
-import java.util.ArrayList; \r
-import java.util.List;\r
import org.jboss.seam.annotations.Name;\r
import org.ufcspa.simdecs.entities.Grupo;\r
import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery;\r
public class UsuarioGrupoList extends SimDeCSEntityQuery<Grupo> {\r
\r
\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = 6735626710120816714L;\r
private static final String EJBQL = "select grupo From Grupo as grupo inner join grupo.usuarios usu";\r
private static final String[] RESTRICTIONS = { "usu.id= #{usuarioList.usuario.id}"};\r
private Grupo grupo = new Grupo();\r
@Name("usuarioHome")\r
public class UsuarioHome extends SimDeCSEntityHome<Usuario> {\r
\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = 5982275854657550313L;\r
@In(create = true)\r
UsuarioHome usuarioHome;\r
\r
import java.util.List;
import java.util.ArrayList;
import javax.faces.model.SelectItem;
-import javax.faces.model.SelectItemGroup;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.log.Log;
import org.ufcspa.simdecs.entities.Grupo;
private EntityManager entityManager;
// private List<SelectItem> option;
- private List listSelecionada;
+ private List<SelectItem> listSelecionada;
public List<SelectItem> UsuarioLisGrupoPickList()
{
}
} catch (NoResultException ne) {
- log.info("Não encontrou grupo");
+ log.info("N�o encontrou grupo");
// return false;
}
return listaSelect;
- public List getListSelecionada() {
+ public List<SelectItem> getListSelecionada() {
return listSelecionada;
}
- public void setListSelecionada(List listSelecionada) {
+ public void setListSelecionada(List<SelectItem> listSelecionada) {
this.listSelecionada = listSelecionada;
}
}
package org.ufcspa.simdecs.session.crud.admin;\r
\r
import java.util.Arrays;\r
-import java.util.Collection;\r
-import java.util.List;\r
-\r
import org.jboss.seam.annotations.Name;\r
import org.ufcspa.simdecs.entities.Usuario;\r
-import org.ufcspa.simdecs.entities.Grupo;\r
import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery;\r
\r
-import com.lowagie.text.pdf.hyphenation.TernaryTree.Iterator;\r
-\r
@Name("usuarioList")\r
public class UsuarioList extends SimDeCSEntityQuery<Usuario> {\r
\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = 6934697367391562708L;\r
+\r
private static final String EJBQL = "select usuario from Usuario usuario";\r
\r
private static final String[] RESTRICTIONS = {\r
\r
public abstract class SimDeCSEntityHome<E> extends EntityHome<E> {\r
\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = 1123566132353938157L;\r
+\r
protected void initDefaultMessages()\r
{\r
super.initDefaultMessages();\r
\r
public abstract class SimDeCSEntityQuery<E> extends EntityQuery<E> {\r
\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = 606413297188669078L;\r
+\r
\r
}\r
public String getContentType() { return this.contentType; }
public void setContentType(String contentType) { this.contentType = contentType; }
+
+
@Lob
@Column(length = 2147483647)
@Basic(fetch = FetchType.LAZY)
package org.ufcspa.simdecs.entities;\r
\r
import java.io.Serializable;\r
-import java.util.Collection;\r
import java.util.List;\r
\r
import javax.persistence.Column;\r
package org.ufcspa.simdecs.entities;
import java.io.Serializable;
+import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.Index;
@JoinColumn(name = "redeBayesiana_id", referencedColumnName = "id", nullable = true)
@Index(name="nodo_redeBayesiana_fk_i")
private RedeBayesiana redeBayesiana;
+
+ @OneToMany(cascade=CascadeType.ALL)
+ @JoinTable( name = "NodoPergunta",
+ joinColumns = {@JoinColumn(name = "nodo_id")},
+ inverseJoinColumns = {@JoinColumn(name = "pergunta_id")},
+ uniqueConstraints={@UniqueConstraint(columnNames={"nodo_id", "pergunta_id"})})
+ private List<PerguntaNodo> perguntas;
public Long getId() {
return id;
this.redeBayesiana = rede;
}
+ public List<PerguntaNodo> getPerguntas() {
+ return perguntas;
+ }
+ public void setPerguntas(List<PerguntaNodo> perguntas) {
+ this.perguntas = perguntas;
+ }
public String toString() {
return id + " - " + nome;
}
package org.ufcspa.simdecs.entities;
import java.io.Serializable;
+import java.util.List;
+import javax.persistence.CascadeType;
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.JoinTable;
import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.Index;
@Index(name="pergunta_nodo_fk_i")
private Nodo nodo;
+ @OneToMany(cascade=CascadeType.ALL)
+ @JoinTable( name = "PerguntaResposta",
+ joinColumns = {@JoinColumn(name = "pergunta_id")},
+ inverseJoinColumns = {@JoinColumn(name = "resposta_id")},
+ uniqueConstraints={@UniqueConstraint(columnNames={"pergunta_id", "resposta_id"})})
+ private List<RespostaNodo> respostas;
+
public Long getId() {
return id;
}
return nodo;
}
- public void getNodo(Nodo nodo) {
+ public void setNodo(Nodo nodo) {
this.nodo = nodo;
}
+ public List<RespostaNodo> getRespostas() {
+ return respostas;
+ }
+ public void setRespostas(List<RespostaNodo> respostas) {
+ this.respostas = respostas;
+ }
public String toString() {
return id + " - " + texto;
}
import java.io.Serializable;
import java.util.Collection;
+import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
+import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
private ArquivoRedeBayesiana arquivo;
public ArquivoRedeBayesiana getArquivo() { return arquivo; }
public void setArquivo(ArquivoRedeBayesiana arquivo) { this.arquivo = arquivo; }
+
+ @OneToMany(cascade=CascadeType.ALL)
+ @JoinTable( name = "RedeBayesianaNodo",
+ joinColumns = {@JoinColumn(name = "rede_id")},
+ inverseJoinColumns = {@JoinColumn(name = "nodo_id")},
+ uniqueConstraints={@UniqueConstraint(columnNames={"rede_id", "nodo_id"})})
+ private List<Nodo> nodos;
public Long getId() {
this.faixasEtarias = faixasEtarias;
}
+ public List<Nodo> getNodos() {
+ return nodos;
+ }
+ public void setNodos(List<Nodo> nodos) {
+ this.nodos = nodos;
+ }
+
@Override
public int hashCode() {
final int prime = 31;
package org.ufcspa.simdecs.entities;\r
\r
import java.io.Serializable;\r
-import java.util.Collection;\r
import java.util.Date;\r
import java.util.List;\r
\r
if (sexo.equals("F") || sexo.equals("M"))\r
this.sexo = sexo;\r
else\r
- throw new InvalidSexoException("O sexo deverá ser 'F' ou 'M'!");\r
+ throw new InvalidSexoException("O sexo dever� ser 'F' ou 'M'!");\r
}\r
\r
public String getTelefone() {\r