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