New UI to control bn upload.
[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>
13 <h:panelGrid>
14 <h:form enctype="multipart/form-data">
15
16 <p:fileUpload fileUploadListener="#{fileUploadController.handleFileUpload}"
17 mode="advanced"
18 update="messages"
19 multiple="true"
20 allowTypes="/(\.|\/)(xml)$/"/>
21
22 <p:growl id="messages" showDetail="true"/>
23
24</h:form>
25 </h:panelGrid>
26 <h:panelGroup id="messagePanel" layout="block">
27 <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
28 </h:panelGroup>
29 <p:panel header="Redes Bayesianas" toggleable="true" toggleListener="#{bayesianNetworkController.prepareList}">
30 <h:form>
31 <br></br>
32 <h:commandLink action="#{bayesianNetworkController.prepareList}" value="Atualizar tabela"/>
33 </h:form>
34 <h:panelGrid columns="2" cellpadding="10">
35 <h:outputText escape="false" value="#{bundle.ListBayesianNetworkEmpty}" rendered="#{bayesianNetworkController.items.rowCount == 0}"/>
36 <h:panelGroup rendered="#{bayesianNetworkController.items.rowCount > 0}">
37
38 <h:form id="fBayesianNetworkList">
39
40 <p:dataTable var="bayesianNetwork" value="#{bayesianNetworkController.items}" id="bayesianNetworkList"
41 paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
42 rowEditListener="#{bayesianNetworkController.rowEditListener}">
43 <p:column headerText="id">
44 <h:outputText value="#{bayesianNetwork.id}"/>
45 </p:column>
46
47 <p:column headerText="Nome">
48 <p:cellEditor>
49 <f:facet name="output">
50 <h:outputText value="#{bayesianNetwork.name}"/>
51 </f:facet>
52 <f:facet name="input">
53 <p:inputText value="#{bayesianNetwork.name}"/>
54 </f:facet>
55 </p:cellEditor>
56 </p:column>
57 <p:column headerText="Opções">
58 <p:rowEditor />
59 <h:commandLink action="#{bayesianNetworkController.destroy}" >
60 <h:graphicImage value="/img/bayesianNetwork/remove.png" />
61 </h:commandLink>
62 </p:column>
63 </p:dataTable>
64 </h:form>
65
66 </h:panelGroup>
67 </h:panelGrid>
68 </p:panel>
69 <p:panel header="Nodos" toggleable="true">
70 <h:form>
71 <br></br>
72 <h:commandLink action="#{nodeController.prepareList}" value="Atualizar tabela"/>
73 </h:form>
74 <h:outputText escape="false" value="#{bundle.ListNodeEmpty}" rendered="#{nodeController.items.rowCount == 0}"/>
75 <h:panelGroup rendered="#{nodeController.items.rowCount > 0}">
76 <h:form>
77 <p:dataTable var="node" value="#{nodeController.items}" id="nodeList"
78 paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
79 rowEditListener="#{nodeController.rowEditListener}">
80
81 <p:column headerText="id">
82 <h:outputText value="#{node.id}" />
83 </p:column>
84
85 <p:column headerText="Nome">
86 <p:cellEditor>
87 <f:facet name="output">
88 <h:outputText value="#{node.name}" />
89 </f:facet>
90 <f:facet name="input">
91 <p:inputText value="#{node.name}" style="width:100%"/>
92 </f:facet>
93 </p:cellEditor>
94 </p:column>
95 <p:column headerText="Tempo">
96 <p:cellEditor>
97 <f:facet name="output">
98 <h:outputText value="#{node.time}" />
99 </f:facet>
100 <f:facet name="input">
101 <p:inputText value="#{node.time}" style="width:100%"/>
102 </f:facet>
103 </p:cellEditor>
104 </p:column>
105 <p:column headerText="Custo">
106 <p:cellEditor>
107 <f:facet name="output">
108 <h:outputText value="#{node.cost}" />
109 </f:facet>
110 <f:facet name="input">
111 <p:inputText value="#{node.cost}" style="width:100%"/>
112 </f:facet>
113 </p:cellEditor>
114 </p:column>
115 <p:column headerText="Tipo">
116 <p:cellEditor>
117 <f:facet name="output">
118 <h:outputText value="#{node.nodeType}" />
119 </f:facet>
120 <f:facet name="input">
121 <h:selectOneMenu value="#{node.nodeType}" >
122 <f:selectItems value="#{nodeTypeController.nodeTypes}"
123 var="nodeType"
124 itemLabel="#{nodeType}"
125 itemValue="#{nodeType}" />
126 </h:selectOneMenu>
127 </f:facet>
128 </p:cellEditor>
129 </p:column>
130 <p:column headerText="Rede Bayesiana">
131 <h:outputText value="#{node.bayesianNetwork.name}"/>
132 </p:column>
133
134
135 <p:column headerText="Opções">
136 <p:rowEditor />
137 </p:column>
138
139 </p:dataTable>
140 </h:form>
141 </h:panelGroup>
142
143 </p:panel>
144 <p:panel header="Perguntas" toggleable="true">
145 <h:form>
146 <br></br>
147 <h:commandLink action="#{questionController.prepareList}" value="Atualizar tabela"/>
148 </h:form>
149 <h:form>
150 <h:outputText escape="false" value="#{bundle.ListQuestionEmpty}" rendered="#{questionController.items.rowCount == 0}"/>
151 <h:panelGroup rendered="#{questionController.items.rowCount > 0}">
152 <p:dataTable var="question" value="#{questionController.items}" id="questionList"
153 paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
154 rowEditListener="#{questionController.rowEditListener}">
155
156 <p:column headerText="id">
157 <h:outputText value="#{question.id}" />
158 </p:column>
159
160 <p:column headerText="Texto">
161 <p:cellEditor>
162 <f:facet name="output">
163 <h:outputText value="#{question.text}" />
164 </f:facet>
165 <f:facet name="input">
166 <p:inputText value="#{question.text}" style="width:100%"/>
167 </f:facet>
168 </p:cellEditor>
169 </p:column>
170 <p:column headerText="Nodo">
171 <h:outputText value="#{question.node.name}"/>
172 </p:column>
173 <p:column headerText="Rede Bayesiana">
174 <h:outputText value="#{question.node.bayesianNetwork.name}"/>
175 </p:column>
176
177
178 <p:column headerText="Opções">
179 <p:rowEditor />
180 <h:commandLink action="#{bayesianNetworkController.destroy}" >
181 <h:graphicImage value="/img/bayesianNetwork/remove.png" />
182 </h:commandLink>
183 </p:column>
184
185 </p:dataTable>
186 </h:panelGroup>
187 </h:form>
188
189 <h:form>
190 <br></br>
191 <h:commandLink action="/net/question/Create.xhtml" value="Criar nova pergunta"/>
192 </h:form>
193 </p:panel>
194 <p:panel header="Respostas" toggleable="true">
195 <h:form>
196 <br></br>
197 <h:commandLink action="#{answerController.prepareList}" value="Atualizar tabela"/>
198 </h:form>
199 <h:form>
200 <h:outputText escape="false" value="#{bundle.ListAnswerEmpty}" rendered="#{answerController.items.rowCount == 0}"/>
201 <h:panelGroup rendered="#{answerController.items.rowCount > 0}">
202 <p:dataTable var="answer" value="#{answerController.items}" id="answerList"
203 paginator="true" rows="10" style="width:100%" paginatorPosition="bottom"
204 rowEditListener="#{answerController.rowEditListener}">
205
206 <p:column headerText="id">
207 <h:outputText value="#{answer.id}" />
208 </p:column>
209
210 <p:column headerText="Texto">
211 <p:cellEditor>
212 <f:facet name="output">
213 <h:outputText value="#{answer.text}" />
214 </f:facet>
215 <f:facet name="input">
216 <p:inputText value="#{answer.text}" style="width:100%"/>
217 </f:facet>
218 </p:cellEditor>
219 </p:column>
220 <p:column headerText="Probabilidade">
221 <p:cellEditor>
222 <f:facet name="output">
223 <h:outputText value="#{answer.likelihood}" />
224 </f:facet>
225 <f:facet name="input">
226 <p:inputText value="#{answer.likelihood}" style="width:100%"/>
227 </f:facet>
228 </p:cellEditor>
229 </p:column>
230 <p:column headerText="Pergunta">
231 <h:outputText value="#{answer.question.text}"/>
232 </p:column>
233 <p:column headerText="Nodo">
234 <h:outputText value="#{answer.question.node.name}"/>
235 </p:column>
236 <p:column headerText="Rede Bayesiana">
237 <h:outputText value="#{answer.question.node.bayesianNetwork.name}"/>
238 </p:column>
239
240
241 <p:column headerText="Opções">
242 <p:rowEditor />
243 </p:column>
244 </p:dataTable>
245 </h:panelGroup>
246 </h:form>
247 <h:form>
248 <br></br>
249 <h:commandLink action="/net/answer/Create.xhtml" value="Criar nova resposta"/>
250 </h:form>
251 </p:panel>
252 </h:body>
253
254
255
256
257</html>
258