commit 1f0e8d1122ad9e18703f3b639f057af5399df2c3 Author: Lenovo Date: Fri May 10 08:35:48 2024 -0500 Huevo SuperMegaUltraRecontrafinish- Ya hice la seguridad/login - ya funciona, solo falta la vista diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a5fe94c --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +/nbproject/private/ +/SystemInventory-ejb/nbproject/private/ +/SystemInventory-war/nbproject/private/ +/SystemInventory-ejb/build/ +/SystemInventory-war/build/ +/build/ +/SystemInventory-ejb/dist/ +/SystemInventory-war/dist/ +/dist/ diff --git a/SystemInventory-ejb/build.xml b/SystemInventory-ejb/build.xml new file mode 100644 index 0000000..1709bbf --- /dev/null +++ b/SystemInventory-ejb/build.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + Builds, tests, and runs the project SystemInventory-ejb. + + + diff --git a/SystemInventory-ejb/nbproject/ant-deploy.xml b/SystemInventory-ejb/nbproject/ant-deploy.xml new file mode 100644 index 0000000..fdc06d5 --- /dev/null +++ b/SystemInventory-ejb/nbproject/ant-deploy.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SystemInventory-ejb/nbproject/build-impl.xml b/SystemInventory-ejb/nbproject/build-impl.xml new file mode 100644 index 0000000..4fa48ce --- /dev/null +++ b/SystemInventory-ejb/nbproject/build-impl.xml @@ -0,0 +1,1253 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set platform.home + Must set platform.bootcp + Must set platform.java + Must set platform.javac + + The J2SE Platform is not correctly set up. + Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files. + Either open the project in the IDE and setup the Platform with the same name or add it manually. + For example like this: + ant -Duser.properties.file=<path_to_property_file> jar (where you put the property "platforms.${platform.active}.home" in a .properties file) + or ant -Dplatforms.${platform.active}.home=<path_to_JDK_home> jar (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set build.generated.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + +The Java EE server classpath is not correctly set up - server home directory is missing. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Dj2ee.server.home=<app_server_installation_directory> + + +The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Duser.properties.file=<path_to_property_file> (where you put the property "j2ee.platform.classpath" in a .properties file) +or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +The libs.CopyLibs.classpath property is not set up. +This property must point to +org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part +of NetBeans IDE installation and is usually located at +<netbeans_installation>/java<version>/ant/extra folder. +Either open the project in the IDE and make sure CopyLibs library +exists or setup the property manually. For example like this: + ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set main.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SystemInventory-ejb/nbproject/genfiles.properties b/SystemInventory-ejb/nbproject/genfiles.properties new file mode 100644 index 0000000..a65c989 --- /dev/null +++ b/SystemInventory-ejb/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=1914e9dc +build.xml.script.CRC32=af2c0e6c +build.xml.stylesheet.CRC32=a737d6c5@1.75 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=1914e9dc +nbproject/build-impl.xml.script.CRC32=8e621c99 +nbproject/build-impl.xml.stylesheet.CRC32=62693482@1.75 diff --git a/SystemInventory-ejb/nbproject/project.xml b/SystemInventory-ejb/nbproject/project.xml new file mode 100644 index 0000000..6a7139c --- /dev/null +++ b/SystemInventory-ejb/nbproject/project.xml @@ -0,0 +1,20 @@ + + + org.netbeans.modules.j2ee.ejbjarproject + + + SystemInventory-ejb + 1.6.5 + + + + + + + + + + ..\.\lib\nblibraries.properties + + + diff --git a/SystemInventory-ejb/src/conf/MANIFEST.MF b/SystemInventory-ejb/src/conf/MANIFEST.MF new file mode 100644 index 0000000..59499bc --- /dev/null +++ b/SystemInventory-ejb/src/conf/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/SystemInventory-ejb/src/conf/META-INF/glassfish-resources.xml b/SystemInventory-ejb/src/conf/META-INF/glassfish-resources.xml new file mode 100644 index 0000000..2b6933b --- /dev/null +++ b/SystemInventory-ejb/src/conf/META-INF/glassfish-resources.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/SystemInventory-ejb/src/conf/persistence.xml b/SystemInventory-ejb/src/conf/persistence.xml new file mode 100644 index 0000000..4e22e95 --- /dev/null +++ b/SystemInventory-ejb/src/conf/persistence.xml @@ -0,0 +1,8 @@ + + + + jdbc/inventario + false + + + diff --git a/SystemInventory-ejb/src/java/mx.edu.tsj.chapala.sistemas.mensajes/Mensaje.java b/SystemInventory-ejb/src/java/mx.edu.tsj.chapala.sistemas.mensajes/Mensaje.java new file mode 100644 index 0000000..cbc4a47 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx.edu.tsj.chapala.sistemas.mensajes/Mensaje.java @@ -0,0 +1,12 @@ +package mx.edu.tsj.chapala.sistemas; + + +public enum Mensaje { + SIN_ERROR, + CAMPOS_iNCOMPLETOS, + DATOS_INCORRECTOS, + ELEMENTO_DUPLICADO, + ELEMENTO_BORRADO + + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/CategoriaDao.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/CategoriaDao.java new file mode 100644 index 0000000..871c05f --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/CategoriaDao.java @@ -0,0 +1,71 @@ + +package mx.edu.tsj.chapala.sistemas.Dao; + +import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import javax.persistence.Query; +import mx.edu.tsj.chapala.sistemas.modelo.Categoria; + + +public class CategoriaDao { + + private EntityManager em;//Manejador de Entidades + + public CategoriaDao(){ + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + em=emf.createEntityManager(); + } + + + public void agregar(Categoria a){ + em.getTransaction().begin(); + em.persist(a); //Almacenar en la BD + em.getTransaction().commit(); + } + + public boolean eliminar(Categoria a) { + em.getTransaction().begin(); + + // Obtener proveedor actualizado desde la base de datos + Categoria p = em.find(Categoria.class, a.getId()); + + // Conservar datos existentes + a.setNombre(p.getNombre()); + // Modificar solo el estado + a.setStatus(0); + // Fusionar los cambios en la entidad proveedor + em.merge(a); + // Finalizar transacción + em.getTransaction().commit(); + + return true; + + } + + public void editar(Categoria a){ + buscarPorId(a); + em.getTransaction().begin(); + em.merge(a);//edita en la base de datos + em.getTransaction().commit(); + } + + public Categoria buscarPorId(Categoria a){ + Query q =em.createNamedQuery("Categoria.findById"); + q.setParameter("id", a.getId()); + if(q.getResultList().isEmpty()){ + return null; + }else{ + + return (Categoria)q.getResultList().get(0); + } + } + public List getTodos(boolean status){ + Query q =em.createNamedQuery("Categoria.findByStatus"); + int s = status?1:0; + q.setParameter("status", s); + return q.getResultList(); + } + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/EstanteDao.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/EstanteDao.java new file mode 100644 index 0000000..4703b57 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/EstanteDao.java @@ -0,0 +1,69 @@ + +package mx.edu.tsj.chapala.sistemas.Dao; + +import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import javax.persistence.Query; +import mx.edu.tsj.chapala.sistemas.modelo.Estante; + +public class EstanteDao { + + private EntityManager em;//Manejador de Entidades + + public EstanteDao(){ + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + em=emf.createEntityManager(); + } + + + public void agregar(Estante a){ + em.getTransaction().begin(); + em.persist(a); //Almacenar en la BD + em.getTransaction().commit(); + } + + public boolean eliminar(Estante a) { + em.getTransaction().begin(); + + // Obtener proveedor actualizado desde la base de datos + Estante p = em.find(Estante.class, a.getId()); + + // Conservar datos existentes + a.setNumeroE(p.getNumeroE()); + // Modificar solo el estado + a.setStatus(0); + // Fusionar los cambios en la entidad proveedor + em.merge(a); + // Finalizar transacción + em.getTransaction().commit(); + + return true; + + } + + public void editar(Estante a){ + buscarPorId(a); + em.getTransaction().begin(); + em.merge(a);//edita en la base de datos + em.getTransaction().commit(); + } + + public Estante buscarPorId(Estante a){ + Query q =em.createNamedQuery("Estante.findById"); + q.setParameter("id", a.getId()); + if(q.getResultList().isEmpty()){ + return null; + }else{ + + return (Estante)q.getResultList().get(0); + } + } + public List getTodos(boolean status){ + Query q =em.createNamedQuery("Estante.findByStatus"); + int s = status?1:0; + q.setParameter("status", s); + return q.getResultList(); + } +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/MarcaDao.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/MarcaDao.java new file mode 100644 index 0000000..66684db --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/MarcaDao.java @@ -0,0 +1,81 @@ + +package mx.edu.tsj.chapala.sistemas.Dao; + +import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import javax.persistence.Query; +import mx.edu.tsj.chapala.sistemas.modelo.Marca; + + +public class MarcaDao { + private EntityManager em;//Manejador de Entidades + + public MarcaDao(){ + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + em=emf.createEntityManager(); + } + + + public void agregar(Marca a){ + em.getTransaction().begin(); + em.persist(a); //Almacenar en la BD + em.getTransaction().commit(); + } + + public boolean eliminar(Marca a) { + em.getTransaction().begin(); + + // Obtener proveedor actualizado desde la base de datos + Marca p = em.find(Marca.class, a.getId()); + + // Conservar datos existentes + a.setNombre(p.getNombre()); + // Modificar solo el estado + a.setStatus(0); + // Fusionar los cambios en la entidad proveedor + em.merge(a); + // Finalizar transacción + em.getTransaction().commit(); + + return true; + + } + + public void editar(Marca a){ + buscarPorId(a); + em.getTransaction().begin(); + em.merge(a);//edita en la base de datos + em.getTransaction().commit(); + } + + public Marca buscarPorId(Marca a){ + Query q =em.createNamedQuery("Marca.findById"); + q.setParameter("id", a.getId()); + if(q.getResultList().isEmpty()){ + return null; + }else{ + + return (Marca)q.getResultList().get(0); + } + } + public List getTodos(boolean status){ + Query q =em.createNamedQuery("Marca.findByStatus"); + int s = status?1:0; + q.setParameter("status", s); + return q.getResultList(); + } + public Marca buscarPorNombre(Marca a){ + Query q =em.createNamedQuery("Marca.findByNombre"); + q.setParameter("nombre", a.getNombre()); + if(q.getResultList().isEmpty()){ + return null; + }else{ + + return (Marca)q.getResultList().get(0); + } + } +} + + diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/PasilloDao.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/PasilloDao.java new file mode 100644 index 0000000..cd47e53 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/PasilloDao.java @@ -0,0 +1,82 @@ +package mx.edu.tsj.chapala.sistemas.Dao; + +import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import javax.persistence.Query; +import mx.edu.tsj.chapala.sistemas.modelo.Pasillo; + + +public class PasilloDao { + + private EntityManager em;//Manejador de Entidades + + public PasilloDao(){ + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + em=emf.createEntityManager(); + } + + + public void agregar(Pasillo a){ + em.getTransaction().begin(); + em.persist(a); //Almacenar en la BD + em.getTransaction().commit(); + } + + public boolean eliminar(Pasillo a) { + em.getTransaction().begin(); + + // Obtener proveedor actualizado desde la base de datos + Pasillo p = em.find(Pasillo.class, a.getId()); + + // Conservar datos existentes + a.setId(p.getId()); + a.setNumeroP(p.getNumeroP()); + + + // Modificar solo el estado + a.setStatus(0); + // Fusionar los cambios en la entidad proveedor + em.merge(a); + // Finalizar transacción + em.getTransaction().commit(); + + return true; + + } + + public void editar(Pasillo a){ + buscarPorId(a); + em.getTransaction().begin(); + em.merge(a);//edita en la base de datos + em.getTransaction().commit(); + } + + public Pasillo buscarPorId(Pasillo a){ + Query q =em.createNamedQuery("Pasillo.findById"); + q.setParameter("id", a.getId()); + if(q.getResultList().isEmpty()){ + return null; + }else{ + + return (Pasillo)q.getResultList().get(0); + } + } + public List getTodos(boolean status){ + Query q =em.createNamedQuery("Pasillo.findByStatus"); + int s = status?1:0; + q.setParameter("status", s); + return q.getResultList(); + } + public Pasillo buscarPorNombre(Pasillo a){ + Query q =em.createNamedQuery("Pasillo.findByNumeroP"); + q.setParameter("Numero", a.getNumeroP()); + if(q.getResultList().isEmpty()){ + return null; + }else{ + + return (Pasillo)q.getResultList().get(0); + } + } +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/ProductoDao.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/ProductoDao.java new file mode 100644 index 0000000..6d652f7 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/ProductoDao.java @@ -0,0 +1,86 @@ + +package mx.edu.tsj.chapala.sistemas.Dao; + +import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import javax.persistence.Query; +import mx.edu.tsj.chapala.sistemas.modelo.Producto; + + +public class ProductoDao { + private EntityManager em;//Manejador de Entidades + + public ProductoDao(){ + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + em=emf.createEntityManager(); + } + + + public void agregar(Producto a){ + em.getTransaction().begin(); + em.persist(a); //Almacenar en la BD + em.getTransaction().commit(); + } + + public boolean eliminar(Producto a) { + em.getTransaction().begin(); + + // Obtener proveedor actualizado desde la base de datos + Producto p = em.find(Producto.class, a.getId()); + + // Conservar datos existentes + a.setCodigo(p.getCodigo()); + a.setNombre(p.getNombre()); + a.setMarcaid(p.getMarcaid()); + a.setCategoriaid(p.getCategoriaid()); + a.setPrecio(p.getPrecio()); + a.setUbicacionid(p.getUbicacionid()); + a.setProovedorid(p.getProovedorid()); + a.setFecha(p.getFecha()); + // Modificar solo el estado + a.setStatus(0); + // Fusionar los cambios en la entidad proveedor + em.merge(a); + // Finalizar transacción + em.getTransaction().commit(); + + return true; + + } + + public void editar(Producto a){ + buscarPorId(a); + em.getTransaction().begin(); + em.merge(a);//edita en la base de datos + em.getTransaction().commit(); + } + + public Producto buscarPorId(Producto a){ + Query q =em.createNamedQuery("Producto.findById"); + q.setParameter("id", a.getId()); + if(q.getResultList().isEmpty()){ + return null; + }else{ + + return (Producto)q.getResultList().get(0); + } + } + public List getTodos(boolean status){ + Query q =em.createNamedQuery("Producto.findByStatus"); + int s = status?1:0; + q.setParameter("status", s); + return q.getResultList(); + } + public Producto buscarPorNombre(Producto a){ + Query q =em.createNamedQuery("Producto.findByNombre"); + q.setParameter("nombre", a.getNombre()); + if(q.getResultList().isEmpty()){ + return null; + }else{ + + return (Producto)q.getResultList().get(0); + } + } + } diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/ProovedorDao.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/ProovedorDao.java new file mode 100644 index 0000000..c4d5cd7 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/ProovedorDao.java @@ -0,0 +1,73 @@ + +package mx.edu.tsj.chapala.sistemas.Dao; + +import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import javax.persistence.Query; +import mx.edu.tsj.chapala.sistemas.modelo.Proovedor; + + +public class ProovedorDao { + private EntityManager em;//Manejador de Entidades + + public ProovedorDao(){ + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + em=emf.createEntityManager(); + } + + + public void agregar(Proovedor a){ + em.getTransaction().begin(); + em.persist(a); //Almacenar en la BD + em.getTransaction().commit(); + } + + public boolean eliminar(Proovedor a) { + em.getTransaction().begin(); + + // Obtener proveedor actualizado desde la base de datos + Proovedor p = em.find(Proovedor.class, a.getId()); + + // Conservar datos existentes + a.setNombre(p.getNombre()); + a.setDireccion(p.getDireccion()); + a.setMail(p.getMail()); + a.setTelefono(p.getTelefono()); + // Modificar solo el estado + a.setStatus(0); + // Fusionar los cambios en la entidad proveedor + em.merge(a); + // Finalizar transacción + em.getTransaction().commit(); + + return true; + + } + + public void editar(Proovedor a){ + buscarPorId(a); + em.getTransaction().begin(); + em.merge(a);//edita en la base de datos + em.getTransaction().commit(); + } + + public Proovedor buscarPorId(Proovedor a){ + Query q =em.createNamedQuery("Proovedor.findById"); + q.setParameter("id", a.getId()); + if(q.getResultList().isEmpty()){ + return null; + }else{ + + return (Proovedor)q.getResultList().get(0); + } + } + public List getTodos(boolean status){ + Query q =em.createNamedQuery("Proovedor.findByStatus"); + int s = status?1:0; + q.setParameter("status", s); + return q.getResultList(); + } + } + diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/ResguardoDao.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/ResguardoDao.java new file mode 100644 index 0000000..fc13f66 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/ResguardoDao.java @@ -0,0 +1,79 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.Dao; + +import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import javax.persistence.Query; +import mx.edu.tsj.chapala.sistemas.modelo.Resguardo; + +/** + * + * @author mauricionunezrodriguez + */ +public class ResguardoDao { + + private EntityManager em;//Manejador de Entidades + + public ResguardoDao(){ + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + em=emf.createEntityManager(); + } + + + public void agregar(Resguardo a){ + em.getTransaction().begin(); + em.persist(a); //Almacenar en la BD + em.getTransaction().commit(); + } + + public boolean eliminar(Resguardo a) { + em.getTransaction().begin(); + + // Obtener proveedor actualizado desde la base de datos + Resguardo p = em.find(Resguardo.class, a.getId()); + + // Conservar datos existentes + a.setProductoId(p.getProductoId()); + a.setUsuarioid(p.getUsuarioid()); + a.setFecha(p.getFecha()); + // Modificar solo el estado + a.setStatus(0); + // Fusionar los cambios en la entidad proveedor + em.merge(a); + // Finalizar transacción + em.getTransaction().commit(); + + return true; + + } + + public void editar(Resguardo a){ + buscarPorId(a); + em.getTransaction().begin(); + em.merge(a);//edita en la base de datos + em.getTransaction().commit(); + } + + public Resguardo buscarPorId(Resguardo a){ + Query q =em.createNamedQuery("Resguardo.findById"); + q.setParameter("id", a.getId()); + if(q.getResultList().isEmpty()){ + return null; + }else{ + + return (Resguardo)q.getResultList().get(0); + } + } + public List getTodos(boolean status){ + Query q =em.createNamedQuery("Resguardo.findByStatus"); + int s = status?1:0; + q.setParameter("status", s); + return q.getResultList(); + } + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/RolDao.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/RolDao.java new file mode 100644 index 0000000..7025037 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/RolDao.java @@ -0,0 +1,76 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.Dao; + +import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import javax.persistence.Query; +import mx.edu.tsj.chapala.sistemas.modelo.Rol; + +/** + * + * @author mauricionunezrodriguez + */ +public class RolDao { + + private EntityManager em;//Manejador de Entidades + + public RolDao(){ + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + em=emf.createEntityManager(); + } + + + public void agregar(Rol a){ + em.getTransaction().begin(); + em.persist(a); //Almacenar en la BD + em.getTransaction().commit(); + } + + public boolean eliminar(Rol a) { + em.getTransaction().begin(); + + // Obtener proveedor actualizado desde la base de datos + Rol p = em.find(Rol.class, a.getId()); + + // Conservar datos existentes + a.setNombre(p.getNombre()); + a.setDescripcion(p.getDescripcion()); + // Modificar solo el estado + a.setStatus(0); + // Fusionar los cambios en la entidad proveedor + em.merge(a); + // Finalizar transacción + em.getTransaction().commit(); + + return true; + + } + + public void editar(Rol a){ + em.getTransaction().begin(); + em.merge(a);//edita en la base de datos + em.getTransaction().commit(); + } + + public Rol buscarPorId(Rol a){ + Query q =em.createNamedQuery("Rol.findById"); + q.setParameter("id", a.getId()); + if(q.getResultList().isEmpty()){ + return null; + }else{ + + return (Rol)q.getResultList().get(0); + } + } + public List getTodos(boolean status){ + Query q =em.createNamedQuery("Rol.findByStatus"); + int s = status?1:0; + q.setParameter("status", s); + return q.getResultList(); + } +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/UbicacionDao.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/UbicacionDao.java new file mode 100644 index 0000000..6bdebd1 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/UbicacionDao.java @@ -0,0 +1,83 @@ +package mx.edu.tsj.chapala.sistemas.Dao; + +import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import javax.persistence.Query; +import mx.edu.tsj.chapala.sistemas.modelo.Ubicacion; + + +public class UbicacionDao { + + private EntityManager em;//Manejador de Entidades + + public UbicacionDao(){ + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + em=emf.createEntityManager(); + } + + + public void agregar(Ubicacion a){ + em.getTransaction().begin(); + em.persist(a); //Almacenar en la BD + em.getTransaction().commit(); + } + + public boolean eliminar(Ubicacion a) { + em.getTransaction().begin(); + + // Obtener proveedor actualizado desde la base de datos + Ubicacion p = em.find(Ubicacion.class, a.getId()); + + // Conservar datos existentes + a.setEstanteid(p.getEstanteid()); + a.setPasilloId(p.getPasilloId()); + + + // Modificar solo el estado + a.setStatus(0); + // Fusionar los cambios en la entidad proveedor + em.merge(a); + // Finalizar transacción + em.getTransaction().commit(); + + return true; + + } + + public void editar(Ubicacion a){ + buscarPorId(a); + em.getTransaction().begin(); + em.merge(a);//edita en la base de datos + em.getTransaction().commit(); + } + + public Ubicacion buscarPorId(Ubicacion a){ + Query q =em.createNamedQuery("Ubicacion.findById"); + q.setParameter("id", a.getId()); + if(q.getResultList().isEmpty()){ + return null; + }else{ + + return (Ubicacion)q.getResultList().get(0); + } + } + public List getTodos(boolean status){ + Query q =em.createNamedQuery("Ubicacion.findByStatus"); + int s = status?1:0; + q.setParameter("status", s); + return q.getResultList(); + } + public Ubicacion buscarPorNombre(Ubicacion a){ + Query q =em.createNamedQuery("Ubicacion.findById"); + q.setParameter("Ubicacion", a.getId()); + if(q.getResultList().isEmpty()){ + return null; + }else{ + + return (Ubicacion)q.getResultList().get(0); + } + } + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/UsuarioDao.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/UsuarioDao.java new file mode 100644 index 0000000..b5e078a --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/Dao/UsuarioDao.java @@ -0,0 +1,101 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.Dao; + +import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.NoResultException; +import javax.persistence.Persistence; +import javax.persistence.Query; +import javax.persistence.TypedQuery; +import mx.edu.tsj.chapala.sistemas.modelo.Usuario; + +/** + * + * @author mauricionunezrodriguez + */ +public class UsuarioDao { + + + private EntityManager em;//Manejador de Entidades + + public UsuarioDao(){ + + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + em=emf.createEntityManager(); + + } + + + public void agregar(Usuario a){ + em.getTransaction().begin(); + em.persist(a); //Almacenar en la BD + em.getTransaction().commit(); + } + + public boolean eliminar(Usuario a) { + em.getTransaction().begin(); + // Obtener proveedor actualizado desde la base de datos + Usuario u = em.find(Usuario.class, a.getId()); + + // Conservar datos existentes + a.setNombre(u.getNombre()); + a.setPass(u.getPass()); + a.setMail(u.getMail()); + a.setTelefono(u.getTelefono()); + a.setRolid(u.getRolid()); + + // Modificar solo el estado + a.setStatus(0); + // Fusionar los cambios en la entidad proveedor + em.merge(a); + // Finalizar transacción + em.getTransaction().commit(); + + return true; + } + + public void editar(Usuario a){ + a.setStatus(1); + em.getTransaction().begin(); + em.merge(a);//edita en la base de datos + em.getTransaction().commit(); + } + + public Usuario buscarPorId(Usuario a){ + Query q =em.createNamedQuery("Usuario.findById"); + q.setParameter("id", a.getId()); + if(q.getResultList().isEmpty()){ + return null; + }else{ + + return (Usuario)q.getResultList().get(0); + } + } + public List getTodos(boolean status){ + Query q =em.createNamedQuery("Usuario.findByStatus"); + int s = status?1:0; + q.setParameter("status", s); + return q.getResultList(); + } + + public boolean validarLogin(String nombre, String pass) { + try { + // Crear la consulta nombrada + TypedQuery query = em.createNamedQuery("Usuario.Login", Usuario.class); + // Establecer los parámetros de la consulta + query.setParameter("nombre", nombre); + query.setParameter("pass", pass); + // Ejecutar la consulta y obtener el resultado + Usuario usuario = query.getSingleResult(); + // Si se encontró un usuario, la validación es exitosa + return usuario != null; + } catch (NoResultException e) { + // Si no se encontró ningún resultado, la validación falla + return false; + } + } + } \ No newline at end of file diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/CategoriaBL.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/CategoriaBL.java new file mode 100644 index 0000000..ef6607a --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/CategoriaBL.java @@ -0,0 +1,60 @@ + +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import mx.edu.tsj.chapala.sistemas.Dao.CategoriaDao; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Categoria; + + +@Stateless +public class CategoriaBL implements CategoriaBLLocal { + + private EntityManager em; + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + + @Override + public Mensaje agregar(Categoria a) { + + System.out.println("llegaste al metodo"); + CategoriaDao categoriaDao =new CategoriaDao(); + categoriaDao.agregar(a); + return Mensaje.SIN_ERROR; + + + } + + + @Override + public Categoria buscarId(Categoria b) { + CategoriaDao a = new CategoriaDao(); + + return a.buscarPorId(b); + + } + + + @Override + public Mensaje eliminar(Categoria b) { + CategoriaDao a = new CategoriaDao(); + a.eliminar(b); + return Mensaje.ELEMENTO_BORRADO; + + } + + @Override + public void editar(Categoria b) { + CategoriaDao a = new CategoriaDao(); + a.editar(b); + } + + @Override + public List getALLCategoria(boolean status) { + CategoriaDao n = new CategoriaDao(); + return n.getTodos(status); + } +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/CategoriaBLLocal.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/CategoriaBLLocal.java new file mode 100644 index 0000000..4fd90a5 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/CategoriaBLLocal.java @@ -0,0 +1,22 @@ + +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Local; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Categoria; + + +@Local +public interface CategoriaBLLocal { + + Mensaje agregar(Categoria b); + + Categoria buscarId(Categoria b); + + Mensaje eliminar(Categoria b); + + void editar(Categoria b); + + public List getALLCategoria(boolean status); +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/EstanteBL.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/EstanteBL.java new file mode 100644 index 0000000..41aead9 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/EstanteBL.java @@ -0,0 +1,66 @@ + +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import mx.edu.tsj.chapala.sistemas.Dao.EstanteDao; + +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Estante; + + + +@Stateless +public class EstanteBL implements EstanteBLLocal { + + + + private EntityManager em; + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + + @Override + public Mensaje agregar(Estante a) { + + System.out.println("llegaste al metodo"); + EstanteDao ubicacionDao =new EstanteDao(); + ubicacionDao.agregar(a); + return Mensaje.SIN_ERROR; + + + } + + + @Override + public Estante buscarId(Estante b) { + EstanteDao a = new EstanteDao(); + + return a.buscarPorId(b); + + } + + + @Override + public Mensaje eliminar(Estante b) { + EstanteDao a = new EstanteDao(); + a.eliminar(b); + return Mensaje.ELEMENTO_BORRADO; + + } + + @Override + public void editar(Estante b) { + EstanteDao a = new EstanteDao(); + a.editar(b); + } + + @Override + public List getALLE(boolean status) { + EstanteDao n = new EstanteDao(); + return n.getTodos(status); + } + + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/EstanteBLLocal.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/EstanteBLLocal.java new file mode 100644 index 0000000..b0e027f --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/EstanteBLLocal.java @@ -0,0 +1,25 @@ + +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Local; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Estante; + + +@Local +public interface EstanteBLLocal { + + + Mensaje agregar(Estante b); + + Estante buscarId(Estante b); + + Mensaje eliminar(Estante b); + + void editar(Estante b); + + List getALLE(boolean status); + + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/MarcaBL.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/MarcaBL.java new file mode 100644 index 0000000..d8d0b79 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/MarcaBL.java @@ -0,0 +1,62 @@ + +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import javax.persistence.Query; +import mx.edu.tsj.chapala.sistemas.Dao.MarcaDao; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Marca; + + +@Stateless +public class MarcaBL implements MarcaBLLocal { +private EntityManager em; + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + + @Override + public Mensaje agregar(Marca a) { + + System.out.println("llegaste al metodo"); + MarcaDao marcaDao =new MarcaDao(); + marcaDao.agregar(a); + return Mensaje.SIN_ERROR; + + } + + + @Override + public Marca buscarId(Marca b) { + MarcaDao a = new MarcaDao(); + + return a.buscarPorId(b); + + } + + + @Override + public Mensaje eliminar(Marca b) { + MarcaDao a = new MarcaDao(); + a.eliminar(b); + return Mensaje.ELEMENTO_BORRADO; + + } + + @Override + public void editar(Marca b) { + MarcaDao a = new MarcaDao(); + a.editar(b); + + } + + @Override + public List getALL (boolean status) { + MarcaDao n = new MarcaDao(); + return n.getTodos(status); + } + + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/MarcaBLLocal.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/MarcaBLLocal.java new file mode 100644 index 0000000..ba67907 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/MarcaBLLocal.java @@ -0,0 +1,22 @@ + +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Local; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Marca; + + +@Local +public interface MarcaBLLocal { + + Mensaje agregar(Marca b); + + Marca buscarId(Marca b); + + Mensaje eliminar(Marca b); + + void editar(Marca b); + + public List getALL(boolean status); +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/PasilloBL.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/PasilloBL.java new file mode 100644 index 0000000..2e1718b --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/PasilloBL.java @@ -0,0 +1,60 @@ + +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import mx.edu.tsj.chapala.sistemas.Dao.PasilloDao; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Pasillo; + + +@Stateless +public class PasilloBL implements PasilloBLLocal { + + private EntityManager em; + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + @Override + public Mensaje agregar(Pasillo a) { + + System.out.println("llegaste al metodo"); + PasilloDao pasilloDao =new PasilloDao(); + pasilloDao.agregar(a); + return Mensaje.SIN_ERROR; + + + } + + + @Override + public Pasillo buscarId(Pasillo b) { + PasilloDao a = new PasilloDao(); + + return a.buscarPorId(b); + + } + + + @Override + public Mensaje eliminar(Pasillo b) { + PasilloDao a = new PasilloDao(); + a.eliminar(b); + return Mensaje.ELEMENTO_BORRADO; + + } + + @Override + public void editar(Pasillo b) { + PasilloDao a = new PasilloDao(); + a.editar(b); + + } + + @Override + public List getALL (boolean status) { + PasilloDao n = new PasilloDao(); + return n.getTodos(status); + } +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/PasilloBLLocal.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/PasilloBLLocal.java new file mode 100644 index 0000000..fabd6dd --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/PasilloBLLocal.java @@ -0,0 +1,22 @@ + +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Local; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Pasillo; + +@Local +public interface PasilloBLLocal { + + + Mensaje agregar(Pasillo b); + + Pasillo buscarId(Pasillo b); + + Mensaje eliminar(Pasillo b); + + void editar(Pasillo b); + + public List getALL (boolean status); +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ProductoBL.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ProductoBL.java new file mode 100644 index 0000000..f3c9fb3 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ProductoBL.java @@ -0,0 +1,61 @@ + +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import mx.edu.tsj.chapala.sistemas.Dao.ProductoDao; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Producto; + +@Stateless +public class ProductoBL implements ProductoBLLocal { +private EntityManager em; + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + + @Override + public Mensaje agregar(Producto a) { + + System.out.println("llegaste al metodo"); + ProductoDao productoDao =new ProductoDao(); + productoDao.agregar(a); + return Mensaje.SIN_ERROR; + + + } + + + @Override + public Producto buscarId(Producto b) { + ProductoDao a = new ProductoDao(); + + return a.buscarPorId(b); + + } + + + @Override + public Mensaje eliminar(Producto b) { + ProductoDao a = new ProductoDao(); + a.eliminar(b); + return Mensaje.ELEMENTO_BORRADO; + + } + + @Override + public void editar(Producto b) { + ProductoDao a = new ProductoDao(); + a.editar(b); + + } + + @Override + public List getALL (boolean status) { + ProductoDao n = new ProductoDao(); + return n.getTodos(status); + } + + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ProductoBLLocal.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ProductoBLLocal.java new file mode 100644 index 0000000..fcf63e1 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ProductoBLLocal.java @@ -0,0 +1,26 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Local; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Producto; +import mx.edu.tsj.chapala.sistemas.modelo.Proovedor; + + +@Local +public interface ProductoBLLocal { + + Mensaje agregar(Producto b); + + Producto buscarId(Producto b); + + Mensaje eliminar(Producto b); + + void editar(Producto b); + + public List getALL(boolean status); +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ProovedorBL.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ProovedorBL.java new file mode 100644 index 0000000..2cb0980 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ProovedorBL.java @@ -0,0 +1,61 @@ + +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; + +import mx.edu.tsj.chapala.sistemas.Dao.ProovedorDao; +import mx.edu.tsj.chapala.sistemas.Mensaje; + +import mx.edu.tsj.chapala.sistemas.modelo.Proovedor; + + +@Stateless +public class ProovedorBL implements ProovedorBLLocal { + + private EntityManager em; + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + + @Override + public Mensaje agregar(Proovedor a) { + + System.out.println("llegaste al metodo"); + ProovedorDao proovedorDao =new ProovedorDao(); + proovedorDao.agregar(a); + return Mensaje.SIN_ERROR; + + + } + + + @Override + public Proovedor buscarId(Proovedor b) { + ProovedorDao a = new ProovedorDao(); + + return a.buscarPorId(b); + + } + + @Override + public Mensaje eliminar(Proovedor b) { + ProovedorDao a = new ProovedorDao(); + a.eliminar(b); + return Mensaje.ELEMENTO_BORRADO; + + } + + @Override + public void editar(Proovedor b) { + ProovedorDao a = new ProovedorDao(); + a.editar(b); + } + @Override + public List getALLProveedor(boolean status) { + ProovedorDao n = new ProovedorDao(); + return n.getTodos(status); + } + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ProovedorBLLocal.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ProovedorBLLocal.java new file mode 100644 index 0000000..ad32827 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ProovedorBLLocal.java @@ -0,0 +1,21 @@ +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Local; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Proovedor; + +@Local +public interface ProovedorBLLocal { + + Mensaje agregar(Proovedor b); + + Proovedor buscarId(Proovedor b); + + Mensaje eliminar(Proovedor b); + + void editar(Proovedor b); + + List getALLProveedor(boolean status); + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ResguardoBL.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ResguardoBL.java new file mode 100644 index 0000000..6b7ca99 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ResguardoBL.java @@ -0,0 +1,67 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import mx.edu.tsj.chapala.sistemas.Dao.ResguardoDao; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Resguardo; + +/** + * + * @author mauricionunezrodriguez + */ +@Stateless +public class ResguardoBL implements ResguardoBLLocal { + + private EntityManager em; + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + + @Override + public Mensaje agregar(Resguardo a) { + + System.out.println("llegaste al metodo"); + ResguardoDao RD =new ResguardoDao(); + RD.agregar(a); + return Mensaje.SIN_ERROR; + + + } + + + @Override + public Resguardo buscarId(Resguardo b) { + ResguardoDao a = new ResguardoDao(); + + return a.buscarPorId(b); + + } + + @Override + public Mensaje eliminar(Resguardo b) { + ResguardoDao a = new ResguardoDao(); + a.eliminar(b); + return Mensaje.ELEMENTO_BORRADO; + + } + + @Override + public void editar(Resguardo b) { + ResguardoDao a = new ResguardoDao(); + a.editar(b); + } + + @Override + public List getALL(boolean status){ + ResguardoDao n = new ResguardoDao(); + List l = n.getTodos(status); + return l; + } + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ResguardoBLLocal.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ResguardoBLLocal.java new file mode 100644 index 0000000..9b03c41 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/ResguardoBLLocal.java @@ -0,0 +1,29 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Local; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Resguardo; + +/** + * + * @author mauricionunezrodriguez + */ +@Local +public interface ResguardoBLLocal { + + Mensaje agregar( Resguardo b); + + Resguardo buscarId( Resguardo b); + + Mensaje eliminar( Resguardo b); + + void editar( Resguardo b); + + public List getALL(boolean status); + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/RolBL.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/RolBL.java new file mode 100644 index 0000000..f5e5a0f --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/RolBL.java @@ -0,0 +1,63 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import mx.edu.tsj.chapala.sistemas.Dao.RolDao; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Rol; + +@Stateless +public class RolBL implements RolBLLocal { + + private EntityManager em; + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + + @Override + public Mensaje agregar(Rol a) { + System.out.println("llegaste al metodo"); + RolDao Rol =new RolDao(); + Rol.agregar(a); + return Mensaje.SIN_ERROR; + + + } + + + @Override + public Rol buscarId(Rol a) { + RolDao Rol = new RolDao(); + + return Rol.buscarPorId(a); + + } + + + @Override + public Mensaje eliminar(Rol a) { + RolDao Rol = new RolDao(); + Rol.eliminar(a); + return Mensaje.ELEMENTO_BORRADO; + + } + + @Override + public void editar(Rol a) { + RolDao Rol = new RolDao(); + Rol.editar(a); + } + + @Override + public List getALL(boolean status){ + RolDao n = new RolDao(); + return n.getTodos(status); + } +} + + diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/RolBLLocal.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/RolBLLocal.java new file mode 100644 index 0000000..883a66a --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/RolBLLocal.java @@ -0,0 +1,26 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Local; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Rol; + + +@Local +public interface RolBLLocal { + + Mensaje agregar(Rol a); + + Rol buscarId(Rol a); + + Mensaje eliminar(Rol a); + + void editar(Rol a); + + public List getALL(boolean status); + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/UbicacionBL.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/UbicacionBL.java new file mode 100644 index 0000000..fb7f3bc --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/UbicacionBL.java @@ -0,0 +1,64 @@ +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import mx.edu.tsj.chapala.sistemas.Dao.UbicacionDao; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Ubicacion; + + +@Stateless +public class UbicacionBL implements UbicacionBLLocal { + + + private EntityManager em; + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + + @Override + public Mensaje agregar(Ubicacion a) { + + System.out.println("llegaste al metodo"); + UbicacionDao ubicacionDao =new UbicacionDao(); + ubicacionDao.agregar(a); + return Mensaje.SIN_ERROR; + + + } + + + @Override + public Ubicacion buscarId(Ubicacion b) { + UbicacionDao a = new UbicacionDao(); + + return a.buscarPorId(b); + + } + + + @Override + public Mensaje eliminar(Ubicacion b) { + UbicacionDao a = new UbicacionDao(); + a.eliminar(b); + return Mensaje.ELEMENTO_BORRADO; + + } + + @Override + public void editar(Ubicacion b) { + UbicacionDao a = new UbicacionDao(); + a.editar(b); + + } + + @Override + public List getALL (boolean status) { + UbicacionDao n = new UbicacionDao(); + return n.getTodos(status); + } + + + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/UbicacionBLLocal.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/UbicacionBLLocal.java new file mode 100644 index 0000000..9d0e82b --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/UbicacionBLLocal.java @@ -0,0 +1,24 @@ + +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Local; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Ubicacion; + +@Local +public interface UbicacionBLLocal { + + + + Mensaje agregar( Ubicacion b); + + Ubicacion buscarId( Ubicacion b); + + Mensaje eliminar( Ubicacion b); + + void editar( Ubicacion b); + + public List getALL(boolean status); + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/UsuarioBL.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/UsuarioBL.java new file mode 100644 index 0000000..61a4181 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/UsuarioBL.java @@ -0,0 +1,68 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.NoResultException; +import javax.persistence.Persistence; +import javax.persistence.TypedQuery; +import mx.edu.tsj.chapala.sistemas.Dao.UsuarioDao; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Usuario; + + +@Stateless +public class UsuarioBL implements UsuarioBLLocal { + + private EntityManager em; + EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); + + + + @Override + public Mensaje agregar(Usuario a) { + + System.out.println("llegaste al metodo"); + UsuarioDao u =new UsuarioDao(); + u.agregar(a); + return Mensaje.ELEMENTO_DUPLICADO; + + + } + + + @Override + public Usuario buscarId(Usuario b) { + UsuarioDao a = new UsuarioDao(); + + return a.buscarPorId(b); + + } + + + @Override + public Mensaje eliminar(Usuario b) { + UsuarioDao a = new UsuarioDao(); + a.eliminar(b); + return Mensaje.ELEMENTO_BORRADO; + + } + + @Override + public void editar(Usuario b) { + UsuarioDao a = new UsuarioDao(); + a.editar(b); + } + + @Override + public List getALL (boolean status){ + UsuarioDao u = new UsuarioDao(); + List l = u.getTodos(status); + return l; + } +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/UsuarioBLLocal.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/UsuarioBLLocal.java new file mode 100644 index 0000000..84f4a16 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/controller/UsuarioBLLocal.java @@ -0,0 +1,23 @@ + +package mx.edu.tsj.chapala.sistemas.controller; + +import java.util.List; +import javax.ejb.Local; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.modelo.Usuario; + + +@Local +public interface UsuarioBLLocal { + + Mensaje agregar(Usuario b); + + Usuario buscarId(Usuario b); + + Mensaje eliminar(Usuario b); + + void editar(Usuario b); + + public List getALL(boolean status); + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Categoria.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Categoria.java new file mode 100644 index 0000000..e63e003 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Categoria.java @@ -0,0 +1,128 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.modelo; + +import java.io.Serializable; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; + +/** + * + * @author Moises Ibarra + */ +@Entity +@Table(name = "categoria", catalog = "inventario", schema = "") +@XmlRootElement +@NamedQueries({ + @NamedQuery(name = "Categoria.findAll", query = "SELECT c FROM Categoria c"), + @NamedQuery(name = "Categoria.findById", query = "SELECT c FROM Categoria c WHERE c.id = :id"), + @NamedQuery(name = "Categoria.findByNombre", query = "SELECT c FROM Categoria c WHERE c.nombre = :nombre"), + @NamedQuery(name = "Categoria.findByStatus", query = "SELECT c FROM Categoria c WHERE c.status = :status")}) +public class Categoria implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private Integer id; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 30) + @Column(name = "nombre") + private String nombre; + @Basic(optional = false) + @NotNull + @Column(name = "status") + private int status; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaid") + private List productoList; + + public Categoria() { + } + + public Categoria(Integer id) { + this.id = id; + } + + public Categoria(Integer id, String nombre, int status) { + this.id = id; + this.nombre = nombre; + this.status = status; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getNombre() { + return nombre; + } + + public void setNombre(String nombre) { + this.nombre = nombre; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + @XmlTransient + public List getProductoList() { + return productoList; + } + + public void setProductoList(List productoList) { + this.productoList = productoList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (id != null ? id.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Categoria)) { + return false; + } + Categoria other = (Categoria) object; + if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "mx.edu.tsj.chapala.sistemas.modelo.Categoria[ id=" + id + " ]"; + } + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Estante.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Estante.java new file mode 100644 index 0000000..0c96176 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Estante.java @@ -0,0 +1,126 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.modelo; + +import java.io.Serializable; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; + +/** + * + * @author Moises Ibarra + */ +@Entity +@Table(name = "estante", catalog = "inventario", schema = "") +@XmlRootElement +@NamedQueries({ + @NamedQuery(name = "Estante.findAll", query = "SELECT e FROM Estante e"), + @NamedQuery(name = "Estante.findById", query = "SELECT e FROM Estante e WHERE e.id = :id"), + @NamedQuery(name = "Estante.findByNumeroE", query = "SELECT e FROM Estante e WHERE e.numeroE = :numeroE"), + @NamedQuery(name = "Estante.findByStatus", query = "SELECT e FROM Estante e WHERE e.status = :status")}) +public class Estante implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private Integer id; + @Basic(optional = false) + @NotNull + @Column(name = "numeroE") + private int numeroE; + @Basic(optional = false) + @NotNull + @Column(name = "status") + private int status; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "estanteid") + private List ubicacionList; + + public Estante() { + } + + public Estante(Integer id) { + this.id = id; + } + + public Estante(Integer id, int numeroE, int status) { + this.id = id; + this.numeroE = numeroE; + this.status = status; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public int getNumeroE() { + return numeroE; + } + + public void setNumeroE(int numeroE) { + this.numeroE = numeroE; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + @XmlTransient + public List getUbicacionList() { + return ubicacionList; + } + + public void setUbicacionList(List ubicacionList) { + this.ubicacionList = ubicacionList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (id != null ? id.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Estante)) { + return false; + } + Estante other = (Estante) object; + if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "mx.edu.tsj.chapala.sistemas.modelo.Estante[ id=" + id + " ]"; + } + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Marca.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Marca.java new file mode 100644 index 0000000..214b7cd --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Marca.java @@ -0,0 +1,128 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.modelo; + +import java.io.Serializable; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; + +/** + * + * @author Moises Ibarra + */ +@Entity +@Table(name = "marca", catalog = "inventario", schema = "") +@XmlRootElement +@NamedQueries({ + @NamedQuery(name = "Marca.findAll", query = "SELECT m FROM Marca m"), + @NamedQuery(name = "Marca.findById", query = "SELECT m FROM Marca m WHERE m.id = :id"), + @NamedQuery(name = "Marca.findByNombre", query = "SELECT m FROM Marca m WHERE m.nombre = :nombre"), + @NamedQuery(name = "Marca.findByStatus", query = "SELECT m FROM Marca m WHERE m.status = :status")}) +public class Marca implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private Integer id; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 20) + @Column(name = "nombre") + private String nombre; + @Basic(optional = false) + @NotNull + @Column(name = "status") + private int status; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "marcaid") + private List productoList; + + public Marca() { + } + + public Marca(Integer id) { + this.id = id; + } + + public Marca(Integer id, String nombre, int status) { + this.id = id; + this.nombre = nombre; + this.status = status; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getNombre() { + return nombre; + } + + public void setNombre(String nombre) { + this.nombre = nombre; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + @XmlTransient + public List getProductoList() { + return productoList; + } + + public void setProductoList(List productoList) { + this.productoList = productoList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (id != null ? id.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Marca)) { + return false; + } + Marca other = (Marca) object; + if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "mx.edu.tsj.chapala.sistemas.modelo.Marca[ id=" + id + " ]"; + } + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Pasillo.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Pasillo.java new file mode 100644 index 0000000..e0dc090 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Pasillo.java @@ -0,0 +1,126 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.modelo; + +import java.io.Serializable; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; + +/** + * + * @author Moises Ibarra + */ +@Entity +@Table(name = "pasillo", catalog = "inventario", schema = "") +@XmlRootElement +@NamedQueries({ + @NamedQuery(name = "Pasillo.findAll", query = "SELECT p FROM Pasillo p"), + @NamedQuery(name = "Pasillo.findById", query = "SELECT p FROM Pasillo p WHERE p.id = :id"), + @NamedQuery(name = "Pasillo.findByNumeroP", query = "SELECT p FROM Pasillo p WHERE p.numeroP = :numeroP"), + @NamedQuery(name = "Pasillo.findByStatus", query = "SELECT p FROM Pasillo p WHERE p.status = :status")}) +public class Pasillo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private Integer id; + @Basic(optional = false) + @NotNull + @Column(name = "numeroP") + private int numeroP; + @Basic(optional = false) + @NotNull + @Column(name = "status") + private int status; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "pasilloId") + private List ubicacionList; + + public Pasillo() { + } + + public Pasillo(Integer id) { + this.id = id; + } + + public Pasillo(Integer id, int numeroP, int status) { + this.id = id; + this.numeroP = numeroP; + this.status = status; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public int getNumeroP() { + return numeroP; + } + + public void setNumeroP(int numeroP) { + this.numeroP = numeroP; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + @XmlTransient + public List getUbicacionList() { + return ubicacionList; + } + + public void setUbicacionList(List ubicacionList) { + this.ubicacionList = ubicacionList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (id != null ? id.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Pasillo)) { + return false; + } + Pasillo other = (Pasillo) object; + if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "mx.edu.tsj.chapala.sistemas.modelo.Pasillo[ id=" + id + " ]"; + } + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Producto.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Producto.java new file mode 100644 index 0000000..839e40b --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Producto.java @@ -0,0 +1,221 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.modelo; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; + +/** + * + * @author Moises Ibarra + */ +@Entity +@Table(name = "producto", catalog = "inventario", schema = "") +@XmlRootElement +@NamedQueries({ + @NamedQuery(name = "Producto.findAll", query = "SELECT p FROM Producto p"), + @NamedQuery(name = "Producto.findById", query = "SELECT p FROM Producto p WHERE p.id = :id"), + @NamedQuery(name = "Producto.findByCodigo", query = "SELECT p FROM Producto p WHERE p.codigo = :codigo"), + @NamedQuery(name = "Producto.findByNombre", query = "SELECT p FROM Producto p WHERE p.nombre = :nombre"), + @NamedQuery(name = "Producto.findByPrecio", query = "SELECT p FROM Producto p WHERE p.precio = :precio"), + @NamedQuery(name = "Producto.findByFecha", query = "SELECT p FROM Producto p WHERE p.fecha = :fecha"), + @NamedQuery(name = "Producto.findByStatus", query = "SELECT p FROM Producto p WHERE p.status = :status")}) +public class Producto implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private Integer id; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 20) + @Column(name = "codigo") + private String codigo; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 50) + @Column(name = "nombre") + private String nombre; + @Basic(optional = false) + @NotNull + @Column(name = "precio") + private float precio; + @Basic(optional = false) + @NotNull + @Column(name = "fecha") + @Temporal(TemporalType.DATE) + private Date fecha; + @Basic(optional = false) + @NotNull + @Column(name = "status") + private int status; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "productoId") + private List resguardoList; + @JoinColumn(name = "Categoria_id", referencedColumnName = "id") + @ManyToOne(optional = false) + private Categoria categoriaid; + @JoinColumn(name = "Marca_id", referencedColumnName = "id") + @ManyToOne(optional = false) + private Marca marcaid; + @JoinColumn(name = "Proovedor_id", referencedColumnName = "id") + @ManyToOne(optional = false) + private Proovedor proovedorid; + @JoinColumn(name = "Ubicacion_id", referencedColumnName = "id") + @ManyToOne(optional = false) + private Ubicacion ubicacionid; + + public Producto() { + } + + public Producto(Integer id) { + this.id = id; + } + + public Producto(Integer id, String codigo, String nombre, float precio, Date fecha, int status) { + this.id = id; + this.codigo = codigo; + this.nombre = nombre; + this.precio = precio; + this.fecha = fecha; + this.status = status; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getCodigo() { + return codigo; + } + + public void setCodigo(String codigo) { + this.codigo = codigo; + } + + public String getNombre() { + return nombre; + } + + public void setNombre(String nombre) { + this.nombre = nombre; + } + + public float getPrecio() { + return precio; + } + + public void setPrecio(float precio) { + this.precio = precio; + } + + public Date getFecha() { + return fecha; + } + + public void setFecha(Date fecha) { + this.fecha = fecha; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + @XmlTransient + public List getResguardoList() { + return resguardoList; + } + + public void setResguardoList(List resguardoList) { + this.resguardoList = resguardoList; + } + + public Categoria getCategoriaid() { + return categoriaid; + } + + public void setCategoriaid(Categoria categoriaid) { + this.categoriaid = categoriaid; + } + + public Marca getMarcaid() { + return marcaid; + } + + public void setMarcaid(Marca marcaid) { + this.marcaid = marcaid; + } + + public Proovedor getProovedorid() { + return proovedorid; + } + + public void setProovedorid(Proovedor proovedorid) { + this.proovedorid = proovedorid; + } + + public Ubicacion getUbicacionid() { + return ubicacionid; + } + + public void setUbicacionid(Ubicacion ubicacionid) { + this.ubicacionid = ubicacionid; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (id != null ? id.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Producto)) { + return false; + } + Producto other = (Producto) object; + if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "mx.edu.tsj.chapala.sistemas.modelo.Producto[ id=" + id + " ]"; + } + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Proovedor.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Proovedor.java new file mode 100644 index 0000000..b52bf6f --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Proovedor.java @@ -0,0 +1,173 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.modelo; + +import java.io.Serializable; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; + +/** + * + * @author Moises Ibarra + */ +@Entity +@Table(name = "proovedor", catalog = "inventario", schema = "") +@XmlRootElement +@NamedQueries({ + @NamedQuery(name = "Proovedor.findAll", query = "SELECT p FROM Proovedor p"), + @NamedQuery(name = "Proovedor.findById", query = "SELECT p FROM Proovedor p WHERE p.id = :id"), + @NamedQuery(name = "Proovedor.findByNombre", query = "SELECT p FROM Proovedor p WHERE p.nombre = :nombre"), + @NamedQuery(name = "Proovedor.findByDireccion", query = "SELECT p FROM Proovedor p WHERE p.direccion = :direccion"), + @NamedQuery(name = "Proovedor.findByMail", query = "SELECT p FROM Proovedor p WHERE p.mail = :mail"), + @NamedQuery(name = "Proovedor.findByTelefono", query = "SELECT p FROM Proovedor p WHERE p.telefono = :telefono"), + @NamedQuery(name = "Proovedor.findByStatus", query = "SELECT p FROM Proovedor p WHERE p.status = :status")}) +public class Proovedor implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private Integer id; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 40) + @Column(name = "nombre") + private String nombre; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 20) + @Column(name = "direccion") + private String direccion; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 30) + @Column(name = "mail") + private String mail; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 15) + @Column(name = "telefono") + private String telefono; + @Basic(optional = false) + @NotNull + @Column(name = "status") + private int status; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "proovedorid") + private List productoList; + + public Proovedor() { + } + + public Proovedor(Integer id) { + this.id = id; + } + + public Proovedor(Integer id, String nombre, String direccion, String mail, String telefono, int status) { + this.id = id; + this.nombre = nombre; + this.direccion = direccion; + this.mail = mail; + this.telefono = telefono; + this.status = status; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getNombre() { + return nombre; + } + + public void setNombre(String nombre) { + this.nombre = nombre; + } + + public String getDireccion() { + return direccion; + } + + public void setDireccion(String direccion) { + this.direccion = direccion; + } + + public String getMail() { + return mail; + } + + public void setMail(String mail) { + this.mail = mail; + } + + public String getTelefono() { + return telefono; + } + + public void setTelefono(String telefono) { + this.telefono = telefono; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + @XmlTransient + public List getProductoList() { + return productoList; + } + + public void setProductoList(List productoList) { + this.productoList = productoList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (id != null ? id.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Proovedor)) { + return false; + } + Proovedor other = (Proovedor) object; + if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "mx.edu.tsj.chapala.sistemas.modelo.Proovedor[ id=" + id + " ]"; + } + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Resguardo.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Resguardo.java new file mode 100644 index 0000000..cae3de9 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Resguardo.java @@ -0,0 +1,139 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.modelo; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.validation.constraints.NotNull; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Moises Ibarra + */ +@Entity +@Table(name = "resguardo", catalog = "inventario", schema = "") +@XmlRootElement +@NamedQueries({ + @NamedQuery(name = "Resguardo.findAll", query = "SELECT r FROM Resguardo r"), + @NamedQuery(name = "Resguardo.findById", query = "SELECT r FROM Resguardo r WHERE r.id = :id"), + @NamedQuery(name = "Resguardo.findByFecha", query = "SELECT r FROM Resguardo r WHERE r.fecha = :fecha"), + @NamedQuery(name = "Resguardo.findByStatus", query = "SELECT r FROM Resguardo r WHERE r.status = :status")}) +public class Resguardo implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private Integer id; + @Basic(optional = false) + @NotNull + @Column(name = "fecha") + @Temporal(TemporalType.DATE) + private Date fecha; + @Basic(optional = false) + @NotNull + @Column(name = "status") + private int status; + @JoinColumn(name = "producto_id", referencedColumnName = "id") + @ManyToOne(optional = false) + private Producto productoId; + @JoinColumn(name = "Usuario_id", referencedColumnName = "id") + @ManyToOne(optional = false) + private Usuario usuarioid; + + public Resguardo() { + } + + public Resguardo(Integer id) { + this.id = id; + } + + public Resguardo(Integer id, Date fecha, int status) { + this.id = id; + this.fecha = fecha; + this.status = status; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Date getFecha() { + return fecha; + } + + public void setFecha(Date fecha) { + this.fecha = fecha; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public Producto getProductoId() { + return productoId; + } + + public void setProductoId(Producto productoId) { + this.productoId = productoId; + } + + public Usuario getUsuarioid() { + return usuarioid; + } + + public void setUsuarioid(Usuario usuarioid) { + this.usuarioid = usuarioid; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (id != null ? id.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Resguardo)) { + return false; + } + Resguardo other = (Resguardo) object; + if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "mx.edu.tsj.chapala.sistemas.modelo.Resguardo[ id=" + id + " ]"; + } + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Rol.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Rol.java new file mode 100644 index 0000000..9182402 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Rol.java @@ -0,0 +1,143 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.modelo; + +import java.io.Serializable; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; + +/** + * + * @author Moises Ibarra + */ +@Entity +@Table(name = "rol", catalog = "inventario", schema = "") +@XmlRootElement +@NamedQueries({ + @NamedQuery(name = "Rol.findAll", query = "SELECT r FROM Rol r"), + @NamedQuery(name = "Rol.findById", query = "SELECT r FROM Rol r WHERE r.id = :id"), + @NamedQuery(name = "Rol.findByNombre", query = "SELECT r FROM Rol r WHERE r.nombre = :nombre"), + @NamedQuery(name = "Rol.findByDescripcion", query = "SELECT r FROM Rol r WHERE r.descripcion = :descripcion"), + @NamedQuery(name = "Rol.findByStatus", query = "SELECT r FROM Rol r WHERE r.status = :status")}) +public class Rol implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private Integer id; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 30) + @Column(name = "nombre") + private String nombre; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 100) + @Column(name = "descripcion") + private String descripcion; + @Basic(optional = false) + @NotNull + @Column(name = "status") + private int status; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "rolid") + private List usuarioList; + + public Rol() { + } + + public Rol(Integer id) { + this.id = id; + } + + public Rol(Integer id, String nombre, String descripcion, int status) { + this.id = id; + this.nombre = nombre; + this.descripcion = descripcion; + this.status = status; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getNombre() { + return nombre; + } + + public void setNombre(String nombre) { + this.nombre = nombre; + } + + public String getDescripcion() { + return descripcion; + } + + public void setDescripcion(String descripcion) { + this.descripcion = descripcion; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + @XmlTransient + public List getUsuarioList() { + return usuarioList; + } + + public void setUsuarioList(List usuarioList) { + this.usuarioList = usuarioList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (id != null ? id.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Rol)) { + return false; + } + Rol other = (Rol) object; + if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "mx.edu.tsj.chapala.sistemas.modelo.Rol[ id=" + id + " ]"; + } + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Ubicacion.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Ubicacion.java new file mode 100644 index 0000000..309f013 --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Ubicacion.java @@ -0,0 +1,136 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.modelo; + +import java.io.Serializable; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; + +/** + * + * @author Moises Ibarra + */ +@Entity +@Table(name = "ubicacion", catalog = "inventario", schema = "") +@XmlRootElement +@NamedQueries({ + @NamedQuery(name = "Ubicacion.findAll", query = "SELECT u FROM Ubicacion u"), + @NamedQuery(name = "Ubicacion.findById", query = "SELECT u FROM Ubicacion u WHERE u.id = :id"), + @NamedQuery(name = "Ubicacion.findByStatus", query = "SELECT u FROM Ubicacion u WHERE u.status = :status")}) +public class Ubicacion implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private Integer id; + @Basic(optional = false) + @NotNull + @Column(name = "status") + private int status; + @JoinColumn(name = "Estante_id", referencedColumnName = "id") + @ManyToOne(optional = false) + private Estante estanteid; + @JoinColumn(name = "pasillo_id", referencedColumnName = "id") + @ManyToOne(optional = false) + private Pasillo pasilloId; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "ubicacionid") + private List productoList; + + public Ubicacion() { + } + + public Ubicacion(Integer id) { + this.id = id; + } + + public Ubicacion(Integer id, int status) { + this.id = id; + this.status = status; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public Estante getEstanteid() { + return estanteid; + } + + public void setEstanteid(Estante estanteid) { + this.estanteid = estanteid; + } + + public Pasillo getPasilloId() { + return pasilloId; + } + + public void setPasilloId(Pasillo pasilloId) { + this.pasilloId = pasilloId; + } + + @XmlTransient + public List getProductoList() { + return productoList; + } + + public void setProductoList(List productoList) { + this.productoList = productoList; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (id != null ? id.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Ubicacion)) { + return false; + } + Ubicacion other = (Ubicacion) object; + if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "mx.edu.tsj.chapala.sistemas.modelo.Ubicacion[ id=" + id + " ]"; + } + +} diff --git a/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Usuario.java b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Usuario.java new file mode 100644 index 0000000..d328b4d --- /dev/null +++ b/SystemInventory-ejb/src/java/mx/edu/tsj/chapala/sistemas/modelo/Usuario.java @@ -0,0 +1,188 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.modelo; + +import java.io.Serializable; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; + +/** + * + * @author Moises Ibarra + */ +@Entity +@Table(name = "usuario", catalog = "inventario", schema = "") +@XmlRootElement +@NamedQueries({ + @NamedQuery(name = "Usuario.findAll", query = "SELECT u FROM Usuario u"), + @NamedQuery(name = "Usuario.findById", query = "SELECT u FROM Usuario u WHERE u.id = :id"), + @NamedQuery(name = "Usuario.findByNombre", query = "SELECT u FROM Usuario u WHERE u.nombre = :nombre"), + @NamedQuery(name = "Usuario.findByPass", query = "SELECT u FROM Usuario u WHERE u.pass = :pass"), + @NamedQuery(name = "Usuario.findByMail", query = "SELECT u FROM Usuario u WHERE u.mail = :mail"), + @NamedQuery(name = "Usuario.findByTelefono", query = "SELECT u FROM Usuario u WHERE u.telefono = :telefono"), + @NamedQuery(name = "Usuario.findByStatus", query = "SELECT u FROM Usuario u WHERE u.status = :status"), + @NamedQuery(name = "Usuario.Login", query = "SELECT u FROM Usuario u WHERE u.nombre = :nombre and u.pass = :pass") +}) +public class Usuario implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private Integer id; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 40) + @Column(name = "nombre") + private String nombre; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 20) + @Column(name = "pass") + private String pass; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 30) + @Column(name = "mail") + private String mail; + @Basic(optional = false) + @NotNull + @Size(min = 1, max = 15) + @Column(name = "telefono") + private String telefono; + @Basic(optional = false) + @NotNull + @Column(name = "status") + private int status; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "usuarioid") + private List resguardoList; + @JoinColumn(name = "Rol_id", referencedColumnName = "id") + @ManyToOne(optional = false) + private Rol rolid; + + public Usuario() { + } + + public Usuario(Integer id) { + this.id = id; + } + + public Usuario(Integer id, String nombre, String pass, String mail, String telefono, int status) { + this.id = id; + this.nombre = nombre; + this.pass = pass; + this.mail = mail; + this.telefono = telefono; + this.status = status; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getNombre() { + return nombre; + } + + public void setNombre(String nombre) { + this.nombre = nombre; + } + + public String getPass() { + return pass; + } + + public void setPass(String pass) { + this.pass = pass; + } + + public String getMail() { + return mail; + } + + public void setMail(String mail) { + this.mail = mail; + } + + public String getTelefono() { + return telefono; + } + + public void setTelefono(String telefono) { + this.telefono = telefono; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + @XmlTransient + public List getResguardoList() { + return resguardoList; + } + + public void setResguardoList(List resguardoList) { + this.resguardoList = resguardoList; + } + + public Rol getRolid() { + return rolid; + } + + public void setRolid(Rol rolid) { + this.rolid = rolid; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (id != null ? id.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Usuario)) { + return false; + } + Usuario other = (Usuario) object; + if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "mx.edu.tsj.chapala.sistemas.modelo.Usuario[ id=" + id + " ]"; + } + +} diff --git a/SystemInventory-war/build.xml b/SystemInventory-war/build.xml new file mode 100644 index 0000000..dc0de1c --- /dev/null +++ b/SystemInventory-war/build.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + Builds, tests, and runs the project SystemInventory-war. + + + diff --git a/SystemInventory-war/libs/primefaces-12.0.0.jar b/SystemInventory-war/libs/primefaces-12.0.0.jar new file mode 100644 index 0000000..88dab24 Binary files /dev/null and b/SystemInventory-war/libs/primefaces-12.0.0.jar differ diff --git a/SystemInventory-war/nbproject/ant-deploy.xml b/SystemInventory-war/nbproject/ant-deploy.xml new file mode 100644 index 0000000..fdc06d5 --- /dev/null +++ b/SystemInventory-war/nbproject/ant-deploy.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SystemInventory-war/nbproject/build-impl.xml b/SystemInventory-war/nbproject/build-impl.xml new file mode 100644 index 0000000..a89329c --- /dev/null +++ b/SystemInventory-war/nbproject/build-impl.xml @@ -0,0 +1,1490 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set platform.home + Must set platform.bootcp + Must set platform.java + Must set platform.javac + + The J2SE Platform is not correctly set up. + Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files. + Either open the project in the IDE and setup the Platform with the same name or add it manually. + For example like this: + ant -Duser.properties.file=<path_to_property_file> jar (where you put the property "platforms.${platform.active}.home" in a .properties file) + or ant -Dplatforms.${platform.active}.home=<path_to_JDK_home> jar (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set build.web.dir + Must set build.generated.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.war + + + + + + + + + +The Java EE server classpath is not correctly set up - server home directory is missing. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Dj2ee.server.home=<app_server_installation_directory> + + +The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Duser.properties.file=<path_to_property_file> (where you put the property "j2ee.platform.classpath" in a .properties file) +or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +The libs.CopyLibs.classpath property is not set up. +This property must point to +org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part +of NetBeans IDE installation and is usually located at +<netbeans_installation>/java<version>/ant/extra folder. +Either open the project in the IDE and make sure CopyLibs library +exists or setup the property manually. For example like this: + ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + Must select a file in the IDE or set jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. + + + Launching ${browse.url} + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SystemInventory-war/nbproject/faces-config.NavData b/SystemInventory-war/nbproject/faces-config.NavData new file mode 100644 index 0000000..e69de29 diff --git a/SystemInventory-war/nbproject/genfiles.properties b/SystemInventory-war/nbproject/genfiles.properties new file mode 100644 index 0000000..8bb4f39 --- /dev/null +++ b/SystemInventory-war/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=702499fa +build.xml.script.CRC32=38b4df03 +build.xml.stylesheet.CRC32=1707db4f@1.96.0.1 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=702499fa +nbproject/build-impl.xml.script.CRC32=309b01d6 +nbproject/build-impl.xml.stylesheet.CRC32=334708a0@1.96.0.1 diff --git a/SystemInventory-war/nbproject/project.xml b/SystemInventory-war/nbproject/project.xml new file mode 100644 index 0000000..5382a7b --- /dev/null +++ b/SystemInventory-war/nbproject/project.xml @@ -0,0 +1,40 @@ + + + org.netbeans.modules.web.project + + + SystemInventory-war + 1.6.5 + + + + ${reference.SystemInventory-ejb.dist} + + + ${file.reference.primefaces-12.0.0.jar} + WEB-INF/lib + + + + + + + + + + + + ..\.\lib\nblibraries.properties + + + + SystemInventory-ejb + jar + + dist + clean + dist + + + + diff --git a/SystemInventory-war/src/conf/MANIFEST.MF b/SystemInventory-war/src/conf/MANIFEST.MF new file mode 100644 index 0000000..58630c0 --- /dev/null +++ b/SystemInventory-war/src/conf/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/SystemInventory-war/src/java/seguridad/AutorizacionListener.java b/SystemInventory-war/src/java/seguridad/AutorizacionListener.java new file mode 100644 index 0000000..13bfd3c --- /dev/null +++ b/SystemInventory-war/src/java/seguridad/AutorizacionListener.java @@ -0,0 +1,58 @@ +package seguridad; + +import java.io.IOException; +import javax.inject.Named; +import javax.enterprise.context.SessionScoped; +import javax.faces.application.NavigationHandler; +import javax.faces.context.FacesContext; +import javax.faces.event.PhaseEvent; +import javax.faces.event.PhaseId; +import javax.faces.event.PhaseListener; + +/** + * + * @author mike + */ +@Named(value = "autorizacionListener") +@SessionScoped +public class AutorizacionListener implements PhaseListener { + + /** + * Creates a new instance of AutorizacionListener + */ + public AutorizacionListener() { + } + + + private static final long serialVersionUID = 1L; + + @Override + public void afterPhase(PhaseEvent event) { + try { + //Obtener la pagina actual para validar la sesion + String paginaActual = event.getFacesContext().getViewRoot().getViewId(); + + //inicializar la sesion en caso de no haber sesion + Login.getSession(); + + //Revisar que no sea la pafina index y que no estes logueado + //para redireccionar + if (!paginaActual.contains("index.xhtml") && Login.getStatus()== false) { + FacesContext.getCurrentInstance().getExternalContext().redirect("faces/index.xhtml?faces-redirect=true"); + + NavigationHandler nh = event.getFacesContext().getApplication().getNavigationHandler(); + nh.handleNavigation(event.getFacesContext(), null, "index"); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void beforePhase(PhaseEvent event) {} + + @Override + public PhaseId getPhaseId() { + return PhaseId.RESTORE_VIEW; + } +} \ No newline at end of file diff --git a/SystemInventory-war/src/java/seguridad/Login.java b/SystemInventory-war/src/java/seguridad/Login.java new file mode 100644 index 0000000..72b7c58 --- /dev/null +++ b/SystemInventory-war/src/java/seguridad/Login.java @@ -0,0 +1,81 @@ +package seguridad; + +import javax.inject.Named; +import javax.enterprise.context.SessionScoped; +import java.io.Serializable; +import javax.faces.context.FacesContext; +import javax.persistence.EntityManager; +import javax.persistence.Persistence; + +import javax.servlet.http.HttpSession; +import mx.edu.tsj.chapala.sistemas.Dao.UsuarioDao; + +@Named(value = "login") +@SessionScoped +public class Login implements Serializable { + + private static HttpSession httpsesion; + private String nombre; + private String pass; + private UsuarioDao usuarioDao; + + public Login() { + this.usuarioDao = new UsuarioDao(); + } + + public static void getSession() { + httpsesion = (HttpSession) FacesContext.getCurrentInstance(). + getExternalContext().getSession(false); + } + + public static String logout() { + httpsesion.removeAttribute("sesionActiva"); + httpsesion.invalidate(); + return "index.xhtml"; + } + // Getter y Setter para el nombre de usuario + public String getNombre() { + return nombre; + } + + public void setNombre(String nombre) { + this.nombre = nombre; + } + + // Getter y Setter para la contraseña + public String getPass() { + return pass; + } + + public void setPass(String pass) { + this.pass = pass; + } + + + + public String login() { + + + + if (usuarioDao.validarLogin(nombre, pass)) { + + httpsesion.setAttribute("sesionActiva", "true"); + return "ProductoLista.xhtml"; + } else { + return "index.xhtml"; + } + } + + public static boolean getStatus() { + + if (httpsesion != null + && httpsesion.getId() != null + && !httpsesion.getId().isEmpty() + && httpsesion.getAttribute("sesionActiva") != null) { + return true; + } else { + return false; + } + } + +} diff --git a/SystemInventory-war/src/java/vistas/CategoriaBean.java b/SystemInventory-war/src/java/vistas/CategoriaBean.java new file mode 100644 index 0000000..e12c1ec --- /dev/null +++ b/SystemInventory-war/src/java/vistas/CategoriaBean.java @@ -0,0 +1,112 @@ +package vistas; + +import java.io.Serializable; +import java.util.List; +import java.util.Locale; +import javax.ejb.EJB; +import javax.enterprise.context.SessionScoped; +import javax.inject.Named; +import mx.edu.tsj.chapala.sistemas.controller.CategoriaBLLocal; +import mx.edu.tsj.chapala.sistemas.modelo.Categoria; +import org.primefaces.PrimeFaces; +import org.primefaces.util.LangUtils; + +/** + * + * @author mauricionunezrodriguez + */ +@Named(value = "categoriaBean") +@SessionScoped +public class CategoriaBean implements Serializable { + + @EJB + private CategoriaBLLocal CategoriaBL; + private Categoria categoria = new Categoria(); + private String titulo; + private boolean nuevo; + private List filteredCustomers3; + + public CategoriaBean() { + + } + + public List getFilteredCustomers3() { + return filteredCustomers3; + } + + public void setFilteredCustomers3(List filteredCustomers3) { + this.filteredCustomers3 = filteredCustomers3; + } + + public boolean globalFilterFunction(Object value, Object filter, Locale locale) { + String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); + if (LangUtils.isBlank(filterText)) { + return true; + } + + Categoria a = (Categoria) value; + return String.valueOf(a.getId()).contains(filterText) + || a.getNombre().toLowerCase().contains(filterText); + + } + + + public String agregarCategoria() { + categoria.setStatus(1); + CategoriaBL.agregar(categoria); + categoria = new Categoria(); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + return "CategoriaLista.xhtml"; + } + + public void PrepararEditar(Categoria categoria) { + nuevo = false; + titulo = "Editando Categoria"; + this.categoria = categoria; + PrimeFaces.current().executeScript("PF('dlg').hide()"); + + } + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + public void PrepararNuevo() { + nuevo = true; + titulo = "Agregando Categoria"; + categoria = new Categoria(); + + } + + public void PrepararEliminar(Categoria categoria) { + this.categoria = categoria; + PrimeFaces.current().executeScript("PF('dlg2').hide()"); + } + + public void editarCategoria() { + nuevo = false; + CategoriaBL.editar(categoria); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + } + + public void eliminarCategoria() { + CategoriaBL.eliminar(categoria); + } + + public List getCategoria() { + return CategoriaBL.getALLCategoria(true); + } + + public Categoria getCategorias() { + return categoria; + } + + public void setCategorias(Categoria categoria) { + this.categoria = categoria; + } + +} diff --git a/SystemInventory-war/src/java/vistas/LoginBean.java b/SystemInventory-war/src/java/vistas/LoginBean.java new file mode 100644 index 0000000..7c4e87a --- /dev/null +++ b/SystemInventory-war/src/java/vistas/LoginBean.java @@ -0,0 +1,50 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template + */ +package vistas; + +import java.io.Serializable; +import javax.enterprise.context.SessionScoped; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.inject.Named; + + + +@Named(value = "LoginBean") +@SessionScoped +public class LoginBean implements Serializable { + + + private String nombre; + private String pass; + + public String getNombre() { + return nombre; + } + + public void setNombre(String nombre) { + this.nombre = nombre; + } + + public String getPass() { + return pass; + } + + public void setPass(String pass) { + this.pass = pass; + } + + public String login() { + + // Simulando una autenticación exitosa + if ("admin".equals(nombre) && "admin".equals(pass)) { + return "Lobby.xhtml?faces-redirect=true"; + } else { + FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error", "Credenciales incorrectas")); + return null; + } + } +} + diff --git a/SystemInventory-war/src/java/vistas/MarcaBean.java b/SystemInventory-war/src/java/vistas/MarcaBean.java new file mode 100644 index 0000000..32cfc41 --- /dev/null +++ b/SystemInventory-war/src/java/vistas/MarcaBean.java @@ -0,0 +1,106 @@ +package vistas; + +import java.io.Serializable; +import java.util.List; +import java.util.Locale; +import javax.ejb.EJB; +import javax.enterprise.context.SessionScoped; +import javax.inject.Named; +import mx.edu.tsj.chapala.sistemas.controller.MarcaBLLocal; +import mx.edu.tsj.chapala.sistemas.modelo.Marca; +import org.primefaces.PrimeFaces; +import org.primefaces.util.LangUtils; + +@Named(value = "marcaBean") +@SessionScoped +public class MarcaBean implements Serializable { + + @EJB + private MarcaBLLocal marcaBL; + private Marca marca = new Marca(); + private String titulo; + private boolean nuevo; + private List filteredCustomers3; + + public MarcaBean() { + + } + + public List getFilteredCustomers3() { + return filteredCustomers3; + } + + public void setFilteredCustomers3(List filteredCustomers3) { + this.filteredCustomers3 = filteredCustomers3; + } + + public boolean globalFilterFunction(Object value, Object filter, Locale locale) { + String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); + if (LangUtils.isBlank(filterText)) { + return true; + } + + Marca a = (Marca) value; + return String.valueOf(a.getId()).contains(filterText) + || a.getNombre().toLowerCase().contains(filterText); + + } + + public String agregarMarca() { + marca.setStatus(1); + marcaBL.agregar(marca); + marca = new Marca(); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + return "MarcaLista.xhtml"; + } + + public void PrepararEditar(Marca marca) { + nuevo = false; + titulo = "Editando Marca"; + this.marca = marca; + PrimeFaces.current().executeScript("PF('dlg').hide()"); + + } + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + public void PrepararNuevo() { + nuevo = true; + titulo = "Agregando Marca"; + marca = new Marca(); + + } + + public void PrepararEliminar(Marca marca) { + this.marca = marca; + PrimeFaces.current().executeScript("PF('dlg2').hide()"); + } + + public void editarMarca() { + nuevo = false; + marcaBL.editar(marca); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + } + + public void eliminarMarca() { + marcaBL.eliminar(marca); + } + + public List getMarcas() { + return marcaBL.getALL(true); + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } +} diff --git a/SystemInventory-war/src/java/vistas/PasilloBean.java b/SystemInventory-war/src/java/vistas/PasilloBean.java new file mode 100644 index 0000000..0aad643 --- /dev/null +++ b/SystemInventory-war/src/java/vistas/PasilloBean.java @@ -0,0 +1,104 @@ +package vistas; + +import java.io.Serializable; +import java.util.List; +import java.util.Locale; +import javax.ejb.EJB; +import javax.enterprise.context.SessionScoped; +import javax.inject.Named; +import mx.edu.tsj.chapala.sistemas.controller.PasilloBLLocal; +import mx.edu.tsj.chapala.sistemas.modelo.Pasillo; +import org.primefaces.PrimeFaces; +import org.primefaces.util.LangUtils; + +@Named(value = "pasilloBean") +@SessionScoped +public class PasilloBean implements Serializable { + + @EJB + private PasilloBLLocal pasilloBL; + private Pasillo pasillo = new Pasillo(); + private String titulo; + private boolean nuevo; + private List filteredCustomers3; + + public PasilloBean() { + + } + + public List getFilteredCustomers3() { + return filteredCustomers3; + } + + public void setFilteredCustomers3(List filteredCustomers3) { + this.filteredCustomers3 = filteredCustomers3; + } + + public boolean globalFilterFunction(Object value, Object filter, Locale locale) { + String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); + if (LangUtils.isBlank(filterText)) { + return true; + } + + Pasillo a = (Pasillo) value; + return String.valueOf(a.getNumeroP()).contains(filterText); + + } + + public String agregarPasillo() { + pasillo.setStatus(1); + pasilloBL.agregar(pasillo); + pasillo = new Pasillo(); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + return "PasilloLista.xhtml"; + } + + public void PrepararEditar(Pasillo pasillo) { + nuevo = false; + titulo = "Editando Pasillo"; + this.pasillo = pasillo; + + } + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + public void PrepararNuevo() { + nuevo = true; + titulo = "Agregando Pasillo"; + pasillo = new Pasillo(); + + } + + public void PrepararEliminar(Pasillo pasillo) { + this.pasillo = pasillo; + } + + public void editarPasillo() { + nuevo = false; + pasilloBL.editar(pasillo); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + } + + public void eliminarPasillo() { + pasilloBL.eliminar(pasillo); + PrimeFaces.current().executeScript("PF('dlg2').hide()"); + } + + public List getPasillos() { + return pasilloBL.getALL(true); + } + + public Pasillo getPasillo() { + return pasillo; + } + + public void setPasillo(Pasillo pasillo) { + this.pasillo = pasillo; + } +} diff --git a/SystemInventory-war/src/java/vistas/ProductoBean.java b/SystemInventory-war/src/java/vistas/ProductoBean.java new file mode 100644 index 0000000..8561992 --- /dev/null +++ b/SystemInventory-war/src/java/vistas/ProductoBean.java @@ -0,0 +1,115 @@ +package vistas; + +import java.io.Serializable; +import static java.lang.Integer.getInteger; +import java.util.List; +import java.util.Locale; +import javax.ejb.EJB; +import javax.enterprise.context.SessionScoped; +import javax.inject.Named; +import mx.edu.tsj.chapala.sistemas.controller.ProductoBLLocal; +import mx.edu.tsj.chapala.sistemas.modelo.Producto; +import org.primefaces.PrimeFaces; +import org.primefaces.util.LangUtils; + +@Named(value = "productoBean") +@SessionScoped +public class ProductoBean implements Serializable { + + @EJB + private ProductoBLLocal productoBL; + private Producto producto = new Producto(); + private String titulo; + private boolean nuevo; + private List filteredCustomers3; + + public ProductoBean() { + + } + + public List getFilteredCustomers3() { + return filteredCustomers3; + } + + public void setFilteredCustomers3(List filteredCustomers3) { + this.filteredCustomers3 = filteredCustomers3; + } + + public boolean globalFilterFunction(Object value, Object filter, Locale locale) { + String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); + if (LangUtils.isBlank(filterText)) { + return true; + } + + Producto a = (Producto) value; + return a.getNombre().toLowerCase().contains(filterText) + || a.getCodigo().toLowerCase().contains(filterText) + || String.valueOf(a.getPrecio()).contains(filterText) + || a.getFecha().toString().toLowerCase().contains(filterText) + || a.getCategoriaid().getNombre().contains(filterText) + || a.getMarcaid().getNombre().contains(filterText) + || a.getProovedorid().getNombre().contains(filterText) + ; + + } + + public String agregarProducto() { + producto.setStatus(1); + productoBL.agregar(producto); + producto = new Producto(); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + return "ProductoLista.xhtml"; + } + + public void PrepararEditar(Producto producto) { + nuevo = false; + titulo = "Editando Producto"; + this.producto = producto; + + } + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + public void PrepararNuevo() { + nuevo = true; + titulo = "Agregando Producto"; + producto = new Producto(); + + } + + public void PrepararEliminar(Producto producto) { + this.producto = producto; + } + + public void editarProducto() { + + nuevo = false; + productoBL.editar(producto); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + + } + + public void eliminarProducto() { + + productoBL.eliminar(producto); + PrimeFaces.current().executeScript("PF('dlg2').hide()"); + } + + public List getProductos() { + return productoBL.getALL(true); + } + + public Producto getProducto() { + return producto; + } + + public void setProducto(Producto producto) { + this.producto = producto; + } +} diff --git a/SystemInventory-war/src/java/vistas/ResguardoBean.java b/SystemInventory-war/src/java/vistas/ResguardoBean.java new file mode 100644 index 0000000..d67a741 --- /dev/null +++ b/SystemInventory-war/src/java/vistas/ResguardoBean.java @@ -0,0 +1,114 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package vistas; + +import javax.inject.Named; +import javax.enterprise.context.SessionScoped; +import java.io.Serializable; +import java.util.List; +import java.util.Locale; +import javax.ejb.EJB; +import mx.edu.tsj.chapala.sistemas.controller.ResguardoBLLocal; +import mx.edu.tsj.chapala.sistemas.modelo.Resguardo; +import org.primefaces.PrimeFaces; +import org.primefaces.util.LangUtils; + +/** + * + * @author Moises Ibarra + */ +@Named(value = "resguardoBean") +@SessionScoped +public class ResguardoBean implements Serializable { + + @EJB + private ResguardoBLLocal resguardoBL; + + private Resguardo resguardo = new Resguardo(); + private String titulo; + private boolean nuevo; + private List filteredCustomers3; + + public ResguardoBean() { + } + + public List getFilteredCustomers3() { + return filteredCustomers3; + } + + public void setFilteredCustomers3(List filteredCustomers3) { + this.filteredCustomers3 = filteredCustomers3; + } + public boolean globalFilterFunction(Object value, Object filter, Locale locale) { + String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); + if (LangUtils.isBlank(filterText)) { + return true; + } + + + Resguardo r = (Resguardo) value; + return r.getFecha().toString().toLowerCase().contains(filterText) + || r.getProductoId().getNombre().toLowerCase().contains(filterText) + || r.getUsuarioid().getNombre().toLowerCase().contains(filterText); + + } + + public String agregarResguardo(){ + resguardo.setStatus(1); + resguardoBL.agregar(resguardo); + resguardo= new Resguardo(); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + return "ResguardoLista.xhtml"; + } + public void PrepararEditar(Resguardo resguardo){ + nuevo=false; + titulo="Editando Resguardo"; + this.resguardo=resguardo; + } + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + public void PrepararNuevo(){ + nuevo=true; + titulo="Agregando Resguardo"; + resguardo= new Resguardo(); + } + + public void PrepararEliminar(Resguardo resguardo){ + this.resguardo=resguardo; + } + + public void editarResguardo(){ + nuevo=false; + resguardoBL.editar(resguardo); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + } + + public void eliminarResguardo(){ + resguardoBL.eliminar(resguardo); + PrimeFaces.current().executeScript("PF('dlg2').hide()"); + } + + public List getResguardos(){ + return resguardoBL.getALL(true); + } + + public Resguardo getResguardo() { + return resguardo; + } + + public void setResguardo(Resguardo resguardo) { + this.resguardo = resguardo; + } + + + +} diff --git a/SystemInventory-war/src/java/vistas/RolBean.java b/SystemInventory-war/src/java/vistas/RolBean.java new file mode 100644 index 0000000..d822d7d --- /dev/null +++ b/SystemInventory-war/src/java/vistas/RolBean.java @@ -0,0 +1,110 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package vistas; + +import javax.inject.Named; +import javax.enterprise.context.SessionScoped; +import java.io.Serializable; +import java.util.List; +import java.util.Locale; +import javax.ejb.EJB; +import mx.edu.tsj.chapala.sistemas.controller.RolBLLocal; +import mx.edu.tsj.chapala.sistemas.modelo.Rol; +import org.primefaces.PrimeFaces; +import org.primefaces.util.LangUtils; + +/** + * + * @author Moises Ibarra + */ +@Named(value = "rolBean") +@SessionScoped +public class RolBean implements Serializable { + + @EJB + private RolBLLocal rolBL; + private Rol rol = new Rol(); + private String titulo; + private boolean nuevo; + private List filteredCustomers3; + + public RolBean() { + } + + public List getFilteredCustomers3() { + return filteredCustomers3; + } + + public void setFilteredCustomers3(List filteredCustomers3) { + this.filteredCustomers3 = filteredCustomers3; + } + + public boolean globalFilterFunction(Object value, Object filter, Locale locale) { + String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); + if (LangUtils.isBlank(filterText)) { + return true; + } + + Rol u = (Rol) value; + return u.getNombre().toLowerCase().contains(filterText) + || u.getDescripcion().toLowerCase().contains(filterText); + + } + + public String agregarRol(){ + rol.setStatus(1); + rolBL.agregar(rol); + rol= new Rol(); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + return "RolLista.xhtml"; + } + + public void PrepararEditar(Rol rol){ + nuevo=false; + titulo="Editando Rol"; + this.rol=rol; + + } + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + public void PrepararNuevo(){ + nuevo=true; + titulo="Agregando Rol"; + rol= new Rol(); + } + public void PrepararEliminar(Rol rol){ + this.rol=rol; + } + public void editarRol(){ + nuevo=false; + rolBL.editar(rol); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + } + public void eliminarRol(){ + rolBL.eliminar(rol); + PrimeFaces.current().executeScript("PF('dlg2').hide()"); + } + + public List getRoles(){ + return rolBL.getALL(true); + } + + public Rol getRol() { + return rol; + } + + public void setRol(Rol rol) { + this.rol = rol; + } + + +} diff --git a/SystemInventory-war/src/java/vistas/SelectOneMenuConverter.java b/SystemInventory-war/src/java/vistas/SelectOneMenuConverter.java new file mode 100644 index 0000000..763b50b --- /dev/null +++ b/SystemInventory-war/src/java/vistas/SelectOneMenuConverter.java @@ -0,0 +1,86 @@ +package vistas; + +import java.util.List; +import javax.faces.component.UIComponent; +import javax.faces.component.UISelectItem; +import javax.faces.component.UISelectItems; +import javax.faces.context.FacesContext; +import javax.faces.convert.Converter; +import javax.faces.convert.FacesConverter; + +/** + * The Class SelectOneMenuConverter. + */ +@FacesConverter("selectOneMenuConverter") +public class SelectOneMenuConverter implements Converter { + + @Override + public Object getAsObject(final FacesContext arg0, final UIComponent arg1, final String objectString) { + if (objectString == null) { + return null; + } + + return fromSelect(arg1, objectString); + } + + /** + * Serialize. + * + * @param object + * the object + * @return the string + */ + private String serialize(final Object object) { + if (object == null) { + return null; + } + return object.getClass() + "@" + object.hashCode(); + } + + /** + * From select. + * + * @param currentcomponent + * the currentcomponent + * @param objectString + * the object string + * @return the object + */ + private Object fromSelect(final UIComponent currentcomponent, final String objectString) { + + if (currentcomponent.getClass() == UISelectItem.class) { + final UISelectItem item = (UISelectItem) currentcomponent; + final Object value = item.getValue(); + if (objectString.equals(serialize(value))) { + return value; + } + } + + if (currentcomponent.getClass() == UISelectItems.class) { + final UISelectItems items = (UISelectItems) currentcomponent; + final List elements = (List) items.getValue(); + for (final Object element : elements) { + if (objectString.equals(serialize(element))) { + return element; + } + } + } + + + if (!currentcomponent.getChildren().isEmpty()) { + for (final UIComponent component : currentcomponent.getChildren()) { + final Object result = fromSelect(component, objectString); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public String getAsString(final FacesContext arg0, final UIComponent arg1, final Object object) { + return serialize(object); + } + +} \ No newline at end of file diff --git a/SystemInventory-war/src/java/vistas/UbicacionBean.java b/SystemInventory-war/src/java/vistas/UbicacionBean.java new file mode 100644 index 0000000..cd6abbc --- /dev/null +++ b/SystemInventory-war/src/java/vistas/UbicacionBean.java @@ -0,0 +1,109 @@ +package vistas; + +import java.io.Serializable; +import static java.lang.Integer.getInteger; +import java.util.List; +import java.util.Locale; +import javax.ejb.EJB; +import javax.enterprise.context.SessionScoped; +import javax.inject.Named; + +import mx.edu.tsj.chapala.sistemas.controller.UbicacionBLLocal; + +import mx.edu.tsj.chapala.sistemas.modelo.Ubicacion; +import org.primefaces.PrimeFaces; +import org.primefaces.util.LangUtils; + +@Named(value = "ubicacionBean") +@SessionScoped +public class UbicacionBean implements Serializable { + + @EJB + private UbicacionBLLocal ubicacionBL; + private Ubicacion ubicacion = new Ubicacion(); + private String titulo; + private boolean nuevo; + private List filteredCustomers3; + + public UbicacionBean() { + + } + + public List getFilteredCustomers3() { + return filteredCustomers3; + } + + public void setFilteredCustomers3(List filteredCustomers3) { + this.filteredCustomers3 = filteredCustomers3; + } + public boolean globalFilterFunction(Object value, Object filter, Locale locale) { + String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); + if (LangUtils.isBlank(filterText)) { + return true; + } + + + Ubicacion a = (Ubicacion) value; + return String.valueOf(a.getEstanteid().getNumeroE()).contains(filterText) + || String.valueOf(a.getPasilloId().getNumeroP()).contains(filterText); + + + } + + public String agregarUbicacion() { + ubicacion.setStatus(1); + ubicacionBL.agregar(ubicacion); + ubicacion = new Ubicacion(); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + return "UbicacionLista.xhtml"; + } + + public void PrepararEditar(Ubicacion ubicacion) { + nuevo = false; + titulo = "Editando Ubicacion"; + this.ubicacion = ubicacion; + + } + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + public void PrepararNuevo() { + nuevo = true; + titulo = "Agregando Ubicacion"; + ubicacion = new Ubicacion(); + + } + + public void PrepararEliminar(Ubicacion ubicacion) { + this.ubicacion = ubicacion; + } + + public void editarUbicacion() { + nuevo = false; + ubicacionBL.editar(ubicacion); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + } + + public void eliminarUbicacion() { + ubicacionBL.eliminar(ubicacion); + PrimeFaces.current().executeScript("PF('dlg2').hide()"); + } + + public List getUbicaciones() { + return ubicacionBL.getALL(true); + } + + public Ubicacion getUbicacion() { + return ubicacion; + } + + public void setUbicacion(Ubicacion ubicacion) { + this.ubicacion = ubicacion; + } +} diff --git a/SystemInventory-war/src/java/vistas/UsuarioBean.java b/SystemInventory-war/src/java/vistas/UsuarioBean.java new file mode 100644 index 0000000..e922d85 --- /dev/null +++ b/SystemInventory-war/src/java/vistas/UsuarioBean.java @@ -0,0 +1,120 @@ +package vistas; + +import javax.inject.Named; +import javax.enterprise.context.SessionScoped; +import java.io.Serializable; +import static java.lang.Integer.getInteger; +import java.util.List; +import java.util.Locale; +import javax.ejb.EJB; +import mx.edu.tsj.chapala.sistemas.controller.UsuarioBLLocal; +import mx.edu.tsj.chapala.sistemas.modelo.Usuario; +import org.primefaces.PrimeFaces; +import org.primefaces.util.LangUtils; + +@Named(value = "usuarioBean") +@SessionScoped +public class UsuarioBean implements Serializable { + + @EJB + private UsuarioBLLocal usuarioBL; + + //variable + private int Rolid; + + private Usuario usuario = new Usuario(); + private String titulo; + private boolean nuevo; + private List filteredCustomers3; + + public UsuarioBean() { + } + + public List getFilteredCustomers3() { + return filteredCustomers3; + } + + public void setFilteredCustomers3(List filteredCustomers3) { + this.filteredCustomers3 = filteredCustomers3; + } + public boolean globalFilterFunction(Object value, Object filter, Locale locale) { + String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); + if (LangUtils.isBlank(filterText)) { + return true; + } + + + Usuario a = (Usuario) value; + return a.getNombre().toLowerCase().contains(filterText) + || a.getPass().toLowerCase().contains(filterText) + || a.getMail().toLowerCase().contains(filterText) + || String.valueOf(a.getTelefono()).contains(filterText) + || a.getRolid().getNombre().toLowerCase().contains(filterText); + } + + public String agregarUsuario() { + usuario.setStatus(1); + usuarioBL.agregar(usuario); + usuario = new Usuario(); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + return "usuarioLista.xhtml"; + + } + + public void PrepararEditar(Usuario usuario) { + nuevo=false; + titulo = "Editando Usuario"; + this.usuario = usuario; + } + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + public void PrepararNuevo() { + nuevo = true; + titulo = "Agregando Usuario"; + usuario = new Usuario(); + } + + public void PrepararEliminar(Usuario usuario) { + this.usuario = usuario; + } + + public void editarUsuario() { + nuevo = false; + usuarioBL.editar(usuario); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + } + + public void eliminarUsuario() { + usuarioBL.eliminar(usuario); + PrimeFaces.current().executeScript("PF('dlg2').hide()"); + } + + public List getUsuarios() { + return usuarioBL.getALL(true); + } + + public Usuario getUsuario() { + return usuario; + } + + public void setUsuario(Usuario usuario) { + this.usuario = usuario; + } + + //get y set rolid + public int getRolid() { + return Rolid; + } + + public void setRolid(int Rolid) { + this.Rolid = Rolid; + } + +} diff --git a/SystemInventory-war/src/java/vistas/demoBean.java b/SystemInventory-war/src/java/vistas/demoBean.java new file mode 100644 index 0000000..b22e7c6 --- /dev/null +++ b/SystemInventory-war/src/java/vistas/demoBean.java @@ -0,0 +1,747 @@ +package vistas; + +import java.io.Serializable; +import java.time.Instant; +import javax.ejb.EJB; +import javax.enterprise.context.SessionScoped; +import javax.inject.Named; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.controller.CategoriaBLLocal; +import mx.edu.tsj.chapala.sistemas.controller.EstanteBLLocal; +import mx.edu.tsj.chapala.sistemas.controller.MarcaBLLocal; +import mx.edu.tsj.chapala.sistemas.controller.PasilloBLLocal; +import mx.edu.tsj.chapala.sistemas.controller.ProductoBLLocal; +import mx.edu.tsj.chapala.sistemas.controller.ProovedorBLLocal; +import mx.edu.tsj.chapala.sistemas.controller.ResguardoBLLocal; +import mx.edu.tsj.chapala.sistemas.controller.RolBLLocal; +import mx.edu.tsj.chapala.sistemas.controller.UbicacionBLLocal; +import mx.edu.tsj.chapala.sistemas.controller.UsuarioBLLocal; +import mx.edu.tsj.chapala.sistemas.modelo.Categoria; +import mx.edu.tsj.chapala.sistemas.modelo.Estante; +import mx.edu.tsj.chapala.sistemas.modelo.Marca; +import mx.edu.tsj.chapala.sistemas.modelo.Pasillo; +import mx.edu.tsj.chapala.sistemas.modelo.Producto; +import mx.edu.tsj.chapala.sistemas.modelo.Proovedor; +import mx.edu.tsj.chapala.sistemas.modelo.Resguardo; +import mx.edu.tsj.chapala.sistemas.modelo.Rol; +import mx.edu.tsj.chapala.sistemas.modelo.Ubicacion; +import mx.edu.tsj.chapala.sistemas.modelo.Usuario; + +@Named(value = "demoBean") +@SessionScoped +public class demoBean implements Serializable { + + @EJB + private MarcaBLLocal marcaBL; + + @EJB + private CategoriaBLLocal categoriaBL; + + @EJB + private UbicacionBLLocal ubicacionBL; + + @EJB + private ProovedorBLLocal proovedorBL; + + @EJB + private EstanteBLLocal estanteBL; + + @EJB + private PasilloBLLocal pasilloBL; + + @EJB + private RolBLLocal RolBL; + + @EJB + private ResguardoBLLocal ResguardoBL; + + @EJB + private ProductoBLLocal ProductoBL; + + @EJB + private UsuarioBLLocal UsuarioBL; + + public demoBean() { + } + //---------------------------------------------Producto------------------------------------------------- + + public String agregarProducto() { + + Producto a = new Producto(); + + a.setCodigo("3423423"); + a.setNombre("OG kush"); + + Marca ma = new Marca(); + ma.setId(1); + a.setMarcaid(ma); + + Categoria c = new Categoria(); + c.setId(1); + a.setCategoriaid(c); + + a.setPrecio(50.50f); + + Ubicacion u = new Ubicacion(); + u.setId(1); + a.setUbicacionid(u); + + Proovedor p = new Proovedor(); + p.setId(1); + a.setProovedorid(p); + + a.setFecha(java.util.Date.from(Instant.now())); + + a.setStatus(1); + + Mensaje m = ProductoBL.agregar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("Se agrego"); + } else { + System.out.println("No se pudo"); + } + + //autorBL.agregar(null); + return "index.xhtml"; + } + + public String buscarProducto() { + + Producto a = new Producto(); + a.setId(1); + System.out.println("Encontre el Producto: "); + System.out.println(ProductoBL.buscarId(a)); + + return "index.xhtml"; + } + + public String eliminarProducto() { + + Producto a = new Producto(); + a.setId(1); + + Mensaje m = ProductoBL.eliminar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("no se elimino"); + } else { + System.out.println("Se elimino"); + } + return "index.xhtml"; + } + + public String editarProducto() { + Producto a = new Producto(); + a.setId(1); + a.setCodigo("111111"); + a.setNombre("Mota"); + a.setMarcaid(marcaBL.buscarId(new Marca(1))); + a.setCategoriaid(categoriaBL.buscarId(new Categoria(1))); + a.setPrecio(60.10f); + a.setUbicacionid(ubicacionBL.buscarId(new Ubicacion(1))); + a.setProovedorid(proovedorBL.buscarId(new Proovedor(1))); + a.setFecha(java.util.Date.from(Instant.now())); + a.setStatus(1); + + ProductoBL.editar(a); + System.out.println("se edito"); + + return "index.xhtml"; + } + + //--------------------------Categoria---------------------------- + public String agregarCategoria() { + + Categoria a = new Categoria(); + + a.setNombre("hombre"); + a.setStatus(1); + + Mensaje m = categoriaBL.agregar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("Se agrego"); + } else { + System.out.println("No se pudo"); + } + + //autorBL.agregar(null); + return "index.xhtml"; + } + + public String buscarCategoria() { + + Categoria a = new Categoria(); + a.setId(1); + System.out.println("Encontre la categoria: "); + System.out.println(categoriaBL.buscarId(a)); + + return "index.xhtml"; + } + + public String eliminarCategoria() { + + Categoria a = new Categoria(); + a.setId(2); + + Mensaje m = categoriaBL.eliminar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("no se elimino"); + } else { + System.out.println("Se elimino"); + } + return "index.xhtml"; + } + + public String editarCategoria() { + Categoria a = new Categoria(); + a.setId(1); + a.setNombre("tennis"); + a.setStatus(1); + + categoriaBL.editar(a); + System.out.println("se edito"); + + return "index.xhtml"; + } + + //-------------------------Marca---------------------------------------- + public String agregarMarca() { + + Marca a = new Marca(); + + a.setNombre("NO Registrada"); + a.setStatus(1); + + Mensaje m = marcaBL.agregar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("Se agrego"); + } else { + System.out.println("No se pudo"); + } + + //autorBL.agregar(null); + return "index.xhtml"; + } + + public String buscarMarca() { + + Marca a = new Marca(); + a.setId(1); + System.out.println("Encontre la Marca: "); + System.out.println(marcaBL.buscarId(a)); + + return "index.xhtml"; + } + + public String eliminarMarca() { + + Marca a = new Marca(); + a.setId(2); + + Mensaje m = marcaBL.eliminar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("no se elimino"); + } else { + System.out.println("Se elimino"); + } + return "index.xhtml"; + } + + public String editarMarca() { + Marca a = new Marca(); + a.setId(1); + a.setNombre("registrado"); + a.setStatus(1); + + marcaBL.editar(a); + System.out.println("se edito"); + + return "index.xhtml"; + } + + //---------------------------------Ubicacion-------------------------------- + public String Agregarubicacion() { + + Ubicacion a = new Ubicacion(); + + Estante e = new Estante(); + e.setId(2); + a.setEstanteid(e); + + + Pasillo f = new Pasillo (); + f.setId(2); + a.setPasilloId(f); + + a.setStatus(1); + + Mensaje m = ubicacionBL.agregar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("Se agrego"); + } else { + System.out.println("No se pudo"); + } + + return "index.xhtml"; + } + + + public String buscarUbicacion() { + + Ubicacion a = new Ubicacion(); + a.setId(1); + System.out.println("Encontre la ubicacion: "); + System.out.println(ubicacionBL.buscarId(a)); + + return "index.xhtml"; + } + + public String eliminarUbicacion() { + + Ubicacion a = new Ubicacion(); + a.setId(2); + + Mensaje m = ubicacionBL.eliminar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("no se elimino"); + } else { + System.out.println("Se elimino"); + } + return "index.xhtml"; + } + + public String editarUbicacion() { + Ubicacion a = new Ubicacion(); + a.setId(1); + a.setEstanteid(estanteBL.buscarId(new Estante(1))); + a.setPasilloId(pasilloBL.buscarId(new Pasillo(1))); + a.setStatus(1); + + + + ubicacionBL.editar(a); + System.out.println("se edito"); + + return "index.xhtml"; + } + + + + + + //-----------------------Estante------------------------------------------- + + + public String agregarEstante() { + + Estante a = new Estante(); + + a.setNumeroE(4); + a.setStatus(1); + + Mensaje m = estanteBL.agregar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("Se agrego"); + } else { + System.out.println("No se pudo"); + } + + //autorBL.agregar(null); + return "index.xhtml"; + } + + public String buscarEstante() { + + Estante a = new Estante(); + a.setId(1); + System.out.println("Encontre el Producto: "); + System.out.println(estanteBL.buscarId(a)); + + return "index.xhtml"; + } + + public String eliminarEstante() { + + Estante a = new Estante(); + a.setId(2); + + Mensaje m = estanteBL.eliminar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("no se elimino"); + } else { + System.out.println("Se elimino"); + } + return "index.xhtml"; + } + + public String editarEstante() { + Estante a = new Estante(); + a.setId(2); + a.setNumeroE(5); + a.setStatus(1); + + estanteBL.editar(a); + System.out.println("se edito"); + + return "index.xhtml"; + } + + + //-----------------------Pasillo------------------------------------ + + + public String agregarPasillo() { + + Pasillo a = new Pasillo (); + + a.setNumeroP(1); + a.setStatus(1); + + Mensaje m = pasilloBL.agregar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("Se agrego"); + } else { + System.out.println("No Se agrego"); + } + + //autorBL.agregar(null); + return "index.xhtml"; + } + + public String buscarPasillo() { + + Pasillo a = new Pasillo (); + a.setId(1); + System.out.println("Encontre el Producto: "); + System.out.println(pasilloBL.buscarId(a)); + + return "index.xhtml"; + } + + public String eliminarPasillo() { + + Pasillo a = new Pasillo(); + a.setId(2); + + Mensaje m = pasilloBL.eliminar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("no se elimino"); + } else { + System.out.println("Se elimino"); + } + return "index.xhtml"; + } + + public String editarPasillo() { + Pasillo a = new Pasillo (); + a.setId(1); + a.setNumeroP(3); + a.setStatus(1); + + pasilloBL.editar(a); + System.out.println("se edito"); + + return "index.xhtml"; + } + + + //-----------------------Rol------------------------------------------- + + + public String agregarRol() { + + Rol a = new Rol(); + + a.setNombre("dasdasdas"); + a.setDescripcion("Coblpdaddsara"); + a.setStatus(1); + + Mensaje m = RolBL.agregar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("Se agrego"); + } else { + System.out.println("No se pudo"); + } + //autorBL.agregar(null); + return "index.xhtml"; + } + + public String buscarRol() { + + Rol a = new Rol(); + + a.setId(1); + System.out.println("Encontre el Rol: "); + System.out.println(RolBL.buscarId(a)); + + return "index.xhtml"; + } + + public String eliminarRol() { + + Rol a = new Rol(); + a.setId(2); + + Mensaje m = RolBL.eliminar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("no se elimino"); + } else { + System.out.println("Se elimino"); + } + return "index.xhtml"; + } + + public String editarRol() { + + Rol a = new Rol(); + a.setId(1); + a.setNombre("empleado"); + a.setDescripcion("dasdasda"); + a.setStatus(1); + + RolBL.editar(a); + System.out.println("se edito"); + + return "index.xhtml"; + } + + + /*----------------------------RESGUARDO----------------------------*/ + + public String AgregarResguardo() { + + Resguardo a = new Resguardo(); + + Producto f = new Producto(); + a.setProductoId(f); + + Usuario e = new Usuario(); + a.setUsuarioid(e); + + a.setFecha(java.util.Date.from(Instant.now())); + a.setStatus(1); + + Mensaje m = ResguardoBL.agregar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("Se agrego"); + } else { + System.out.println("No se pudo"); + } + + return "index.xhtml"; + } + + public String buscarResguardo() { + + Resguardo a = new Resguardo(); + a.setId(1); + System.out.println("Encontre el Resguardo: "); + System.out.println(ResguardoBL.buscarId(a)); + + return "index.xhtml"; + } + + public String eliminarResguardo() { + + Resguardo a = new Resguardo(); + a.setId(2); + + Mensaje m = ResguardoBL.eliminar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("no se elimino"); + } else { + System.out.println("Se elimino"); + } + return "index.xhtml"; + } + + public String editarResguardo() { + + Resguardo a = new Resguardo(); + a.setId(1); + + Producto f = new Producto(); + a.setProductoId(f); + + Usuario e = new Usuario(); + a.setUsuarioid(e); + + a.setFecha(java.util.Date.from(Instant.now())); + a.setStatus(1); + + ResguardoBL.editar(a); + System.out.println("se edito"); + + return "index.xhtml"; + } + + + /*----------------------------USUARIO----------------------------*/ + + public String AgregarUsuario() { + + Usuario a = new Usuario(); + + + a.setNombre("eeee"); + a.setPass("eee"); + a.setMail("uno@dos"); + a.setTelefono("1255553333"); + + Rol f = new Rol(); + f.setId(2); + a.setRolid(f); + + a.setStatus(1); + + Mensaje m = UsuarioBL.agregar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("Se agrego"); + } else { + System.out.println("No se pudo"); + } + + //autorBL.agregar(null); + return "index.xhtml"; + } + + public String buscarusuario() { + + Usuario a = new Usuario(); + a.setId(1); + System.out.println("Encontre el Usuario: "); + System.out.println(UsuarioBL.buscarId(a)); + + return "index.xhtml"; + } + + public String eliminarUsuario() { + + Usuario a = new Usuario(); + a.setId(2); + + Mensaje m = UsuarioBL.eliminar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("no se elimino"); + } else { + System.out.println("Se elimino"); + } + return "index.xhtml"; + } + + public String editarusuario() { + Usuario a = new Usuario(); + a.setId(1); + a.setNombre("mauricio"); + a.setPass("ma1234"); + a.setMail("mau@gmail.com"); + a.setTelefono("3338323330"); + + Rol f = new Rol(); + f.setId(1); + a.setRolid(f); + a.setStatus(1); + + UsuarioBL.editar(a); + System.out.println("se edito"); + + return "index.xhtml"; + } + + /*----------------------------PROVEEDOR----------------------------*/ + + + public String agregarProveedor() { + + Proovedor a = new Proovedor (); + + a.setNombre("Gamesa"); + a.setDireccion("Mezcala"); + a.setMail("Juanc.jcsr73@gmail.com"); + a.setTelefono("234324234"); + a.setStatus(1); + + + + Mensaje m = proovedorBL.agregar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("Se agrego"); + } else { + System.out.println("No se pudo"); + } + + //autorBL.agregar(null); + return "index.xhtml"; + } + + public String buscarProveedor() { + + Proovedor a = new Proovedor(); + a.setId(1); + System.out.println("Encontre el proveedor: "); + System.out.println(proovedorBL.buscarId(a)); + + return "index.xhtml"; + } + public String buscarProveedortodos() { + + Proovedor a = new Proovedor(); + a.setId(1); + System.out.println("Encontre el proveedor: "); + System.out.println(); + + return "index.xhtml"; + } + + public String eliminarProveedor() { + + Proovedor a = new Proovedor(); + a.setId(2); + + Mensaje m = proovedorBL.eliminar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("no se elimino"); + } else { + System.out.println("Se elimino"); + } + return "index.xhtml"; + } + + public String editarProveedor() { + Proovedor a = new Proovedor(); + a.setId(1); + + a.setNombre("Juana Bacoa"); + a.setDireccion("Mi casa"); + a.setMail("Juanc.jcsr73@gmail.com"); + a.setTelefono("3313232"); + a.setStatus(1); + + + + proovedorBL.editar(a); + System.out.println("se edito"); + + return "index.xhtml"; + } + +} diff --git a/SystemInventory-war/src/java/vistas/estanteBean.java b/SystemInventory-war/src/java/vistas/estanteBean.java new file mode 100644 index 0000000..944687e --- /dev/null +++ b/SystemInventory-war/src/java/vistas/estanteBean.java @@ -0,0 +1,165 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package vistas; + +import javax.inject.Named; +import javax.enterprise.context.SessionScoped; +import java.io.Serializable; +import static java.lang.Integer.getInteger; +import static java.lang.String.valueOf; +import java.util.List; +import java.util.Locale; +import javax.ejb.EJB; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.controller.EstanteBLLocal; +import mx.edu.tsj.chapala.sistemas.modelo.Estante; +import org.primefaces.PrimeFaces; +import org.primefaces.util.LangUtils; + +/** + * + * @author david + */ +@Named(value = "estanteBean") +@SessionScoped +public class estanteBean implements Serializable { + + @EJB + private EstanteBLLocal estanteBL; + + private Estante estante = new Estante(); + private String titulo; + private boolean nuevo; + private List filteredCustomers3; + + + public estanteBean() { + } + + public List getFilteredCustomers3() { + return filteredCustomers3; + } + + public void setFilteredCustomers3(List filteredCustomers3) { + this.filteredCustomers3 = filteredCustomers3; + } + public boolean globalFilterFunction(Object value, Object filter, Locale locale) { + String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); + if (LangUtils.isBlank(filterText)) { + return true; + } + + + Estante a = (Estante) value; + return String.valueOf(a.getNumeroE()).contains(filterText); + + } + + public String agregarEstante() { + + estante.setStatus(1); + estanteBL.agregar(estante); + estante = new Estante(); + /*Estante a = new Estante(); + + a.setNumeroE(4); + a.setStatus(1); + + Mensaje m = estanteBL.agregar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("Se agrego"); + } else { + System.out.println("No se pudo"); + } + */ + //autorBL.agregar(null); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + return "estanteLista.xhtml"; + } + + public String buscarEstante() { + + Estante a = new Estante(); + a.setId(1); + System.out.println("Encontre el Producto: "); + System.out.println(estanteBL.buscarId(a)); + + return "index.xhtml"; + } + + public String eliminarEstante() { + + Estante a = new Estante(); + a.setId(2); + + Mensaje m = estanteBL.eliminar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("no se elimino"); + } else { + System.out.println("Se elimino"); + } + return "index.xhtml"; + } + + public void editarEstantes(){ + nuevo = false; + estanteBL.editar(estante); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + } + + public String editarEstante() { + Estante a = new Estante(); + a.setId(2); + a.setNumeroE(5); + a.setStatus(1); + + estanteBL.editar(a); + System.out.println("se edito"); + + return "index.xhtml"; + } + + public List getEstantes(){ + return estanteBL.getALLE(true); + } + + public Estante getEstante() { + return estante; + } + + public void setEstante(Estante estante) { + this.estante = estante; + } + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + + public void prepararEditar(Estante estante){ + nuevo=false; + titulo="Editando Estante"; + this.estante = estante; + } + public void prepararNuevo(){ + nuevo=true; + titulo="Agregando Estante"; + estante = new Estante(); + } + public void prepararEliminar(Estante estante){ + this.estante=estante; + } + public void eliminarEstantes(){ + PrimeFaces.current().executeScript("PF('dlg2').hide()"); + estanteBL.eliminar(estante); + } + +} diff --git a/SystemInventory-war/src/java/vistas/proveedorBean.java b/SystemInventory-war/src/java/vistas/proveedorBean.java new file mode 100644 index 0000000..9ddc031 --- /dev/null +++ b/SystemInventory-war/src/java/vistas/proveedorBean.java @@ -0,0 +1,170 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package vistas; + +import javax.inject.Named; +import javax.enterprise.context.SessionScoped; +import java.io.Serializable; +import java.util.List; +import java.util.Locale; +import javax.ejb.EJB; +import mx.edu.tsj.chapala.sistemas.Mensaje; +import mx.edu.tsj.chapala.sistemas.controller.ProovedorBLLocal; +import mx.edu.tsj.chapala.sistemas.modelo.Estante; +import mx.edu.tsj.chapala.sistemas.modelo.Proovedor; +import org.primefaces.PrimeFaces; +import org.primefaces.util.LangUtils; + +/** + * + * @author david + */ +@Named(value = "proveedorBean") +@SessionScoped +public class proveedorBean implements Serializable { + + @EJB + private ProovedorBLLocal proovedorBL; + + private Proovedor proveedor = new Proovedor(); + private String titulo; + private boolean nuevo; + private List filteredCustomers3; + + + public proveedorBean() { + } + + public List getFilteredCustomers3() { + return filteredCustomers3; + } + + public void setFilteredCustomers3(List filteredCustomers3) { + this.filteredCustomers3 = filteredCustomers3; + } + public boolean globalFilterFunction(Object value, Object filter, Locale locale) { + String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); + if (LangUtils.isBlank(filterText)) { + return true; + } + + + Proovedor a = (Proovedor) value; + return String.valueOf(a.getId()).contains(filterText) + || a.getNombre().toLowerCase().contains(filterText) + || a.getDireccion().toLowerCase().contains(filterText) + || a.getMail().toLowerCase().contains(filterText) + || String.valueOf(a.getStatus()).contains(filterText) + || String.valueOf(a.getTelefono()).contains(filterText) + || String.valueOf(a.getId()).contains(filterText); + + + + + + } + + public String agregarProveedor() { + + proveedor.setStatus(1); + proovedorBL.agregar(proveedor); + proveedor = new Proovedor(); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + return "proveedoresLista.xhtml"; + } + + public String buscarProveedor() { + + Proovedor a = new Proovedor(); + a.setId(1); + System.out.println("Encontre el proveedor: "); + System.out.println(proovedorBL.buscarId(a)); + + return "index.xhtml"; + } + public String buscarProveedortodos() { + + Proovedor a = new Proovedor(); + a.setId(1); + System.out.println("Encontre el proveedor: "); + System.out.println(); + + return "index.xhtml"; + } + + public String eliminarProveedor() { + + Proovedor a = new Proovedor(); + a.setId(2); + + Mensaje m = proovedorBL.eliminar(a); + System.out.println(m); + if (m.compareTo(Mensaje.SIN_ERROR) == 0) { + System.out.println("no se elimino"); + } else { + System.out.println("Se elimino"); + } + return "index.xhtml"; + } + + public String editarProveedor() { + Proovedor a = new Proovedor(); + a.setId(1); + + a.setNombre("Juana Bacoa"); + a.setDireccion("Mi casa"); + a.setMail("Juanc.jcsr73@gmail.com"); + a.setTelefono("3313232"); + a.setStatus(1); + + + + proovedorBL.editar(a); + System.out.println("se edito"); + + return "index.xhtml"; + } + public void editarProvedores(){ + nuevo = false; + proovedorBL.editar(proveedor); + PrimeFaces.current().executeScript("PF('dlg').hide()"); + } + public List getProovedors(){ + return proovedorBL.getALLProveedor(true); + } + + public Proovedor getProveedor() { + return proveedor; + } + + public void setProveedor(Proovedor proveedor) { + this.proveedor = proveedor; + } + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + public void prepararEditar(Proovedor proovedor){ + nuevo=false; + titulo="Editando Proveedor"; + this.proveedor=proovedor; + } + public void prepararNuevo(){ + nuevo=true; + titulo="Agregando Proveedor"; + proveedor = new Proovedor(); + } + public void prepararEliminar(Proovedor proovedor){ + this.proveedor=proovedor; + } + public void eliminarProveedores(){ + proovedorBL.eliminar(proveedor); + PrimeFaces.current().executeScript("PF('dlg2').hide()"); + } +} diff --git a/SystemInventory-war/web/CategoriaLista.xhtml b/SystemInventory-war/web/CategoriaLista.xhtml new file mode 100644 index 0000000..f6fc9ae --- /dev/null +++ b/SystemInventory-war/web/CategoriaLista.xhtml @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

LISTA CATEGORÍA

+ + + + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +

+ + + + + + + + + + + +

+ + + +

+ +
+ +
+ + + + +

ELIMINANDO CATEGORIA

+ + + + + + + + + +

+ + +

+
+
+ +
+ + +
+
+ + \ No newline at end of file diff --git a/SystemInventory-war/web/Login.xhtml b/SystemInventory-war/web/Login.xhtml new file mode 100644 index 0000000..70056ac --- /dev/null +++ b/SystemInventory-war/web/Login.xhtml @@ -0,0 +1,58 @@ + + + + + + + + + + + + +

SISTEMA INVENTARIO

+
+
+ + + + + + + + + bottom + + +
+ + + + diff --git a/SystemInventory-war/web/MarcaLista.xhtml b/SystemInventory-war/web/MarcaLista.xhtml new file mode 100644 index 0000000..f09600f --- /dev/null +++ b/SystemInventory-war/web/MarcaLista.xhtml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

LISTA MARCA

+ + + + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +

+ + + + + + + + + + + + + +

+ + + +

+ +
+ +
+ + + +

ELIMINANDO MARCA

+ + + + + + + + + +

+ + +

+
+
+ +
+ + +
+
+ + + diff --git a/SystemInventory-war/web/PasilloLista.xhtml b/SystemInventory-war/web/PasilloLista.xhtml new file mode 100644 index 0000000..d90de51 --- /dev/null +++ b/SystemInventory-war/web/PasilloLista.xhtml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

LISTA PASILLO

+ + + + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +

+ + + + + + + +
+

+ + + +

+
+
+
+ + + + +
+

Eliminar

+ + + + + + + + + +
+
+ +
+
+ + + +
+
+ + + + + \ No newline at end of file diff --git a/SystemInventory-war/web/ProductoLista.xhtml b/SystemInventory-war/web/ProductoLista.xhtml new file mode 100644 index 0000000..35a81d0 --- /dev/null +++ b/SystemInventory-war/web/ProductoLista.xhtml @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

LISTA PRODUCTOS

+ + + + +
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +

+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + +
+ + + + + +
+
+ + + + + +
+
+ + + + + +
+ + + + + +
+
+ +

+ + + + +

+
+
+
+ + + +
+

Eliminar

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ +
+ + +
+ + + diff --git a/SystemInventory-war/web/ResguardoLista.xhtml b/SystemInventory-war/web/ResguardoLista.xhtml new file mode 100644 index 0000000..df8ea6b --- /dev/null +++ b/SystemInventory-war/web/ResguardoLista.xhtml @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + left + + + + + + + + + + + + +

LISTA RESGUARDOS

+ + + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +

+ + + + + + + + + + + + + + + + + + + + + + + +

+ + + +

+
+
+ + + +

Eliminar Resguardo

+ + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + bottom + + +
+ + + + + diff --git a/SystemInventory-war/web/RolLista.xhtml b/SystemInventory-war/web/RolLista.xhtml new file mode 100644 index 0000000..bfdcf96 --- /dev/null +++ b/SystemInventory-war/web/RolLista.xhtml @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + left + + + + + + + + + + + + +

LISTA ROLES

+ + + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +

+ + + + + + + + + + + + + +

+ + + +

+
+
+ + + +

Eliminar Usuario

+ + + + + + + + + + + + + +
+
+ +
+ +
+ + + bottom + + +
+ + + + + diff --git a/SystemInventory-war/web/UbicacionLista.xhtml b/SystemInventory-war/web/UbicacionLista.xhtml new file mode 100644 index 0000000..d7e0f62 --- /dev/null +++ b/SystemInventory-war/web/UbicacionLista.xhtml @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

LISTA UBICACION

+ + + + + +
+ + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +

+ + + + + + + + + + + + + +
+

+ + + +

+
+
+
+ + +
+

Eliminar

+ + + + + + + + + +
+
+
+ +
+ +
+ +
+ + + diff --git a/SystemInventory-war/web/WEB-INF/faces-config.xml b/SystemInventory-war/web/WEB-INF/faces-config.xml new file mode 100644 index 0000000..ecc3af6 --- /dev/null +++ b/SystemInventory-war/web/WEB-INF/faces-config.xml @@ -0,0 +1,32 @@ + + + + + + seguridad.AutorizacionListener + + + + diff --git a/SystemInventory-war/web/WEB-INF/glassfish-web.xml b/SystemInventory-war/web/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..584a477 --- /dev/null +++ b/SystemInventory-war/web/WEB-INF/glassfish-web.xml @@ -0,0 +1,25 @@ + + + + + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/SystemInventory-war/web/WEB-INF/web.xml b/SystemInventory-war/web/WEB-INF/web.xml new file mode 100644 index 0000000..4f88757 --- /dev/null +++ b/SystemInventory-war/web/WEB-INF/web.xml @@ -0,0 +1,32 @@ + + + + javax.faces.PROJECT_STAGE + Development + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + eot + application/vnd.ms-fontobject + + + + 30 + + + + faces/ProductoLista.xhtml + + + javax.faces.CONFIG_FILES + /WEB-INF/faces-config.xml + + diff --git a/SystemInventory-war/web/estanteLista.xhtml b/SystemInventory-war/web/estanteLista.xhtml new file mode 100644 index 0000000..3604f58 --- /dev/null +++ b/SystemInventory-war/web/estanteLista.xhtml @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + left + + + + + + + + + + + + +

LISTA ESTANTE

+ + + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +

+ + + + + + + + + + + + + + +
+
+ + +

ELIMINANDO LISTA

+ + + + + + + + + + + + +
+ +
+
+ +
+ + + bottom + + +
+ + + + \ No newline at end of file diff --git a/SystemInventory-war/web/index.html b/SystemInventory-war/web/index.html new file mode 100644 index 0000000..19e5ed9 --- /dev/null +++ b/SystemInventory-war/web/index.html @@ -0,0 +1,15 @@ + + + + + TODO supply a title + + + + +
normal/
+ + diff --git a/SystemInventory-war/web/index.xhtml b/SystemInventory-war/web/index.xhtml new file mode 100644 index 0000000..6d1f644 --- /dev/null +++ b/SystemInventory-war/web/index.xhtml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + Nombre de usuario: + + + Contraseña: + + + + + + + + + + + + + + bottom + + + + + + + + diff --git a/SystemInventory-war/web/proveedoresLista.xhtml b/SystemInventory-war/web/proveedoresLista.xhtml new file mode 100644 index 0000000..b3d2a6a --- /dev/null +++ b/SystemInventory-war/web/proveedoresLista.xhtml @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

LISTA PROVEEDORES

+ + + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +

+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +

ELIMINANDO PROVEEDOR

+ + + + + + + + + + + + +
+
+
+ +
+ + + bottom + + +
+ + + \ No newline at end of file diff --git a/SystemInventory-war/web/resources/Imagenes/2077.jpg b/SystemInventory-war/web/resources/Imagenes/2077.jpg new file mode 100644 index 0000000..b2c6cf0 Binary files /dev/null and b/SystemInventory-war/web/resources/Imagenes/2077.jpg differ diff --git a/SystemInventory-war/web/resources/css/cssLayout.css b/SystemInventory-war/web/resources/css/cssLayout.css new file mode 100644 index 0000000..8ee7ceb --- /dev/null +++ b/SystemInventory-war/web/resources/css/cssLayout.css @@ -0,0 +1,61 @@ + +#top { + position: relative; + background-color: #036fab; + color: white; + padding: 5px; + margin: 0px 0px 10px 0px; +} + +#bottom { + position: relative; + background-color: #c2dfef; + padding: 5px; + margin: 10px 0px 0px 0px; +} + +#left { + float: left; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +#right { + float: right; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +.center_content { + position: relative; + background-color: #dddddd; + padding: 5px; +} + +.left_content { + background-color: #dddddd; + padding: 5px; + margin-left: 170px; +} + +.right_content { + background-color: #dddddd; + padding: 5px; + margin: 0px 170px 0px 170px; +} + +#top a:link, #top a:visited { + color: white; + font-weight : bold; + text-decoration: none; +} + +#top a:link:hover, #top a:visited:hover { + color: black; + font-weight : bold; + text-decoration : underline; +} + + diff --git a/SystemInventory-war/web/resources/css/default.css b/SystemInventory-war/web/resources/css/default.css new file mode 100644 index 0000000..6cbc3d1 --- /dev/null +++ b/SystemInventory-war/web/resources/css/default.css @@ -0,0 +1,29 @@ +body { + background-color: #ffffff; + font-size: 12px; + font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + color: #000000; + margin: 10px; +} + +h1 { + font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + border-bottom: 1px solid #AFAFAF; + font-size: 16px; + font-weight: bold; + margin: 0px; + padding: 0px; + color: #D20005; +} + +a:link, a:visited { + color: #045491; + font-weight : bold; + text-decoration: none; +} + +a:link:hover, a:visited:hover { + color: #045491; + font-weight : bold; + text-decoration : underline; +} diff --git a/SystemInventory-war/web/resources/fondo.jpg b/SystemInventory-war/web/resources/fondo.jpg new file mode 100644 index 0000000..b91f004 Binary files /dev/null and b/SystemInventory-war/web/resources/fondo.jpg differ diff --git a/SystemInventory-war/web/template/VistasChidas.xhtml b/SystemInventory-war/web/template/VistasChidas.xhtml new file mode 100644 index 0000000..17ed3b3 --- /dev/null +++ b/SystemInventory-war/web/template/VistasChidas.xhtml @@ -0,0 +1,32 @@ + + + + + + + + + Facelets Template + + + + +
+ Top +
+ +
+ Content +
+ +
+
Derechos Reservados
+ + 2024
+
+ +
+ + diff --git a/SystemInventory-war/web/usuarioLista.xhtml b/SystemInventory-war/web/usuarioLista.xhtml new file mode 100644 index 0000000..c2a4386 --- /dev/null +++ b/SystemInventory-war/web/usuarioLista.xhtml @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

LISTA USUARIOS

+ + + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + +

+
+
+ + + +

Eliminar Usuario

+ + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + + + + + +
+ + + bottom + + +
+ + + + + diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..cfc0e37 --- /dev/null +++ b/build.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + Builds, tests, and runs the project SystemInventory. + + + diff --git a/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar b/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar new file mode 100644 index 0000000..b545720 Binary files /dev/null and b/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar differ diff --git a/lib/EclipseLink-GlassFish-v3/javaee-doc-api.jar b/lib/EclipseLink-GlassFish-v3/javaee-doc-api.jar new file mode 100644 index 0000000..9e19d4f Binary files /dev/null and b/lib/EclipseLink-GlassFish-v3/javaee-doc-api.jar differ diff --git a/lib/EclipseLink-GlassFish-v3/javax.persistence.jar b/lib/EclipseLink-GlassFish-v3/javax.persistence.jar new file mode 100644 index 0000000..a4dd386 Binary files /dev/null and b/lib/EclipseLink-GlassFish-v3/javax.persistence.jar differ diff --git a/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.antlr.jar b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.antlr.jar new file mode 100644 index 0000000..cff0ef8 Binary files /dev/null and b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.antlr.jar differ diff --git a/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.asm.jar b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.asm.jar new file mode 100644 index 0000000..832e18e Binary files /dev/null and b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.asm.jar differ diff --git a/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.core.jar b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.core.jar new file mode 100644 index 0000000..01bb838 Binary files /dev/null and b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.core.jar differ diff --git a/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.dbws.jar b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.dbws.jar new file mode 100644 index 0000000..3c7d25b Binary files /dev/null and b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.dbws.jar differ diff --git a/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.jpa.jar b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.jpa.jar new file mode 100644 index 0000000..1a8ba7e Binary files /dev/null and b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.jpa.jar differ diff --git a/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.jpa.jpql.jar b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.jpa.jpql.jar new file mode 100644 index 0000000..53be498 Binary files /dev/null and b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.jpa.jpql.jar differ diff --git a/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.jpa.modelgen.processor.jar b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.jpa.modelgen.processor.jar new file mode 100644 index 0000000..a0d8390 Binary files /dev/null and b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.jpa.modelgen.processor.jar differ diff --git a/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.moxy.jar b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.moxy.jar new file mode 100644 index 0000000..29a1057 Binary files /dev/null and b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.moxy.jar differ diff --git a/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.oracle.jar b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.oracle.jar new file mode 100644 index 0000000..87782bf Binary files /dev/null and b/lib/EclipseLink-GlassFish-v3/org.eclipse.persistence.oracle.jar differ diff --git a/lib/javaee-endorsed-api-7.0/javaee-doc-api.jar b/lib/javaee-endorsed-api-7.0/javaee-doc-api.jar new file mode 100644 index 0000000..9e19d4f Binary files /dev/null and b/lib/javaee-endorsed-api-7.0/javaee-doc-api.jar differ diff --git a/lib/javaee-endorsed-api-7.0/javax.annotation-api.jar b/lib/javaee-endorsed-api-7.0/javax.annotation-api.jar new file mode 100644 index 0000000..9ab39ff Binary files /dev/null and b/lib/javaee-endorsed-api-7.0/javax.annotation-api.jar differ diff --git a/lib/javaee-endorsed-api-7.0/javax.xml.soap-api.jar b/lib/javaee-endorsed-api-7.0/javax.xml.soap-api.jar new file mode 100644 index 0000000..b9f4d5b Binary files /dev/null and b/lib/javaee-endorsed-api-7.0/javax.xml.soap-api.jar differ diff --git a/lib/javaee-endorsed-api-7.0/jaxb-api-osgi.jar b/lib/javaee-endorsed-api-7.0/jaxb-api-osgi.jar new file mode 100644 index 0000000..8be7c66 Binary files /dev/null and b/lib/javaee-endorsed-api-7.0/jaxb-api-osgi.jar differ diff --git a/lib/javaee-endorsed-api-7.0/jaxws-api.jar b/lib/javaee-endorsed-api-7.0/jaxws-api.jar new file mode 100644 index 0000000..c2ed58b Binary files /dev/null and b/lib/javaee-endorsed-api-7.0/jaxws-api.jar differ diff --git a/lib/javaee-endorsed-api-7.0/jsr181-api.jar b/lib/javaee-endorsed-api-7.0/jsr181-api.jar new file mode 100644 index 0000000..91538a7 Binary files /dev/null and b/lib/javaee-endorsed-api-7.0/jsr181-api.jar differ diff --git a/lib/nblibraries.properties b/lib/nblibraries.properties new file mode 100644 index 0000000..4e1e69a --- /dev/null +++ b/lib/nblibraries.properties @@ -0,0 +1,28 @@ +libs.CopyLibs.classpath=\ + ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar +libs.CopyLibs.displayName=CopyLibs Task +libs.CopyLibs.prop-version=3.0 +libs.EclipseLink-GlassFish-v3.classpath=\ + ${base}/EclipseLink-GlassFish-v3/org.eclipse.persistence.antlr.jar;\ + ${base}/EclipseLink-GlassFish-v3/org.eclipse.persistence.asm.jar;\ + ${base}/EclipseLink-GlassFish-v3/org.eclipse.persistence.core.jar;\ + ${base}/EclipseLink-GlassFish-v3/org.eclipse.persistence.dbws.jar;\ + ${base}/EclipseLink-GlassFish-v3/org.eclipse.persistence.jpa.jar;\ + ${base}/EclipseLink-GlassFish-v3/org.eclipse.persistence.jpa.jpql.jar;\ + ${base}/EclipseLink-GlassFish-v3/org.eclipse.persistence.jpa.modelgen.processor.jar;\ + ${base}/EclipseLink-GlassFish-v3/org.eclipse.persistence.moxy.jar;\ + ${base}/EclipseLink-GlassFish-v3/org.eclipse.persistence.oracle.jar;\ + ${base}/EclipseLink-GlassFish-v3/javax.persistence.jar +libs.EclipseLink-GlassFish-v3.displayName=EclipseLink from GlassFish +libs.EclipseLink-GlassFish-v3.javadoc=\ + ${base}/EclipseLink-GlassFish-v3/javaee-doc-api.jar +libs.javaee-endorsed-api-7.0.classpath=\ + ${base}/javaee-endorsed-api-7.0/javax.annotation-api.jar;\ + ${base}/javaee-endorsed-api-7.0/javax.xml.soap-api.jar;\ + ${base}/javaee-endorsed-api-7.0/jaxb-api-osgi.jar;\ + ${base}/javaee-endorsed-api-7.0/jaxws-api.jar;\ + ${base}/javaee-endorsed-api-7.0/jsr181-api.jar +libs.javaee-endorsed-api-7.0.displayName=Java EE 7 Endorsed API Library +libs.javaee-endorsed-api-7.0.javadoc=\ + ${base}/javaee-endorsed-api-7.0/javaee-doc-api.jar +libs.javaee-endorsed-api-7.0.prop-maven-dependencies=\n javax.annotation:javax.annotation-api:1.2\n javax.xml.bind:jaxb-api-osgi:2.2.7\n javax.xml.soap:javax.xml.soap-api:1.3.5\n javax.xml.ws:jaxws-api:2.2.8\n javax.jws:jsr181-api:1.0-MR1\n diff --git a/nbproject/ant-deploy.xml b/nbproject/ant-deploy.xml new file mode 100644 index 0000000..fdc06d5 --- /dev/null +++ b/nbproject/ant-deploy.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml new file mode 100644 index 0000000..9696197 --- /dev/null +++ b/nbproject/build-impl.xml @@ -0,0 +1,660 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set build.dir + Must set build.generated.dir + Must set dist.dir + Must set build.classes.excludes + Must set dist.jar + + + +The libs.CopyLibs.classpath property is not set up. +This property must point to +org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part +of NetBeans IDE installation and is usually located at +<netbeans_installation>/java<version>/ant/extra folder. +Either open the project in the IDE and make sure CopyLibs library +exists or setup the property manually. For example like this: + ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. + + + Launching ${browse.url} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties new file mode 100644 index 0000000..37679a0 --- /dev/null +++ b/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=cd86a6dd +build.xml.script.CRC32=752acbac +build.xml.stylesheet.CRC32=7e2ae9c8@1.73 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=cd86a6dd +nbproject/build-impl.xml.script.CRC32=d858bf7f +nbproject/build-impl.xml.stylesheet.CRC32=abdce74a@1.73 diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 0000000..80a1150 --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,40 @@ +build.classes.excludes=**/*.java,**/*.form,**/.nbattrs +build.dir=build +build.generated.dir=${build.dir}/generated +client.module.uri=SystemInventory-war +client.urlPart= +debug.classpath=${javac.classpath}::${jar.content.additional}:${run.classpath} +display.browser=true +dist.dir=dist +dist.jar=${dist.dir}/${jar.name} +endorsed.classpath=\ + ${libs.javaee-endorsed-api-7.0.classpath} +j2ee.appclient.mainclass.args=${j2ee.appclient.tool.args} +j2ee.compile.on.save=true +j2ee.deploy.on.save=true +j2ee.platform=1.7 +j2ee.platform.classpath= +j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar +j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar +j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar +j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar +j2ee.platform.wsit.classpath= +j2ee.server.type=gfv4ee7 +jar.compress=false +jar.content.additional=\ + ${reference.SystemInventory-war.dist-ear}:\ + ${reference.SystemInventory-ejb.dist-ear} +jar.name=SystemInventory.ear +javac.debug=true +javac.deprecation=false +javac.source=1.7 +javac.target=1.7 +meta.inf=src/conf +no.dependencies=false +platform.active=default_platform +project.SystemInventory-ejb=SystemInventory-ejb +project.SystemInventory-war=SystemInventory-war +reference.SystemInventory-ejb.dist-ear=${project.SystemInventory-ejb}/dist/SystemInventory-ejb.jar +reference.SystemInventory-war.dist-ear=${project.SystemInventory-war}/dist/SystemInventory-war.war +resource.dir=setup +source.root=. diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..f524350 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,42 @@ + + + org.netbeans.modules.j2ee.earproject + + + SystemInventory + 1.6.5 + + + + ${reference.SystemInventory-war.dist-ear} + / + + + ${reference.SystemInventory-ejb.dist-ear} + / + + + + + .\lib\nblibraries.properties + + + + SystemInventory-ejb + j2ee_ear_archive + + dist-ear + clean-ear + dist-ear + + + SystemInventory-war + j2ee_ear_archive + + dist-ear + clean-ear + dist-ear + + + + diff --git a/src/conf/MANIFEST.MF b/src/conf/MANIFEST.MF new file mode 100644 index 0000000..59499bc --- /dev/null +++ b/src/conf/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 +