Cambios en managedBeans (Herencia común) para gestionar EJBRemote
connection. * Vistas para componente profile * Inclusión de Primefaces
This commit is contained in:
@@ -18,32 +18,18 @@ import ejb.profile.ProfileFacadeRemote;
|
||||
*/
|
||||
@ManagedBean(name = "AddFamilyDoctorMBean")
|
||||
@SessionScoped
|
||||
public class AddFamilyDoctorMBean implements Serializable {
|
||||
public class AddFamilyDoctorMBean extends ProfileMBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@EJB
|
||||
private ProfileFacadeRemote remoteManager;
|
||||
|
||||
/**
|
||||
* Constructor. Inicializa la conexión con el EJB Remoto
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public AddFamilyDoctorMBean() throws Exception {
|
||||
initializeAdminFacadeRemote();
|
||||
super.initializeProfileFacadeRemote();
|
||||
}
|
||||
|
||||
/**
|
||||
* Inicializa la conexión con el EJB Remoto
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
private void initializeAdminFacadeRemote() throws Exception {
|
||||
Properties props = System.getProperties();
|
||||
Context ctx = new InitialContext(props);
|
||||
remoteManager = (ProfileFacadeRemote) ctx
|
||||
.lookup("java:app/myHealth.jar/ProfileFacadeBean!ejb.component.ProfileFacadeRemote");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,13 +20,10 @@ import ejb.profile.ProfileFacadeRemote;
|
||||
*/
|
||||
@ManagedBean(name = "AddPatientMBean")
|
||||
@SessionScoped
|
||||
public class AddPatientMBean implements Serializable {
|
||||
public class AddPatientMBean extends ProfileMBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@EJB
|
||||
private ProfileFacadeRemote remoteManager;
|
||||
|
||||
/**
|
||||
* Constructor. Inicializa la conexión con el EJB Remoto
|
||||
*
|
||||
|
||||
@@ -18,7 +18,7 @@ import ejb.profile.ProfileFacadeRemote;
|
||||
*/
|
||||
@ManagedBean(name = "AddSpecialistDoctorMBean")
|
||||
@SessionScoped
|
||||
public class AddSpecialistDoctorMBean implements Serializable {
|
||||
public class AddSpecialistDoctorMBean extends ProfileMBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -31,19 +31,7 @@ public class AddSpecialistDoctorMBean implements Serializable {
|
||||
* @throws Exception
|
||||
*/
|
||||
public AddSpecialistDoctorMBean() throws Exception {
|
||||
initializeAdminFacadeRemote();
|
||||
}
|
||||
|
||||
/**
|
||||
* Inicializa la conexión con el EJB Remoto
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
private void initializeAdminFacadeRemote() throws Exception {
|
||||
Properties props = System.getProperties();
|
||||
Context ctx = new InitialContext(props);
|
||||
remoteManager = (ProfileFacadeRemote) ctx
|
||||
.lookup("java:app/myHealth.jar/ProfileFacadeBean!ejb.component.ProfileFacadeRemote");
|
||||
super.initializeProfileFacadeRemote();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import ejb.profile.ProfileFacadeRemote;
|
||||
*/
|
||||
@ManagedBean(name = "ChangeFamilyDoctorMBean")
|
||||
@SessionScoped
|
||||
public class ChangeFamilyDoctorMBean implements Serializable {
|
||||
public class ChangeFamilyDoctorMBean extends ProfileMBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import ejb.profile.ProfileFacadeRemote;
|
||||
*/
|
||||
@ManagedBean(name = "ChangePrimaryHealthCareCenterMBean")
|
||||
@SessionScoped
|
||||
public class ChangePrimaryHealthCareCenterMBean implements Serializable {
|
||||
public class ChangePrimaryHealthCareCenterMBean extends ProfileMBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import ejb.profile.ProfileFacadeRemote;
|
||||
*/
|
||||
@ManagedBean(name = "ShowFamilyDoctorMBean")
|
||||
@SessionScoped
|
||||
public class ShowFamilyDoctorMBean implements Serializable {
|
||||
public class ShowFamilyDoctorMBean extends ProfileMBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import ejb.profile.ProfileFacadeRemote;
|
||||
*/
|
||||
@ManagedBean(name = "ShowPatientMBean")
|
||||
@SessionScoped
|
||||
public class ShowPatientMBean implements Serializable {
|
||||
public class ShowPatientMBean extends ProfileMBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import ejb.profile.ProfileFacadeRemote;
|
||||
*/
|
||||
@ManagedBean(name = "ShowSpecialistDoctorMBean")
|
||||
@SessionScoped
|
||||
public class ShowSpecialistDoctorMBean implements Serializable {
|
||||
public class ShowSpecialistDoctorMBean extends ProfileMBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import ejb.profile.ProfileFacadeRemote;
|
||||
*/
|
||||
@ManagedBean(name = "UpdateFamilyDoctorMBean")
|
||||
@SessionScoped
|
||||
public class UpdateFamilyDoctorMBean implements Serializable {
|
||||
public class UpdateFamilyDoctorMBean extends ProfileMBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import ejb.profile.ProfileFacadeRemote;
|
||||
*/
|
||||
@ManagedBean(name = "UpdatePatientMBean")
|
||||
@SessionScoped
|
||||
public class UpdatePatientMBean implements Serializable {
|
||||
public class UpdatePatientMBean extends ProfileMBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import ejb.profile.ProfileFacadeRemote;
|
||||
*/
|
||||
@ManagedBean(name = "UpdateSpecialistDoctorMBean")
|
||||
@SessionScoped
|
||||
public class UpdateSpecialistDoctorMBean implements Serializable {
|
||||
public class UpdateSpecialistDoctorMBean extends ProfileMBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -10,9 +10,10 @@ import javax.servlet.http.HttpSession;
|
||||
|
||||
import common.SessionUtils;
|
||||
|
||||
@ManagedBean
|
||||
@SuppressWarnings("deprecation")
|
||||
@ManagedBean(name = "login")
|
||||
@SessionScoped
|
||||
public class Login implements Serializable {
|
||||
public class LoginMBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1094801825228386363L;
|
||||
|
||||
@@ -36,18 +37,18 @@ public class Login implements Serializable {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getuserName() {
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setuserName(String user) {
|
||||
public void setUserName(String user) {
|
||||
this.userName = user;
|
||||
}
|
||||
|
||||
// validate login
|
||||
public String validateUsernamePassword() {
|
||||
// TODO: Validar login
|
||||
boolean valid = true;
|
||||
boolean valid = this.userName.startsWith("a");
|
||||
if (valid) {
|
||||
HttpSession session = SessionUtils.getSession();
|
||||
session.setAttribute("username", userName);
|
||||
Reference in New Issue
Block a user