<h:outputStylesheet name="css/jsfcrud.css"/>
</h:head>
<h:body>
- <h:outputLabel> <h1>SimDeCS - Cadastro de Redes Bayesianas</h1> </h:outputLabel>
- <h:panelGrid>
+ <h:outputLabel> <h1>SimDeCS - Cadastro de Redes Bayesianas</h1> </h:outputLabel>
+ <h:panelGroup id="messagePanel" layout="block">
+ <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
+ </h:panelGroup>
+ <p:tabView id="tabView">
+ <p:tab id="tab1" title="Redes Bayesianas">
<h:form>
<p:fileUpload widgetVar="uploader" height="48" width="48"
- fileUploadListener="#{fileUploadController.handleFileUpload}"
- image="/img/bn/browse.png" customUI="true"
- multiple="true" label="Selecione..." allowTypes="*.xml;" description="Images"
- update="tabView"/>
+ fileUploadListener="#{fileUploadController.handleFileUpload}"
+ image="/img/bn/browse.png" customUI="true"
+ multiple="true" label="Selecione..." allowTypes="*.xml;" description="Images"
+ update="tabView"/>
<h:outputLink value="#" title="Upload" onclick="uploader.upload();"
- style="font-weight:bold;color:#616D7E">Enviar Redes Bayesianas
+ style="font-weight:bold;color:#616D7E">Enviar Redes Bayesianas
</h:outputLink>
</h:form>
- </h:panelGrid>
- <h:panelGroup id="messagePanel" layout="block">
- <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
- </h:panelGroup>
- <p:tabView id="tabView">
+ <h:form>
+ <br></br>
+ <h:commandLink action="#{bayesianNetworkController.recreateModel}" value="Atualizar tabela"/>
+ </h:form>
+ <h:panelGrid columns="2" cellpadding="10">
+ <h:outputText escape="false" value="#{bundle.ListBayesianNetworkEmpty}" rendered="#{bayesianNetworkController.items.rowCount == 0}"/>
+ <h:panelGroup rendered="#{bayesianNetworkController.items.rowCount > 0}">
- <p:tab id="tab1" title="Redes Bayesianas">
- <h:form>
- <br></br>
- <h:commandLink action="#{bayesianNetworkController.prepareList}" value="Atualizar tabela"/>
- </h:form>
- <h:panelGrid columns="2" cellpadding="10">
- <h:outputText escape="false" value="#{bundle.ListBayesianNetworkEmpty}" rendered="#{bayesianNetworkController.items.rowCount == 0}"/>
- <h:panelGroup rendered="#{bayesianNetworkController.items.rowCount > 0}">
+ <h:form id="fBayesianNetworkList">
+ <p:dataTable var="bayesianNetwork" value="#{bayesianNetworkController.items}" id="bayesianNetworkList"
+ paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
+ rowEditListener="#{bayesianNetworkController.rowEditListener}">
+ <p:column headerText="id">
+ <h:outputText value="#{bayesianNetwork.id}"/>
+ </p:column>
- <h:form id="fBayesianNetworkList">
+ <p:column headerText="Nome">
+ <p:cellEditor>
+ <f:facet name="output">
+ <h:outputText value="#{bayesianNetwork.name}"/>
+ </f:facet>
+ <f:facet name="input">
+ <p:inputText value="#{bayesianNetwork.name}"/>
+ </f:facet>
+ </p:cellEditor>
+ </p:column>
+ <p:column headerText="Opções">
+ <p:rowEditor />
+ <h:commandLink action="#{bayesianNetworkController.destroy}" >
+ <h:graphicImage value="/img/bn/remove.png" />
+ </h:commandLink>
+ </p:column>
+ </p:dataTable>
+ </h:form>
+ </h:panelGroup>
+ </h:panelGrid>
+ </p:tab>
- <p:dataTable var="bayesianNetwork" value="#{bayesianNetworkController.items}" id="bayesianNetworkList"
+ <p:tab id="tab2" title="Nodos">
+ <h:form>
+ <br></br>
+ <h:commandLink action="#{nodeController.recreateModel}" value="Atualizar tabela"/>
+ </h:form>
+ <h:outputText escape="false" value="#{bundle.ListNodeEmpty}" rendered="#{nodeController.items.rowCount == 0}"/>
+ <h:panelGroup rendered="#{nodeController.items.rowCount > 0}">
+ <h:form>
+ <p:dataTable var="node" value="#{nodeController.items}" id="nodeList"
paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
- rowEditListener="#{bayesianNetworkController.rowEditListener}">
- <p:column headerText="id">
- <h:outputText value="#{bayesianNetwork.id}"/>
+ rowEditListener="#{nodeController.rowEditListener}">
+
+ <p:column headerText="id">
+ <h:outputText value="#{node.id}" />
</p:column>
<p:column headerText="Nome">
<p:cellEditor>
<f:facet name="output">
- <h:outputText value="#{bayesianNetwork.name}"/>
+ <h:outputText value="#{node.name}" />
</f:facet>
<f:facet name="input">
- <p:inputText value="#{bayesianNetwork.name}"/>
+ <p:inputText value="#{node.name}" style="width:100%"/>
</f:facet>
</p:cellEditor>
- </p:column>
+ </p:column>
+ <p:column headerText="Tempo">
+ <p:cellEditor>
+ <f:facet name="output">
+ <h:outputText value="#{node.time}" />
+ </f:facet>
+ <f:facet name="input">
+ <p:inputText value="#{node.time}" style="width:100%"/>
+ </f:facet>
+ </p:cellEditor>
+ </p:column>
+ <p:column headerText="Custo">
+ <p:cellEditor>
+ <f:facet name="output">
+ <h:outputText value="#{node.cost}" />
+ </f:facet>
+ <f:facet name="input">
+ <p:inputText value="#{node.cost}" style="width:100%"/>
+ </f:facet>
+ </p:cellEditor>
+ </p:column>
+ <p:column headerText="Classificação">
+ <p:cellEditor>
+ <f:facet name="output">
+ <h:outputText value="#{node.nodeType}" />
+ </f:facet>
+ <f:facet name="input">
+ <h:selectOneMenu value="#{node.nodeType}" >
+ <f:selectItems value="#{nodeTypeController.nodeTypes}"
+ var="nodeType"
+ itemLabel="#{nodeType}"
+ itemValue="#{nodeType}" />
+ </h:selectOneMenu>
+ </f:facet>
+ </p:cellEditor>
+ </p:column>
+ <p:column headerText="Tipo">
+ <p:cellEditor>
+ <f:facet name="output">
+ <h:outputText value="#{node.nodeRole}" />
+ </f:facet>
+ <f:facet name="input">
+ <h:selectOneMenu value="#{node.nodeRole}" >
+ <f:selectItems value="#{nodeRoleController.nodeRoles}"
+ var="nodeType"
+ itemLabel="#{nodeRole}"
+ itemValue="#{nodeRole}" />
+ </h:selectOneMenu>
+ </f:facet>
+ </p:cellEditor>
+ </p:column>
+ <p:column headerText="Rede Bayesiana">
+ <h:outputText value="#{node.bayesianNetwork.name}"/>
+ </p:column>
+
+
<p:column headerText="Opções">
<p:rowEditor />
- <h:commandLink action="#{bayesianNetworkController.destroy}" >
+ <h:commandLink action="#{nodeController.destroy}" >
<h:graphicImage value="/img/bn/remove.png" />
</h:commandLink>
</p:column>
</p:dataTable>
- </h:form>
-
+ </h:form>
</h:panelGroup>
- </h:panelGrid>
- </p:tab>
-
- <p:tab id="tab2" title="Nodos">
- <h:form>
- <br></br>
- <h:commandLink action="#{nodeController.prepareList}" value="Atualizar tabela"/>
- </h:form>
- <h:outputText escape="false" value="#{bundle.ListNodeEmpty}" rendered="#{nodeController.items.rowCount == 0}"/>
- <h:panelGroup rendered="#{nodeController.items.rowCount > 0}">
- <h:form>
- <p:dataTable var="node" value="#{nodeController.items}" id="nodeList"
- paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
- rowEditListener="#{nodeController.rowEditListener}">
-
- <p:column headerText="id">
- <h:outputText value="#{node.id}" />
- </p:column>
-
- <p:column headerText="Nome">
- <p:cellEditor>
- <f:facet name="output">
- <h:outputText value="#{node.name}" />
- </f:facet>
- <f:facet name="input">
- <p:inputText value="#{node.name}" style="width:100%"/>
- </f:facet>
- </p:cellEditor>
- </p:column>
- <p:column headerText="Tempo">
- <p:cellEditor>
- <f:facet name="output">
- <h:outputText value="#{node.time}" />
- </f:facet>
- <f:facet name="input">
- <p:inputText value="#{node.time}" style="width:100%"/>
- </f:facet>
- </p:cellEditor>
- </p:column>
- <p:column headerText="Custo">
- <p:cellEditor>
- <f:facet name="output">
- <h:outputText value="#{node.cost}" />
- </f:facet>
- <f:facet name="input">
- <p:inputText value="#{node.cost}" style="width:100%"/>
- </f:facet>
- </p:cellEditor>
- </p:column>
- <p:column headerText="Classificação">
- <p:cellEditor>
- <f:facet name="output">
- <h:outputText value="#{node.nodeType}" />
- </f:facet>
- <f:facet name="input">
- <h:selectOneMenu value="#{node.nodeType}" >
- <f:selectItems value="#{nodeTypeController.nodeTypes}"
- var="nodeType"
- itemLabel="#{nodeType}"
- itemValue="#{nodeType}" />
- </h:selectOneMenu>
- </f:facet>
- </p:cellEditor>
- </p:column>
- <p:column headerText="Tipo">
- <p:cellEditor>
- <f:facet name="output">
- <h:outputText value="#{node.nodeRole}" />
- </f:facet>
- <f:facet name="input">
- <h:selectOneMenu value="#{node.nodeRole}" >
- <f:selectItems value="#{nodeRoleController.nodeRoles}"
- var="nodeType"
- itemLabel="#{nodeRole}"
- itemValue="#{nodeRole}" />
- </h:selectOneMenu>
- </f:facet>
- </p:cellEditor>
- </p:column>
- <p:column headerText="Rede Bayesiana">
- <h:outputText value="#{node.bayesianNetwork.name}"/>
- </p:column>
+ <h:form>
+ <br></br>
+ <h:commandLink action="/bn/node/Create.xhtml" value="Criar novo nodo"/>
+ </h:form>
+ </p:tab>
+
+ <p:tab id="tab3" title="Perguntas">
+ <h:form>
+ <br></br>
+ <h:commandLink action="#{questionController.recreateModel}" value="Atualizar tabela"/>
+ </h:form>
+ <h:form>
+ <h:outputText escape="false" value="#{bundle.ListQuestionEmpty}" rendered="#{questionController.items.rowCount == 0}"/>
+ <h:panelGroup rendered="#{questionController.items.rowCount > 0}">
+ <p:dataTable var="question" value="#{questionController.items}" id="questionList"
+ paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
+ rowEditListener="#{questionController.rowEditListener}">
+ <p:column headerText="id">
+ <h:outputText value="#{question.id}" />
+ </p:column>
- <p:column headerText="Opções">
- <p:rowEditor />
- </p:column>
+ <p:column headerText="Texto">
+ <p:cellEditor>
+ <f:facet name="output">
+ <h:outputText value="#{question.text}" />
+ </f:facet>
+ <f:facet name="input">
+ <p:inputText value="#{question.text}" style="width:100%"/>
+ </f:facet>
+ </p:cellEditor>
+ </p:column>
+ <p:column headerText="Nodo">
+ <h:outputText value="#{question.node.name}"/>
+ </p:column>
+ <p:column headerText="Rede Bayesiana">
+ <h:outputText value="#{question.node.bayesianNetwork.name}"/>
+ </p:column>
+ <p:column headerText="Opções">
+ <p:rowEditor />
+ <h:commandLink action="#{questionController.destroy}" >
+ <h:graphicImage value="/img/bn/remove.png" />
+ </h:commandLink>
+ </p:column>
- </p:dataTable>
+ </p:dataTable>
+ </h:panelGroup>
</h:form>
- </h:panelGroup>
- <h:form>
- <br></br>
- <h:commandLink action="/bn/node/Create.xhtml" value="Criar novo nodo"/>
- </h:form>
-
- </p:tab>
- <p:tab id="tab3" title="Perguntas">
- <h:form>
- <br></br>
- <h:commandLink action="#{questionController.prepareList}" value="Atualizar tabela"/>
- </h:form>
- <h:form>
- <h:outputText escape="false" value="#{bundle.ListQuestionEmpty}" rendered="#{questionController.items.rowCount == 0}"/>
- <h:panelGroup rendered="#{questionController.items.rowCount > 0}">
- <p:dataTable var="question" value="#{questionController.items}" id="questionList"
- paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
- rowEditListener="#{questionController.rowEditListener}">
-
- <p:column headerText="id">
- <h:outputText value="#{question.id}" />
- </p:column>
-
- <p:column headerText="Texto">
- <p:cellEditor>
- <f:facet name="output">
- <h:outputText value="#{question.text}" />
- </f:facet>
- <f:facet name="input">
- <p:inputText value="#{question.text}" style="width:100%"/>
- </f:facet>
- </p:cellEditor>
- </p:column>
- <p:column headerText="Nodo">
- <h:outputText value="#{question.node.name}"/>
- </p:column>
- <p:column headerText="Rede Bayesiana">
- <h:outputText value="#{question.node.bayesianNetwork.name}"/>
- </p:column>
-
-
- <p:column headerText="Opções">
- <p:rowEditor />
- <h:commandLink action="#{bayesianNetworkController.destroy}" >
- <h:graphicImage value="/img/bn/remove.png" />
- </h:commandLink>
- </p:column>
-
- </p:dataTable>
- </h:panelGroup>
- </h:form>
-
- <h:form>
- <br></br>
- <h:commandLink action="/bn/question/Create.xhtml" value="Criar nova pergunta"/>
- </h:form>
- </p:tab>
- <p:tab id="tab4" title="Respostas">
- <h:form>
- <br></br>
- <h:commandLink action="#{answerController.prepareList}" value="Atualizar tabela"/>
- </h:form>
- <h:form>
- <h:outputText escape="false" value="#{bundle.ListAnswerEmpty}" rendered="#{answerController.items.rowCount == 0}"/>
- <h:panelGroup rendered="#{answerController.items.rowCount > 0}">
- <p:dataTable var="answer" value="#{answerController.items}" id="answerList"
- paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
- rowEditListener="#{answerController.rowEditListener}">
-
- <p:column headerText="id">
- <h:outputText value="#{answer.id}" />
- </p:column>
-
- <p:column headerText="Texto">
- <p:cellEditor>
- <f:facet name="output">
- <h:outputText value="#{answer.text}" />
- </f:facet>
- <f:facet name="input">
- <p:inputText value="#{answer.text}" style="width:100%"/>
- </f:facet>
- </p:cellEditor>
- </p:column>
- <p:column headerText="Probabilidade">
- <p:cellEditor>
- <f:facet name="output">
- <h:outputText value="#{answer.likelihood}" />
- </f:facet>
- <f:facet name="input">
- <p:inputText value="#{answer.likelihood}" style="width:100%"/>
- </f:facet>
- </p:cellEditor>
- </p:column>
- <p:column headerText="Pergunta">
- <h:outputText value="#{answer.question.text}"/>
- </p:column>
- <p:column headerText="Nodo">
- <h:outputText value="#{answer.question.node.name}"/>
- </p:column>
- <p:column headerText="Rede Bayesiana">
- <h:outputText value="#{answer.question.node.bayesianNetwork.name}"/>
- </p:column>
+ <h:form>
+ <br></br>
+ <h:commandLink action="/bn/question/Create.xhtml" value="Criar nova pergunta"/>
+ </h:form>
+ </p:tab>
+
+ <p:tab id="tab4" title="Respostas">
+ <h:form>
+ <br></br>
+ <h:commandLink action="#{answerController.recreateModel}" value="Atualizar tabela"/>
+ </h:form>
+ <h:form>
+ <h:outputText escape="false" value="#{bundle.ListAnswerEmpty}" rendered="#{answerController.items.rowCount == 0}"/>
+ <h:panelGroup rendered="#{answerController.items.rowCount > 0}">
+ <p:dataTable var="answer" value="#{answerController.items}" id="answerList"
+ paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
+ rowEditListener="#{answerController.rowEditListener}">
+ <p:column headerText="id">
+ <h:outputText value="#{answer.id}" />
+ </p:column>
- <p:column headerText="Opções">
- <p:rowEditor />
- </p:column>
- </p:dataTable>
- </h:panelGroup>
- </h:form>
- <h:form>
- <br></br>
- <h:commandLink action="/bn/answer/Create.xhtml" value="Criar nova resposta"/>
- </h:form>
- </p:tab>
+ <p:column headerText="Texto">
+ <p:cellEditor>
+ <f:facet name="output">
+ <h:outputText value="#{answer.text}" />
+ </f:facet>
+ <f:facet name="input">
+ <p:inputText value="#{answer.text}" style="width:100%"/>
+ </f:facet>
+ </p:cellEditor>
+ </p:column>
+ <p:column headerText="Probabilidade">
+ <p:cellEditor>
+ <f:facet name="output">
+ <h:outputText value="#{answer.likelihood}" />
+ </f:facet>
+ <f:facet name="input">
+ <p:inputText value="#{answer.likelihood}" style="width:100%"/>
+ </f:facet>
+ </p:cellEditor>
+ </p:column>
+ <p:column headerText="Pergunta">
+ <h:outputText value="#{answer.question.text}"/>
+ </p:column>
+ <p:column headerText="Nodo">
+ <h:outputText value="#{answer.question.node.name}"/>
+ </p:column>
+ <p:column headerText="Rede Bayesiana">
+ <h:outputText value="#{answer.question.node.bayesianNetwork.name}"/>
+ </p:column>
+ <p:column headerText="Opções">
+ <p:rowEditor />
+ <h:commandLink action="#{answerController.destroy}" >
+ <h:graphicImage value="/img/bn/remove.png" />
+ </h:commandLink>
+ </p:column>
+ </p:dataTable>
+ </h:panelGroup>
+ </h:form>
+ <h:form>
+ <br></br>
+ <h:commandLink action="/bn/answer/Create.xhtml" value="Criar nova resposta"/>
+ </h:form>
+ </p:tab>
</p:tabView>
</h:body>