diff --git a/Inventario-ejb/build.xml b/Inventario-ejb/build.xml
index b02d1e2..78b5d24 100644
--- a/Inventario-ejb/build.xml
+++ b/Inventario-ejb/build.xml
@@ -1,68 +1,68 @@
-
-
-
-
-
-
-
-
-
-
- Builds, tests, and runs the project Inventario-ejb.
-
-
-
+
+
+
+
+
+
+
+
+
+
+ Builds, tests, and runs the project Inventario-ejb.
+
+
+
diff --git a/Inventario-ejb/nbproject/build-impl.xml b/Inventario-ejb/nbproject/build-impl.xml
index 87f8117..4a2a1df 100644
--- a/Inventario-ejb/nbproject/build-impl.xml
+++ b/Inventario-ejb/nbproject/build-impl.xml
@@ -1,1253 +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
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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/Inventario-ejb/nbproject/genfiles.properties b/Inventario-ejb/nbproject/genfiles.properties
index f50729f..6446701 100644
--- a/Inventario-ejb/nbproject/genfiles.properties
+++ b/Inventario-ejb/nbproject/genfiles.properties
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=369704af
-build.xml.script.CRC32=d98c699b
-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=369704af
-nbproject/build-impl.xml.script.CRC32=27f3e739
-nbproject/build-impl.xml.stylesheet.CRC32=62693482@1.75
+build.xml.data.CRC32=369704af
+build.xml.script.CRC32=d98c699b
+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=369704af
+nbproject/build-impl.xml.script.CRC32=27f3e739
+nbproject/build-impl.xml.stylesheet.CRC32=62693482@1.75
diff --git a/Inventario-ejb/nbproject/project.xml b/Inventario-ejb/nbproject/project.xml
index 75a3478..6eff799 100644
--- a/Inventario-ejb/nbproject/project.xml
+++ b/Inventario-ejb/nbproject/project.xml
@@ -1,20 +1,20 @@
-
-
- org.netbeans.modules.j2ee.ejbjarproject
-
-
- Inventario-ejb
- 1.6.5
-
-
-
-
-
-
-
-
-
- .././lib/nblibraries.properties
-
-
-
+
+
+ org.netbeans.modules.j2ee.ejbjarproject
+
+
+ Inventario-ejb
+ 1.6.5
+
+
+
+
+
+
+
+
+
+ .././lib/nblibraries.properties
+
+
+
diff --git a/Inventario-ejb/src/java/mx/edu/tjs/chapala/sistemas/bl/CategoriaBL.java b/Inventario-ejb/src/java/mx/edu/tjs/chapala/sistemas/bl/CategoriaBL.java
index 3cdc99c..144a117 100644
--- a/Inventario-ejb/src/java/mx/edu/tjs/chapala/sistemas/bl/CategoriaBL.java
+++ b/Inventario-ejb/src/java/mx/edu/tjs/chapala/sistemas/bl/CategoriaBL.java
@@ -56,6 +56,12 @@ public class CategoriaBL implements CategoriaBLLocal {
return m;
}
+ public void agregarC (Categoria categoria){
+ CategoriaDAO categoriaDAO = new CategoriaDAO();
+ categoriaDAO.agregar(categoria);
+
+ }
+
// Add business logic below. (Right-click in editor and choose
// "Insert Code > Add Business Method")
@@ -124,6 +130,10 @@ public class CategoriaBL implements CategoriaBLLocal {
}
return m;
}
+ public void eliminarC (Categoria categoria){
+ CategoriaDAO a = new CategoriaDAO();
+ a.eliminar(categoria);
+ }
@Override
public Mensaje editar(Categoria categoria) {
@@ -151,6 +161,15 @@ public class CategoriaBL implements CategoriaBLLocal {
CategoriaDAO p = new CategoriaDAO();
return p.buscarStatus(true);
}
+
+ public Categoria buscarIdInt(int id) {
+ CategoriaDAO categoriaDAO = new CategoriaDAO();
+ if(categoriaDAO==null){
+ return null;
+ }else{
+ return categoriaDAO.buscarIdInt(id);
+ }
+ }
}
diff --git a/Inventario-ejb/src/java/mx/edu/tjs/chapala/sistemas/bl/CategoriaBLLocal.java b/Inventario-ejb/src/java/mx/edu/tjs/chapala/sistemas/bl/CategoriaBLLocal.java
index 6297e43..3dc71e6 100644
--- a/Inventario-ejb/src/java/mx/edu/tjs/chapala/sistemas/bl/CategoriaBLLocal.java
+++ b/Inventario-ejb/src/java/mx/edu/tjs/chapala/sistemas/bl/CategoriaBLLocal.java
@@ -27,5 +27,9 @@ public interface CategoriaBLLocal {
Mensaje eliminarId(Categoria categoria);
- Mensaje editar(Categoria p);
+ Mensaje editar(Categoria p);
+
+ public Categoria buscarIdInt (int id) ;
+ public void agregarC(Categoria categoria);
+ public void eliminarC(Categoria categoria);
}
diff --git a/Inventario-ejb/src/java/mx/edu/tjs/chapala/sistemas/dao/CategoriaDAO.java b/Inventario-ejb/src/java/mx/edu/tjs/chapala/sistemas/dao/CategoriaDAO.java
index 88c6ebd..6ede0c1 100644
--- a/Inventario-ejb/src/java/mx/edu/tjs/chapala/sistemas/dao/CategoriaDAO.java
+++ b/Inventario-ejb/src/java/mx/edu/tjs/chapala/sistemas/dao/CategoriaDAO.java
@@ -119,5 +119,18 @@ public class CategoriaDAO {
q.setParameter("status", s);
return q.getResultList();
}
+ public Categoria buscarIdInt(int id){
+ if (id == 0 ) {
+ return null;
+ }
+ Query q = em.createNamedQuery("Categoria.findById");
+ q.setParameter("id", id);
+ if(q.getResultList().isEmpty()){
+ return null;
+ } else {
+ return (Categoria) q.getResultList().get(0);
+ }
+
+ }
}
diff --git a/Inventario-war/src/java/mx/edu/tjs/servicios/CategoriaEndpoint.java b/Inventario-war/src/java/mx/edu/tjs/servicios/CategoriaEndpoint.java
new file mode 100644
index 0000000..634c1d7
--- /dev/null
+++ b/Inventario-war/src/java/mx/edu/tjs/servicios/CategoriaEndpoint.java
@@ -0,0 +1,158 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/Servlet.java to edit this template
+ */
+package mx.edu.tjs.servicios;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.ejb.EJB;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import mx.edu.tjs.chapala.sistemas.bl.CategoriaBLLocal;
+import mx.edu.tjs.chapala.sistemas.modelo.Categoria;
+
+/**
+ *
+ * @author nayelivilchismariscal
+ */
+@WebServlet(name = "CategoriaEndpoint", urlPatterns = {"/CategoriaEndpoint"})
+public class CategoriaEndpoint extends HttpServlet {
+ @EJB
+ private CategoriaBLLocal categoriaBL;
+Categoria m ;
+ /**
+ * Processes requests for both HTTP GET
and POST
+ * methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ try (PrintWriter out = response.getWriter()) {
+
+ String opcion = request.getParameter("opcion");
+ // Verificar el token
+ String token = request.getParameter("t");
+ if (!"h978HIJG87FD5757huuyujJJKAYtyywedh".equals(token)) {
+ out.print("Acceso Denegado");
+
+ return;
+ }
+
+ switch(opcion){
+ case "1":
+ m = categoriaBL.buscarIdInt(Integer.parseInt(request.getParameter("id")));
+ if(m.getStatus() == 0){
+ out.print("No existe la categoria");
+ }else{
+ out.print("
");
+ out.print("
Categoria
");
+ out.print("Nombre: " + m.getNombre() + "
");
+ out.print("");
+ }
+
+ break;
+ case "2":
+ m = categoriaBL.buscarIdInt(Integer.parseInt(request.getParameter("id")));
+ if(m.getStatus() == 0){
+ out.print("No existe ese elemento");
+ }else{
+ categoriaBL.eliminarC(m);
+ out.print("Se elimino la categoria");
+ }
+ break;
+ case "3":
+ Categoria nuevo = new Categoria();
+ nuevo.setStatus((short) 1);
+ nuevo.setNombre(request.getParameter("nombre"));
+ categoriaBL.agregarC(nuevo);
+ out.print("Se agrego la categoria");
+ break;
+ case "4":
+
+ try {
+ int id = Integer.parseInt(request.getParameter("id"));
+ Categoria categoriaExistente = categoriaBL.buscarIdInt(id);
+
+ if (categoriaExistente == null || categoriaExistente.getStatus() == 0) {
+ out.print("No existe la categoria");
+ } else {
+ String nuevoNombre = request.getParameter("nombre");
+
+ // Actualizar los campos necesarios
+ if (nuevoNombre != null && !nuevoNombre.isEmpty()) {
+ categoriaExistente.setNombre(nuevoNombre);
+ }
+
+ // Aquí puedes agregar más campos si es necesario
+ // marcaExistente.setOtroCampo(request.getParameter("otroCampo"));
+
+ categoriaBL.editar(categoriaExistente);
+ out.print("Editado con éxito");
+ }
+ } catch (NumberFormatException e) {
+ out.print("ID de marca no válido");
+ } catch (Exception e) {
+ out.print("Ocurrió un error al editar la marca");
+ }
+ break;
+
+
+ default:
+ out.print(" No existe esa opcion
");
+ break;
+
+ }
+
+
+ }
+ }
+ //
+ /**
+ * Handles the HTTP GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }//
+ }
+
+
\ No newline at end of file
diff --git a/Inventario-war/web/resources/css/cssLayout.css b/Inventario-war/web/resources/css/cssLayout.css
index 27cd8f1..7f95157 100644
--- a/Inventario-war/web/resources/css/cssLayout.css
+++ b/Inventario-war/web/resources/css/cssLayout.css
@@ -136,7 +136,9 @@ th.ui-state-default {
}
-
+.body1 {
+ background-image: url('https://img.freepik.com/vector-gratis/fondo-futurista-degradado-geometrico_23-2149116406.jpg?size=626&ext=jpg&ga=GA1.1.117944100.1709510400&semt=ais');
+}
diff --git a/nbproject/project.properties b/nbproject/project.properties
index 0f3f88f..971c6f5 100644
--- a/nbproject/project.properties
+++ b/nbproject/project.properties
@@ -1,41 +1,41 @@
-build.classes.excludes=**/*.java,**/*.form,**/.nbattrs
-build.dir=build
-build.generated.dir=${build.dir}/generated
-client.module.uri=Inventario-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.Inventario-war.dist-ear}:\
- ${reference.Inventario-ejb.dist-ear}
-jar.name=Inventario.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.Inventario-ejb=Inventario-ejb
-project.Inventario-war=Inventario-war
-reference.Inventario-ejb.dist-ear=${project.Inventario-ejb}/dist/Inventario-ejb.jar
-reference.Inventario-war.dist-ear=${project.Inventario-war}/dist/Inventario-war.war
-resource.dir=setup
-run.classpath=
-source.root=.
+build.classes.excludes=**/*.java,**/*.form,**/.nbattrs
+build.dir=build
+build.generated.dir=${build.dir}/generated
+client.module.uri=Inventario-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.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar
+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.Inventario-war.dist-ear}:\
+ ${reference.Inventario-ejb.dist-ear}
+jar.name=Inventario.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.Inventario-ejb=Inventario-ejb
+project.Inventario-war=Inventario-war
+reference.Inventario-ejb.dist-ear=${project.Inventario-ejb}/dist/Inventario-ejb.jar
+reference.Inventario-war.dist-ear=${project.Inventario-war}/dist/Inventario-war.war
+resource.dir=setup
+run.classpath=
+source.root=.