Adicionadas perguntas aos nodos.
authorMichele Silva <michele.silva@gmail.com>
Mon, 28 Nov 2011 06:40:12 +0000 (04:40 -0200)
committerMichele Silva <michele.silva@gmail.com>
Mon, 28 Nov 2011 06:40:12 +0000 (04:40 -0200)
46 files changed:
SimDeCS/WebContent/seguro/admin/rede/ArquivoRedeBayesiana.xhtml
SimDeCS/WebContent/seguro/admin/rede/Nodo.page.xml [new file with mode: 0644]
SimDeCS/WebContent/seguro/admin/rede/Nodo.xhtml [new file with mode: 0644]
SimDeCS/WebContent/seguro/admin/rede/NodoEdit.page.xml [new file with mode: 0644]
SimDeCS/WebContent/seguro/admin/rede/NodoEdit.xhtml [new file with mode: 0644]
SimDeCS/WebContent/seguro/admin/rede/PerguntaNodo.page.xml [new file with mode: 0644]
SimDeCS/WebContent/seguro/admin/rede/PerguntaNodo.xhtml [new file with mode: 0644]
SimDeCS/WebContent/seguro/admin/rede/PerguntaNodoEdit.page.xml [new file with mode: 0644]
SimDeCS/WebContent/seguro/admin/rede/PerguntaNodoEdit.xhtml [new file with mode: 0644]
SimDeCS/WebContent/seguro/admin/rede/PerguntaNodoList.page.xml [new file with mode: 0644]
SimDeCS/WebContent/seguro/admin/rede/PerguntaNodoList.xhtml [new file with mode: 0644]
SimDeCS/WebContent/seguro/admin/rede/RedeBayesiana.xhtml
SimDeCS/WebContent/seguro/admin/rede/RedeBayesianaList.xhtml
SimDeCS/src/hot/org/ufcspa/simdecs/session/Authenticator.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/ArquivoRedeBayesianaHome.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/ArquivoRedeBayesianaList.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/Bean.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/GrupoHome.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/GrupoList.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/InstituicaoHome.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/InstituicaoList.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/ListBeanPendente.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/NodoHome.java [new file with mode: 0644]
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/NodoList.java [new file with mode: 0644]
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/PerguntaNodoHome.java [new file with mode: 0644]
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/PerguntaNodoList.java [new file with mode: 0644]
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/PrivilegioHome.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/PrivilegioList.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RedeBayesianaHome.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RedeBayesianaList.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RegraHome.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RegraList.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RespostaNodoHome.java [new file with mode: 0644]
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RespostaNodoList.java [new file with mode: 0644]
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioGrupoList.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioHome.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioLisGrupoPickList.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioList.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/defaults/SimDeCSEntityHome.java
SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/defaults/SimDeCSEntityQuery.java
SimDeCS/src/main/org/ufcspa/simdecs/entities/ArquivoRedeBayesiana.java
SimDeCS/src/main/org/ufcspa/simdecs/entities/Grupo.java
SimDeCS/src/main/org/ufcspa/simdecs/entities/Nodo.java
SimDeCS/src/main/org/ufcspa/simdecs/entities/PerguntaNodo.java
SimDeCS/src/main/org/ufcspa/simdecs/entities/RedeBayesiana.java
SimDeCS/src/main/org/ufcspa/simdecs/entities/Usuario.java

index 0fbbfd0..31735ea 100644 (file)
@@ -55,7 +55,7 @@
                                </h:commandButton>
                                <s:button propagation="end" 
                           id="done" 
-                          value="Concluído"
+                          value="Voltar"
                           view="/seguro/admin/rede/RedeBayesianaList.xhtml"/>
                        </div>
 
diff --git a/SimDeCS/WebContent/seguro/admin/rede/Nodo.page.xml b/SimDeCS/WebContent/seguro/admin/rede/Nodo.page.xml
new file mode 100644 (file)
index 0000000..f4d26a1
--- /dev/null
@@ -0,0 +1,10 @@
+<?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>
diff --git a/SimDeCS/WebContent/seguro/admin/rede/Nodo.xhtml b/SimDeCS/WebContent/seguro/admin/rede/Nodo.xhtml
new file mode 100644 (file)
index 0000000..70eb213
--- /dev/null
@@ -0,0 +1,76 @@
+<!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>
diff --git a/SimDeCS/WebContent/seguro/admin/rede/NodoEdit.page.xml b/SimDeCS/WebContent/seguro/admin/rede/NodoEdit.page.xml
new file mode 100644 (file)
index 0000000..ad3e1cd
--- /dev/null
@@ -0,0 +1,37 @@
+<?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>
diff --git a/SimDeCS/WebContent/seguro/admin/rede/NodoEdit.xhtml b/SimDeCS/WebContent/seguro/admin/rede/NodoEdit.xhtml
new file mode 100644 (file)
index 0000000..889df93
--- /dev/null
@@ -0,0 +1,94 @@
+<!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>
diff --git a/SimDeCS/WebContent/seguro/admin/rede/PerguntaNodo.page.xml b/SimDeCS/WebContent/seguro/admin/rede/PerguntaNodo.page.xml
new file mode 100644 (file)
index 0000000..b2ab3c7
--- /dev/null
@@ -0,0 +1,10 @@
+<?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>
diff --git a/SimDeCS/WebContent/seguro/admin/rede/PerguntaNodo.xhtml b/SimDeCS/WebContent/seguro/admin/rede/PerguntaNodo.xhtml
new file mode 100644 (file)
index 0000000..ad7c5fd
--- /dev/null
@@ -0,0 +1,45 @@
+<!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>
diff --git a/SimDeCS/WebContent/seguro/admin/rede/PerguntaNodoEdit.page.xml b/SimDeCS/WebContent/seguro/admin/rede/PerguntaNodoEdit.page.xml
new file mode 100644 (file)
index 0000000..d73c8e8
--- /dev/null
@@ -0,0 +1,37 @@
+<?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>
diff --git a/SimDeCS/WebContent/seguro/admin/rede/PerguntaNodoEdit.xhtml b/SimDeCS/WebContent/seguro/admin/rede/PerguntaNodoEdit.xhtml
new file mode 100644 (file)
index 0000000..2d1eb00
--- /dev/null
@@ -0,0 +1,80 @@
+<!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>
diff --git a/SimDeCS/WebContent/seguro/admin/rede/PerguntaNodoList.page.xml b/SimDeCS/WebContent/seguro/admin/rede/PerguntaNodoList.page.xml
new file mode 100644 (file)
index 0000000..b39477f
--- /dev/null
@@ -0,0 +1,14 @@
+<?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>
diff --git a/SimDeCS/WebContent/seguro/admin/rede/PerguntaNodoList.xhtml b/SimDeCS/WebContent/seguro/admin/rede/PerguntaNodoList.xhtml
new file mode 100644 (file)
index 0000000..373aed0
--- /dev/null
@@ -0,0 +1,150 @@
+<!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>
index 73a83e1..667c6a3 100644 (file)
@@ -17,7 +17,7 @@
 
             <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>
 
index f8cca35..f63ce26 100644 (file)
                                 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>
@@ -52,8 +64,8 @@
                                    <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>
index 6c642e8..c2723b0 100644 (file)
@@ -35,19 +35,19 @@ log.info("entrou no metodo autenticate");
                                                                                .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());
index f596269..0d72208 100644 (file)
@@ -42,7 +42,7 @@ public class ArquivoRedeBayesianaHome extends SimDeCSEntityHome<ArquivoRedeBayes
         }
     }
 
-    @Override @Begin
+    @Override @Begin(join=true) 
     public void create() {
         super.create();
     }
@@ -57,16 +57,18 @@ public class ArquivoRedeBayesianaHome extends SimDeCSEntityHome<ArquivoRedeBayes
                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();
     }
 
index 43f894e..410d3ea 100644 (file)
@@ -7,7 +7,12 @@ import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery;
 @Name("arquivoRedeBayesianaList")
 public class ArquivoRedeBayesianaList extends SimDeCSEntityQuery<ArquivoRedeBayesiana>
 {
-    public ArquivoRedeBayesianaList()
+    /**
+        * 
+        */
+       private static final long serialVersionUID = 3839477205091884054L;
+
+       public ArquivoRedeBayesianaList()
     {
         setEjbql("select arquivoRedeBayesiana from ArquivoRedeBayesiana arquivoRedeBayesiana");
     }
index c675043..8cc12a0 100644 (file)
@@ -5,14 +5,10 @@ import java.util.List;
 
 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;
@@ -57,8 +53,8 @@ public class Bean
        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();
index f227feb..664f2d7 100644 (file)
@@ -7,6 +7,11 @@ import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome;
 @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
index 6c47fe8..6855331 100644 (file)
@@ -9,6 +9,11 @@ import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery;
 @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
index 0ec8ff9..0d2fa03 100644 (file)
@@ -7,6 +7,11 @@ import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome;
 @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
index 91ddd83..32118e1 100644 (file)
@@ -9,6 +9,11 @@ import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery;
 @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
index 36a8fd2..b6fe07d 100644 (file)
@@ -1,34 +1,18 @@
 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")
@@ -98,7 +82,7 @@ public class 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");
 //
 //     }
 
diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/NodoHome.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/NodoHome.java
new file mode 100644 (file)
index 0000000..86c787f
--- /dev/null
@@ -0,0 +1,47 @@
+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;
+       }
+
+}
diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/NodoList.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/NodoList.java
new file mode 100644 (file)
index 0000000..1bed307
--- /dev/null
@@ -0,0 +1,32 @@
+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;
+       }
+}
diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/PerguntaNodoHome.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/PerguntaNodoHome.java
new file mode 100644 (file)
index 0000000..e93a957
--- /dev/null
@@ -0,0 +1,47 @@
+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;
+       }
+
+}
diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/PerguntaNodoList.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/PerguntaNodoList.java
new file mode 100644 (file)
index 0000000..c75347b
--- /dev/null
@@ -0,0 +1,32 @@
+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;
+       }
+}
index 07dd39c..c1cff24 100644 (file)
@@ -7,6 +7,11 @@ import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome;
 @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
index 95e2271..5e7c550 100644 (file)
@@ -9,6 +9,11 @@ import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery;
 @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
index 23562d5..a236426 100644 (file)
@@ -10,7 +10,11 @@ import org.ufcspa.simdecs.entities.RedeBayesiana;
 @Name("redeBayesianaHome")
 public class RedeBayesianaHome extends EntityHome<RedeBayesiana>
 {
-    @RequestParameter Long redeBayesianaId;
+    /**
+        * 
+        */
+       private static final long serialVersionUID = 3958851307369078847L;
+       @RequestParameter Long redeBayesianaId;
 
     @Override
     public Object getId()
index 727c122..9064b7f 100644 (file)
@@ -7,7 +7,12 @@ import org.ufcspa.simdecs.entities.RedeBayesiana;
 @Name("redeBayesianaList")
 public class RedeBayesianaList extends EntityQuery<RedeBayesiana>
 {
-    public RedeBayesianaList()
+    /**
+        * 
+        */
+       private static final long serialVersionUID = -3591201472381575234L;
+
+       public RedeBayesianaList()
     {
         setEjbql("select redeBayesiana from RedeBayesiana redeBayesiana");
     }
index 22ce650..bf5b084 100644 (file)
@@ -7,6 +7,11 @@ import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome;
 @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
index 159b8d7..8cec6bc 100644 (file)
@@ -9,6 +9,11 @@ import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery;
 @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
diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RespostaNodoHome.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RespostaNodoHome.java
new file mode 100644 (file)
index 0000000..ca841f0
--- /dev/null
@@ -0,0 +1,47 @@
+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;
+       }
+
+}
diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RespostaNodoList.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RespostaNodoList.java
new file mode 100644 (file)
index 0000000..1390665
--- /dev/null
@@ -0,0 +1,32 @@
+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;
+       }
+}
index a6ba07c..6c48309 100644 (file)
@@ -1,8 +1,6 @@
 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
@@ -11,6 +9,10 @@ import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery;
 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
index 314dc27..fd560a5 100644 (file)
@@ -8,6 +8,10 @@ import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome;
 @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
index bad7e0e..0bec548 100644 (file)
@@ -3,11 +3,9 @@ package org.ufcspa.simdecs.session.crud.admin;
 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;
@@ -23,7 +21,7 @@ public class UsuarioLisGrupoPickList
     
     private EntityManager entityManager;
    // private List<SelectItem> option;  
-    private List listSelecionada;
+    private List<SelectItem> listSelecionada;
 
     public List<SelectItem> UsuarioLisGrupoPickList()
     {
@@ -48,7 +46,7 @@ public class UsuarioLisGrupoPickList
             }  
                
        } catch (NoResultException ne) {
-               log.info("Não encontrou grupo");                
+               log.info("N�o encontrou grupo");              
        //      return false;
        }
         return listaSelect;  
@@ -58,11 +56,11 @@ public class UsuarioLisGrupoPickList
 
     
 
-    public List getListSelecionada() {  
+    public List<SelectItem> getListSelecionada() {  
         return listSelecionada;  
     }  
   
-    public void setListSelecionada(List listSelecionada) {  
+    public void setListSelecionada(List<SelectItem> listSelecionada) {  
         this.listSelecionada = listSelecionada;  
     }  
 }
index 6bb44e9..8cd73d4 100644 (file)
@@ -1,19 +1,18 @@
 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
index f441e18..d8dc0f6 100644 (file)
@@ -5,6 +5,11 @@ import org.jboss.seam.framework.EntityHome;
 \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
index a5b9ab9..1d8267a 100644 (file)
@@ -4,5 +4,10 @@ import org.jboss.seam.framework.EntityQuery;
 \r
 public abstract class SimDeCSEntityQuery<E> extends EntityQuery<E> {\r
 \r
+       /**\r
+        * \r
+        */\r
+       private static final long serialVersionUID = 606413297188669078L;\r
+\r
        \r
 }\r
index 24fbcd5..e49e6d5 100644 (file)
@@ -35,6 +35,8 @@ public class ArquivoRedeBayesiana implements java.io.Serializable {
        public String getContentType() { return this.contentType; }
        public void setContentType(String contentType) { this.contentType = contentType; }
        
+       
+       
        @Lob
        @Column(length = 2147483647)
        @Basic(fetch = FetchType.LAZY)
index 7739649..2c31d4e 100644 (file)
@@ -1,7 +1,6 @@
 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
index 22ff69a..fabfc34 100644 (file)
@@ -1,6 +1,7 @@
 package org.ufcspa.simdecs.entities;
 
 import java.io.Serializable;
+import java.util.List;
 
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
@@ -9,9 +10,12 @@ 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;
 
@@ -40,6 +44,13 @@ public class Nodo implements Serializable {
     @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;
@@ -74,6 +85,12 @@ public class Nodo implements Serializable {
                this.redeBayesiana = rede;
        }
 
+       public List<PerguntaNodo> getPerguntas() {
+               return perguntas;
+       }
+       public void setPerguntas(List<PerguntaNodo> perguntas) {
+               this.perguntas = perguntas;
+       }
        public String toString() {
                return id + " - " + nome;
        }
index a0fba2b..bcac879 100644 (file)
@@ -1,16 +1,21 @@
 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;
 
@@ -34,6 +39,13 @@ public class PerguntaNodo implements Serializable {
     @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;
        }
@@ -51,10 +63,16 @@ public class PerguntaNodo implements Serializable {
                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;
        }
index 6eb59d9..6ebebe6 100644 (file)
@@ -2,6 +2,7 @@ package org.ufcspa.simdecs.entities;
 
 import java.io.Serializable;
 import java.util.Collection;
+import java.util.List;
 
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
@@ -12,6 +13,7 @@ import javax.persistence.GeneratedValue;
 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;
@@ -54,6 +56,13 @@ public class RedeBayesiana implements Serializable
        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() {
@@ -96,6 +105,13 @@ public class RedeBayesiana implements Serializable
                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;
index 5601f20..9263738 100644 (file)
@@ -1,7 +1,6 @@
 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
@@ -136,7 +135,7 @@ public class Usuario implements Serializable {
                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