diff --git a/backoffice/pom.xml b/backoffice/pom.xml index 5174f39b70849e5aadd7c288726bde7c13917774..39120f900a10252cc7d5711d9036a80695b53c40 100644 --- a/backoffice/pom.xml +++ b/backoffice/pom.xml @@ -51,7 +51,6 @@ <artifactId>wildfly-jsf</artifactId> </dependency> - <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> diff --git a/backoffice/src/main/java/uy/edu/fing/tse/jsf/RequestBean.java b/backoffice/src/main/java/uy/edu/fing/tse/jsf/RequestBean.java index 55aee8de5398766556c226e1cd634d4359dbe604..5b5ed564fdc0df3da6d7e38c29bef1342caea83f 100644 --- a/backoffice/src/main/java/uy/edu/fing/tse/jsf/RequestBean.java +++ b/backoffice/src/main/java/uy/edu/fing/tse/jsf/RequestBean.java @@ -21,8 +21,8 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; -@Named("faller") @ViewScoped +@Named("faller") public class RequestBean implements Serializable { private static final long serialVersionUID = 4465735311570405045L; @@ -103,3 +103,6 @@ public class RequestBean implements Serializable { this.mensaje = mensaje; } } + + + diff --git a/backoffice/src/main/java/uy/edu/fing/tse/jsf/UserLoginBean.java b/backoffice/src/main/java/uy/edu/fing/tse/jsf/UserLoginBean.java new file mode 100644 index 0000000000000000000000000000000000000000..6ffbd0ff986a0e462241d283afda4773769796df --- /dev/null +++ b/backoffice/src/main/java/uy/edu/fing/tse/jsf/UserLoginBean.java @@ -0,0 +1,50 @@ +package uy.edu.fing.tse.jsf; + +import javax.enterprise.context.RequestScoped; +import javax.inject.Named; +import java.io.Serializable; + +@RequestScoped +@Named("userLoginView") +public class UserLoginBean implements Serializable { + + private static final long serialVersionUID = -7674319505640122631L; + + private String username; + private String password; + private String repassword; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getRepassword() { + return repassword; + } + + public void setRepassword(String repassword) { + this.repassword = repassword; + } + + + public void login() { + //aca va el login + } + + public void register() { + //aca va el register + } + +} diff --git a/backoffice/src/main/webapp/jsf/login.xhtml b/backoffice/src/main/webapp/jsf/login.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..13dd09f9f53e65f784b9e85deaec9711f6c9a61e --- /dev/null +++ b/backoffice/src/main/webapp/jsf/login.xhtml @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:p="http://primefaces.org/ui" + xmlns:h="http://xmlns.jcp.org/jsf/html" + xmlns:f="http://xmlns.jcp.org/jsf/core" +> +<body> + +<ui:decorate template="/WEB-INF/templates/template.xhtml"> + <ui:define name="contenido"> + <h:form> + <h1>LOGIN</h1> + <h:panelGrid columns="2" cellpadding="5" id="form"> + + <h:outputLabel for="username" value="Username:"/> + <p:inputText id="username" value="#{userLoginView.username}" required="true" label="username"/> + + <h:outputLabel for="password" value="Password:"/> + <p:password id="password" value="#{userLoginView.password}" required="true" label="password"/> + + <f:facet name="footer"> + <p:commandButton value="Register" action="register.xhmtl?faces-redirect=true" update="form"/> + <p:commandButton value="Login" action="#{userLoginView.login}"/> + </f:facet> + </h:panelGrid> + </h:form> + </ui:define> +</ui:decorate> +</body> +</html> \ No newline at end of file diff --git a/backoffice/src/main/webapp/jsf/register.xhtml b/backoffice/src/main/webapp/jsf/register.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..55964beaf881de1f1ab400bceaca906f34e38c34 --- /dev/null +++ b/backoffice/src/main/webapp/jsf/register.xhtml @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:p="http://primefaces.org/ui" + xmlns:h="http://xmlns.jcp.org/jsf/html" + xmlns:f="http://xmlns.jcp.org/jsf/core" +> +<body> + +<ui:decorate template="/WEB-INF/templates/template.xhtml"> + <ui:define name="contenido"> + <h:form> + <h1>Register</h1> + <h:panelGrid columns="2" cellpadding="5" id="form"> + + <h:outputLabel for="username" value="Username:"/> + <p:inputText id="username" value="#{userLoginView.username}" required="true" label="username"/> + + <h:outputLabel for="password" value="Password:"/> + <p:password id="password" value="#{userLoginView.password}" required="true" label="password"/> + + <h:outputLabel for="repassword" value="RePassword:"/> + <p:password id="repassword" value="#{userLoginView.repassword}" required="true" label="repassword"/> + + <f:facet name="footer"> + <p:commandButton value="Register" action="#{userLoginView.register}"/> + </f:facet> + </h:panelGrid> + </h:form> + </ui:define> +</ui:decorate> +</body> +</html> \ No newline at end of file