Added new UI to upload bayesian network.
[simdecs.git] / web / bn.xhtml
CommitLineData
8d813ea1
MS
1<?xml version='1.0' encoding='UTF-8' ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml"
4 xmlns:p="http://primefaces.prime.com.tr/ui"
5 xmlns:h="http://java.sun.com/jsf/html"
6 xmlns:f="http://java.sun.com/jsf/core">
7 <h:head>
8 <title>SimDeCS</title>
9 <h:outputStylesheet name="css/jsfcrud.css"/>
10 </h:head>
11 <h:body>
12 <h:outputLabel> <h1>SimDeCS - Cadastro de Redes Bayesianas</h1> </h:outputLabel>
3f2db471
MS
13 <h:panelGrid>
14 <h:form>
15 <p:fileUpload widgetVar="uploader" height="48" width="48"
16 fileUploadListener="#{fileUploadController.handleFileUpload}"
17 image="/img/bn/browse.png" customUI="true"
18 multiple="true" label="Selecione..." allowTypes="*.xml;" description="Images"
19 update="bayesianNetworkList, nodeList"/>
20 <h:outputLink value="#" title="Upload" onclick="uploader.upload();"
21 style="font-weight:bold;color:#616D7E">Enviar Redes Bayesianas
22 </h:outputLink>
23 </h:form>
24 </h:panelGrid>
8d813ea1
MS
25 <h:panelGroup id="messagePanel" layout="block">
26 <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
27 </h:panelGroup>
3f2db471
MS
28 <p:panel header="Redes Bayesianas" toggleable="true" toggleListener="#{bayesianNetworkController.prepareList}">
29 <h:form>
30 <br></br>
31 <h:commandLink action="#{bayesianNetworkController.prepareList}" value="Atualizar tabela"/>
32 </h:form>
33 <h:panelGrid columns="2" cellpadding="10">
34 <h:outputText escape="false" value="#{bundle.ListBayesianNetworkEmpty}" rendered="#{bayesianNetworkController.items.rowCount == 0}"/>
35 <h:panelGroup rendered="#{bayesianNetworkController.items.rowCount > 0}">
8d813ea1 36
3f2db471 37 <h:form id="fBayesianNetworkList">
8d813ea1 38
3f2db471 39 <p:dataTable var="bayesianNetwork" value="#{bayesianNetworkController.items}" id="bayesianNetworkList"
8d813ea1 40 paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
3f2db471
MS
41 rowEditListener="#{bayesianNetworkController.rowEditListener}">
42 <p:column headerText="id">
43 <h:outputText value="#{bayesianNetwork.id}"/>
8d813ea1
MS
44 </p:column>
45
46 <p:column headerText="Nome">
47 <p:cellEditor>
48 <f:facet name="output">
3f2db471 49 <h:outputText value="#{bayesianNetwork.name}"/>
8d813ea1
MS
50 </f:facet>
51 <f:facet name="input">
3f2db471 52 <p:inputText value="#{bayesianNetwork.name}"/>
8d813ea1
MS
53 </f:facet>
54 </p:cellEditor>
3f2db471 55 </p:column>
8d813ea1
MS
56 <p:column headerText="Opções">
57 <p:rowEditor />
3f2db471
MS
58 <h:commandLink action="#{bayesianNetworkController.destroy}" >
59 <h:graphicImage value="/img/bn/remove.png" />
60 </h:commandLink>
8d813ea1 61 </p:column>
8d813ea1 62 </p:dataTable>
3f2db471 63 </h:form>
8d813ea1 64
3f2db471
MS
65 </h:panelGroup>
66 </h:panelGrid>
67 </p:panel>
68 <p:panel header="Nodos" toggleable="true">
69 <h:form>
70 <br></br>
71 <h:commandLink action="#{nodeController.prepareList}" value="Atualizar tabela"/>
72 </h:form>
73 <h:outputText escape="false" value="#{bundle.ListNodeEmpty}" rendered="#{nodeController.items.rowCount == 0}"/>
74 <h:panelGroup rendered="#{nodeController.items.rowCount > 0}">
75 <h:form>
76 <p:dataTable var="node" value="#{nodeController.items}" id="nodeList"
77 paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
78 rowEditListener="#{nodeController.rowEditListener}">
8d813ea1 79
3f2db471
MS
80 <p:column headerText="id">
81 <h:outputText value="#{node.id}" />
82 </p:column>
8d813ea1 83
3f2db471
MS
84 <p:column headerText="Nome">
85 <p:cellEditor>
86 <f:facet name="output">
87 <h:outputText value="#{node.name}" />
88 </f:facet>
89 <f:facet name="input">
90 <p:inputText value="#{node.name}" style="width:100%"/>
91 </f:facet>
92 </p:cellEditor>
93 </p:column>
94 <p:column headerText="Tempo">
95 <p:cellEditor>
96 <f:facet name="output">
97 <h:outputText value="#{node.time}" />
98 </f:facet>
99 <f:facet name="input">
100 <p:inputText value="#{node.time}" style="width:100%"/>
101 </f:facet>
102 </p:cellEditor>
103 </p:column>
104 <p:column headerText="Custo">
105 <p:cellEditor>
106 <f:facet name="output">
107 <h:outputText value="#{node.cost}" />
108 </f:facet>
109 <f:facet name="input">
110 <p:inputText value="#{node.cost}" style="width:100%"/>
111 </f:facet>
112 </p:cellEditor>
113 </p:column>
114 <p:column headerText="Tipo">
115 <p:cellEditor>
116 <f:facet name="output">
117 <h:outputText value="#{node.nodeType}" />
118 </f:facet>
119 <f:facet name="input">
120 <h:selectOneMenu value="#{node.nodeType}" >
121 <f:selectItems value="#{nodeTypeController.nodeTypes}"
122 var="nodeType"
123 itemLabel="#{nodeType}"
124 itemValue="#{nodeType}" />
125 </h:selectOneMenu>
126 </f:facet>
127 </p:cellEditor>
128 </p:column>
129 <p:column headerText="Rede Bayesiana">
130 <h:outputText value="#{node.bayesianNetwork.name}"/>
131 </p:column>
8d813ea1
MS
132
133
3f2db471
MS
134 <p:column headerText="Opções">
135 <p:rowEditor />
136 </p:column>
8d813ea1 137
3f2db471 138 </p:dataTable>
8d813ea1 139 </h:form>
3f2db471 140 </h:panelGroup>
8d813ea1 141
3f2db471
MS
142 </p:panel>
143 <p:panel header="Perguntas" toggleable="true">
144 <h:form>
145 <br></br>
146 <h:commandLink action="#{questionController.prepareList}" value="Atualizar tabela"/>
147 </h:form>
148 <h:form>
149 <h:outputText escape="false" value="#{bundle.ListQuestionEmpty}" rendered="#{questionController.items.rowCount == 0}"/>
150 <h:panelGroup rendered="#{questionController.items.rowCount > 0}">
151 <p:dataTable var="question" value="#{questionController.items}" id="questionList"
152 paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
153 rowEditListener="#{questionController.rowEditListener}">
8d813ea1 154
3f2db471
MS
155 <p:column headerText="id">
156 <h:outputText value="#{question.id}" />
157 </p:column>
8d813ea1 158
3f2db471
MS
159 <p:column headerText="Texto">
160 <p:cellEditor>
161 <f:facet name="output">
162 <h:outputText value="#{question.text}" />
163 </f:facet>
164 <f:facet name="input">
165 <p:inputText value="#{question.text}" style="width:100%"/>
166 </f:facet>
167 </p:cellEditor>
168 </p:column>
169 <p:column headerText="Nodo">
170 <h:outputText value="#{question.node.name}"/>
171 </p:column>
172 <p:column headerText="Rede Bayesiana">
173 <h:outputText value="#{question.node.bayesianNetwork.name}"/>
174 </p:column>
8d813ea1
MS
175
176
3f2db471
MS
177 <p:column headerText="Opções">
178 <p:rowEditor />
179 <h:commandLink action="#{bayesianNetworkController.destroy}" >
180 <h:graphicImage value="/img/bn/remove.png" />
181 </h:commandLink>
182 </p:column>
183
184 </p:dataTable>
185 </h:panelGroup>
186 </h:form>
187
188 <h:form>
189 <br></br>
190 <h:commandLink action="/net/question/Create.xhtml" value="Criar nova pergunta"/>
191 </h:form>
192 </p:panel>
193 <p:panel header="Respostas" toggleable="true">
194 <h:form>
195 <br></br>
196 <h:commandLink action="#{answerController.prepareList}" value="Atualizar tabela"/>
197 </h:form>
198 <h:form>
199 <h:outputText escape="false" value="#{bundle.ListAnswerEmpty}" rendered="#{answerController.items.rowCount == 0}"/>
200 <h:panelGroup rendered="#{answerController.items.rowCount > 0}">
201 <p:dataTable var="answer" value="#{answerController.items}" id="answerList"
202 paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
203 rowEditListener="#{answerController.rowEditListener}">
204
205 <p:column headerText="id">
206 <h:outputText value="#{answer.id}" />
207 </p:column>
208
209 <p:column headerText="Texto">
210 <p:cellEditor>
211 <f:facet name="output">
212 <h:outputText value="#{answer.text}" />
213 </f:facet>
214 <f:facet name="input">
215 <p:inputText value="#{answer.text}" style="width:100%"/>
216 </f:facet>
217 </p:cellEditor>
218 </p:column>
219 <p:column headerText="Probabilidade">
220 <p:cellEditor>
221 <f:facet name="output">
222 <h:outputText value="#{answer.likelihood}" />
223 </f:facet>
224 <f:facet name="input">
225 <p:inputText value="#{answer.likelihood}" style="width:100%"/>
226 </f:facet>
227 </p:cellEditor>
228 </p:column>
229 <p:column headerText="Pergunta">
230 <h:outputText value="#{answer.question.text}"/>
231 </p:column>
232 <p:column headerText="Nodo">
233 <h:outputText value="#{answer.question.node.name}"/>
234 </p:column>
235 <p:column headerText="Rede Bayesiana">
236 <h:outputText value="#{answer.question.node.bayesianNetwork.name}"/>
237 </p:column>
238
239
240 <p:column headerText="Opções">
241 <p:rowEditor />
242 </p:column>
243 </p:dataTable>
244 </h:panelGroup>
245 </h:form>
246 <h:form>
247 <br></br>
248 <h:commandLink action="/net/answer/Create.xhtml" value="Criar nova resposta"/>
249 </h:form>
250 </p:panel>
8d813ea1
MS
251 </h:body>
252
253
254
255
256</html>
257