Cambio en la descripción de PDS MyHealth a MyHealth
Configuración de regla de navegación para JSF. Pruebas con primefaces Nuevo ManagedBean para pantalla home. Pagina de login para pruebas.
This commit is contained in:
@@ -4,4 +4,5 @@
|
|||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/WildFly 14.0 Runtime"/>
|
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/WildFly 14.0 Runtime"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
<classpathentry kind="lib" path="docroot/WEB-INF/lib"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<project name="MyHealth Web Application" default="all" basedir=".">
|
<project name="MyHealth Web Application" default="all" basedir=".">
|
||||||
|
|
||||||
<description>PDS MyHealth</description>
|
<description>MyHealth</description>
|
||||||
|
|
||||||
<!-- definition of global property -->
|
<!-- definition of global property -->
|
||||||
<property environment="env" />
|
<property environment="env" />
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
|
||||||
<faces-config version="2.0"
|
<faces-config version="2.0"
|
||||||
xmlns="http://java.sun.com/xml/ns/javaee"
|
xmlns="http://java.sun.com/xml/ns/javaee"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
@@ -6,8 +8,10 @@
|
|||||||
<navigation-rule>
|
<navigation-rule>
|
||||||
<from-view-id>/login.xhtml</from-view-id>
|
<from-view-id>/login.xhtml</from-view-id>
|
||||||
<navigation-case>
|
<navigation-case>
|
||||||
<from-outcome>admin</from-outcome>
|
<from-outcome>home</from-outcome>
|
||||||
<to-view-id>/admin.xhtml</to-view-id>
|
<to-view-id>/home.xhtml</to-view-id>
|
||||||
</navigation-case>
|
</navigation-case>
|
||||||
</navigation-rule>
|
</navigation-rule>
|
||||||
|
|
||||||
|
|
||||||
</faces-config>
|
</faces-config>
|
||||||
BIN
1.sources/MyHealth/docroot/WEB-INF/lib/primefaces-7.0.jar
Normal file
BIN
1.sources/MyHealth/docroot/WEB-INF/lib/primefaces-7.0.jar
Normal file
Binary file not shown.
@@ -30,14 +30,18 @@ http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
|||||||
<url-pattern>*.xhtml</url-pattern>
|
<url-pattern>*.xhtml</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<error-page>
|
||||||
|
<error-code>404</error-code>
|
||||||
|
<location>/error.xhtml</location>
|
||||||
|
</error-page>
|
||||||
<error-page>
|
<error-page>
|
||||||
<error-code>500</error-code>
|
<error-code>500</error-code>
|
||||||
<location>ErrowView.xhtml</location>
|
<location>/error.xhtml</location>
|
||||||
</error-page>
|
</error-page>
|
||||||
|
|
||||||
<!-- The Welcome File List -->
|
<!-- The Welcome File List -->
|
||||||
<welcome-file-list>
|
<welcome-file-list>
|
||||||
<welcome-file>HomeView.xhtml</welcome-file>
|
<welcome-file>home.xhtml</welcome-file>
|
||||||
</welcome-file-list>
|
</welcome-file-list>
|
||||||
|
|
||||||
</web-app>
|
</web-app>
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||||
xmlns:f="http://java.sun.com/jsf/core"
|
xmlns:f="http://java.sun.com/jsf/core"
|
||||||
xmlns:h="http://java.sun.com/jsf/html">
|
xmlns:h="http://java.sun.com/jsf/html"
|
||||||
|
xmlns:p="http://primefaces.org/ui">
|
||||||
|
|
||||||
<h:head>
|
<h:head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
@@ -15,12 +16,14 @@
|
|||||||
<h:body>
|
<h:body>
|
||||||
<div id="layout">
|
<div id="layout">
|
||||||
<div id="top" class="top">
|
<div id="top" class="top">
|
||||||
<h1 class="Titulo">myHealth page header</h1>
|
<h1 class="Titulo">myHealth Site</h1>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<div id="menucontainer" class="estilomenu">
|
<div id="menucontainer" class="estilomenu">
|
||||||
|
<p:spinner></p:spinner>
|
||||||
|
|
||||||
<h:form>
|
<h:form>
|
||||||
<p>Welcome #{login.userName}, <h:commandLink action="#{login.logout}" value="Logout"></h:commandLink></p>
|
<p>Welcome #{login.userName}, <h:commandLink action="#{login.logout}" value="Logout">Logout</h:commandLink></p>
|
||||||
</h:form>
|
</h:form>
|
||||||
</div>
|
</div>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
|
|||||||
@@ -1,20 +1,33 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
|
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||||
xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">
|
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||||
<f:metadata>
|
xmlns:f="http://java.sun.com/jsf/core"
|
||||||
<f:viewParam name="refresh" value="#{specs.refresh}"/>
|
xmlns:h="http://java.sun.com/jsf/html"
|
||||||
</f:metadata>
|
xmlns:p="http://primefaces.org/ui">
|
||||||
|
<f:metadata>
|
||||||
|
<f:viewParam name="refresh" value="#{specs.refresh}" />
|
||||||
|
</f:metadata>
|
||||||
|
|
||||||
<ui:composition template="./header.xhtml">
|
<ui:composition template="./header.xhtml">
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
<h:form align="left" >
|
<h:form>
|
||||||
|
<p:panel header="Prueba con Primefaces">
|
||||||
|
<h:panelGrid columns="2">
|
||||||
|
<h:outputLabel value="Fecha" />
|
||||||
|
<p:calendar pattern="dd/MM/yyyy" />
|
||||||
|
</h:panelGrid>
|
||||||
|
</p:panel>
|
||||||
|
</h:form>
|
||||||
|
<h:form align="left">
|
||||||
<div style="margin: auto; width: 800px">
|
<div style="margin: auto; width: 800px">
|
||||||
<div style="display: inline; float: right;">
|
<div style="display: inline; float: right;">
|
||||||
<!-- Crear menu de aplicación solo si estamos logeados -->
|
<!-- Crear menu de aplicación solo si estamos logeados -->
|
||||||
</div>
|
</div>
|
||||||
<br /><br />
|
<br />
|
||||||
|
<p:spinner />
|
||||||
|
<br /> Welcome #{home.userName}
|
||||||
<!-- Mostrar página de bienvenida -->
|
<!-- Mostrar página de bienvenida -->
|
||||||
</div>
|
</div>
|
||||||
</h:form>
|
</h:form>
|
||||||
|
|||||||
@@ -1,15 +1,20 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
|
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||||
xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">
|
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||||
|
xmlns:f="http://java.sun.com/jsf/core"
|
||||||
|
xmlns:h="http://java.sun.com/jsf/html"
|
||||||
|
xmlns:p="http://primefaces.org/ui">
|
||||||
|
|
||||||
<h:head>
|
<h:head>
|
||||||
<title>login</title>
|
<title>login</title>
|
||||||
</h:head>
|
</h:head>
|
||||||
<ui:composition template="./header.xhtml">
|
<ui:composition template="./header.xhtml">
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
<h:form>
|
<h:form>
|
||||||
<h3>myHealth login page</h3>
|
<h3>myHealth login</h3>
|
||||||
|
<h:outputText value="Por favor, introduzca su nombre de usuario y contraseña para acceder al sistema."></h:outputText>
|
||||||
<h:outputText value="Usuario:" />
|
<h:outputText value="Usuario:" />
|
||||||
<h:inputText id="Uusario" value="#{login.userName}"></h:inputText>
|
<h:inputText id="Uusario" value="#{login.userName}"></h:inputText>
|
||||||
<h:message for="username"></h:message>
|
<h:message for="username"></h:message>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<h:button value="Volver al inicio" outcome="homeView?refresh=1" />
|
<h:button value="Volver al inicio" outcome="home?refresh=1" />
|
||||||
</p>
|
</p>
|
||||||
</h:form>
|
</h:form>
|
||||||
</ui:define>
|
</ui:define>
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
|
|
||||||
xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">
|
|
||||||
|
|
||||||
<ui:composition template="../header.xhtml">
|
|
||||||
<ui:define name="content">
|
|
||||||
<h:form id="errorForm">
|
|
||||||
<div align="center">
|
|
||||||
<h1>test Page</h1>
|
|
||||||
<hr/>
|
|
||||||
<div>TestPage:</div>
|
|
||||||
<div>
|
|
||||||
test page content
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p align="center">
|
|
||||||
<h:button value="Volver al inicio" outcome="homeView?refresh=1" />
|
|
||||||
</p>
|
|
||||||
</h:form>
|
|
||||||
</ui:define>
|
|
||||||
</ui:composition>
|
|
||||||
</html>
|
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<h:button value="Volver al inicio" outcome="homeView?refresh=1" />
|
<h:button value="Volver al inicio" outcome="home?refresh=1" />
|
||||||
</p>
|
</p>
|
||||||
</h:form>
|
</h:form>
|
||||||
</ui:define>
|
</ui:define>
|
||||||
|
|||||||
10
1.sources/MyHealth/src/common/ApplicationConfig.java
Normal file
10
1.sources/MyHealth/src/common/ApplicationConfig.java
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package common;
|
||||||
|
|
||||||
|
import javax.enterprise.context.ApplicationScoped;
|
||||||
|
import javax.faces.annotation.FacesConfig;
|
||||||
|
|
||||||
|
@FacesConfig
|
||||||
|
@ApplicationScoped
|
||||||
|
public class ApplicationConfig {
|
||||||
|
|
||||||
|
}
|
||||||
28
1.sources/MyHealth/src/common/homeMBean.java
Normal file
28
1.sources/MyHealth/src/common/homeMBean.java
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
package common;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javax.faces.bean.ManagedBean;
|
||||||
|
import javax.faces.bean.SessionScoped;
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
@ManagedBean(name = "home")
|
||||||
|
@SessionScoped
|
||||||
|
public class homeMBean implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public String getUserName() {
|
||||||
|
return SessionUtils.getSession().getAttribute("username").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserId() {
|
||||||
|
return (String) SessionUtils.getSession().getAttribute("userid");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package managedbean.profile;
|
||||||
|
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import javax.ejb.EJB;
|
||||||
|
import javax.naming.Context;
|
||||||
|
import javax.naming.InitialContext;
|
||||||
|
|
||||||
|
import ejb.profile.ProfileFacadeRemote;
|
||||||
|
|
||||||
|
public class ProfileMBeanBase {
|
||||||
|
@EJB
|
||||||
|
protected ProfileFacadeRemote remoteManager;
|
||||||
|
|
||||||
|
protected void initializeProfileFacadeRemote() throws Exception {
|
||||||
|
Properties props = System.getProperties();
|
||||||
|
Context ctx = new InitialContext(props);
|
||||||
|
remoteManager = (ProfileFacadeRemote) ctx.lookup("java:app/MyHealth.jar/ProfileFacadeBean!ejb.profile.ProfileFacadeRemote");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
11
2.database/.project
Normal file
11
2.database/.project
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>2.database</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
Reference in New Issue
Block a user