chore
6 months ago
commit
8aa1783f17
113 changed files with 12550 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,61 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- You may freely edit this file. See commented blocks below for --> |
|||
<!-- some examples of how to customize the build. --> |
|||
<!-- (If you delete it and reopen the project it will be recreated.) --> |
|||
<!-- By default, only the Clean and Build commands use this build script. --> |
|||
<!-- Commands such as Run, Debug, and Test only use this build script if --> |
|||
<!-- the Compile on Save feature is turned off for the project. --> |
|||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> |
|||
<!-- in the project's Project Properties dialog box.--> |
|||
<project name="si" default="default" basedir="." xmlns:ear="http://www.netbeans.org/ns/j2ee-earproject/2"> |
|||
<description>Builds, tests, and runs the project si.</description> |
|||
<import file="nbproject/build-impl.xml"/> |
|||
<!-- |
|||
|
|||
There exist several targets which are by default empty and which can be |
|||
used for execution of your tasks. These targets are usually executed |
|||
before and after some main targets. They are: |
|||
|
|||
pre-init: called before initialization of project properties |
|||
post-init: called after initialization of project properties |
|||
pre-compile: called before javac compilation |
|||
post-compile: called after javac compilation |
|||
pre-dist: called before archive building |
|||
post-dist: called after archive building |
|||
post-clean: called after cleaning build products |
|||
pre-run-deploy: called before deploying |
|||
post-run-deploy: called after deploying |
|||
|
|||
Example of pluging an obfuscator after the compilation could look like |
|||
|
|||
<target name="post-compile"> |
|||
<obfuscate> |
|||
<fileset dir="${build.classes.dir}"/> |
|||
</obfuscate> |
|||
</target> |
|||
|
|||
For list of available properties check the imported |
|||
nbproject/build-impl.xml file. |
|||
|
|||
|
|||
Other way how to customize the build is by overriding existing main targets. |
|||
The target of interest are: |
|||
|
|||
do-dist: archive building |
|||
run: execution of project |
|||
|
|||
Example of overriding the target for project execution could look like |
|||
|
|||
<target name="run" depends="<PROJNAME>-impl.jar"> |
|||
<exec dir="bin" executable="launcher.exe"> |
|||
<arg file="${dist.jar}"/> |
|||
</exec> |
|||
</target> |
|||
|
|||
Notice that overridden target depends on jar target and not only on |
|||
compile target as regular run target does. Again, for list of available |
|||
properties which you can use check the target you are overriding in |
|||
nbproject/build-impl.xml file. |
|||
|
|||
--> |
|||
</project> |
@ -0,0 +1,218 @@ |
|||
-- MySQL Script generated by MySQL Workbench |
|||
-- Tue May 14 10:11:32 2024 |
|||
-- Model: New Model Version: 1.0 |
|||
-- MySQL Workbench Forward Engineering |
|||
|
|||
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; |
|||
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; |
|||
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; |
|||
|
|||
-- ----------------------------------------------------- |
|||
-- Schema sistemadeinventario |
|||
-- ----------------------------------------------------- |
|||
|
|||
-- ----------------------------------------------------- |
|||
-- Schema sistemadeinventario |
|||
-- ----------------------------------------------------- |
|||
CREATE SCHEMA IF NOT EXISTS `sistemadeinventario` DEFAULT CHARACTER SET utf8 ; |
|||
-- ----------------------------------------------------- |
|||
-- Schema sistemadeinventario |
|||
-- ----------------------------------------------------- |
|||
|
|||
-- ----------------------------------------------------- |
|||
-- Schema sistemadeinventario |
|||
-- ----------------------------------------------------- |
|||
CREATE SCHEMA IF NOT EXISTS `sistemadeinventario` DEFAULT CHARACTER SET utf8 ; |
|||
USE `sistemadeinventario` ; |
|||
|
|||
-- ----------------------------------------------------- |
|||
-- Table `sistemadeinventario`.`Registro` |
|||
-- ----------------------------------------------------- |
|||
CREATE TABLE IF NOT EXISTS `sistemadeinventario`.`Registro` ( |
|||
`id` INT NOT NULL AUTO_INCREMENT, |
|||
`Entrada` VARCHAR(10) NULL DEFAULT NULL, |
|||
`salida` VARCHAR(10) NULL DEFAULT NULL, |
|||
`Alta` VARCHAR(45) NULL DEFAULT NULL, |
|||
`baja` VARCHAR(45) NULL DEFAULT NULL, |
|||
`status` INT NULL DEFAULT NULL, |
|||
PRIMARY KEY (`id`)) |
|||
ENGINE = InnoDB; |
|||
|
|||
|
|||
-- ----------------------------------------------------- |
|||
-- Table `sistemadeinventario`.`departamento` |
|||
-- ----------------------------------------------------- |
|||
CREATE TABLE IF NOT EXISTS `sistemadeinventario`.`departamento` ( |
|||
`id` INT NOT NULL AUTO_INCREMENT, |
|||
`nombre` VARCHAR(20) NULL DEFAULT NULL, |
|||
`anaquel` VARCHAR(15) NULL DEFAULT NULL, |
|||
`status` INT NULL DEFAULT NULL, |
|||
PRIMARY KEY (`id`)) |
|||
ENGINE = InnoDB |
|||
AUTO_INCREMENT = 2 |
|||
DEFAULT CHARACTER SET = utf8mb3; |
|||
|
|||
|
|||
-- ----------------------------------------------------- |
|||
-- Table `sistemadeinventario`.`estado` |
|||
-- ----------------------------------------------------- |
|||
CREATE TABLE IF NOT EXISTS `sistemadeinventario`.`estado` ( |
|||
`id` INT NOT NULL AUTO_INCREMENT, |
|||
`nombre` VARCHAR(45) NULL DEFAULT NULL, |
|||
`status` INT NULL, |
|||
PRIMARY KEY (`id`)) |
|||
ENGINE = InnoDB |
|||
DEFAULT CHARACTER SET = utf8mb3; |
|||
|
|||
|
|||
-- ----------------------------------------------------- |
|||
-- Table `sistemadeinventario`.`marca` |
|||
-- ----------------------------------------------------- |
|||
CREATE TABLE IF NOT EXISTS `sistemadeinventario`.`marca` ( |
|||
`id` INT NOT NULL AUTO_INCREMENT, |
|||
`nombre` VARCHAR(20) NULL DEFAULT NULL, |
|||
`status` INT NULL DEFAULT NULL, |
|||
PRIMARY KEY (`id`)) |
|||
ENGINE = InnoDB |
|||
DEFAULT CHARACTER SET = utf8mb3; |
|||
|
|||
|
|||
-- ----------------------------------------------------- |
|||
-- Table `sistemadeinventario`.`pais` |
|||
-- ----------------------------------------------------- |
|||
CREATE TABLE IF NOT EXISTS `sistemadeinventario`.`pais` ( |
|||
`id` INT NOT NULL, |
|||
`nombre` VARCHAR(45) NULL DEFAULT NULL, |
|||
`status` INT NULL, |
|||
PRIMARY KEY (`id`)) |
|||
ENGINE = InnoDB |
|||
DEFAULT CHARACTER SET = utf8mb3; |
|||
|
|||
|
|||
-- ----------------------------------------------------- |
|||
-- Table `sistemadeinventario`.`provedor` |
|||
-- ----------------------------------------------------- |
|||
CREATE TABLE IF NOT EXISTS `sistemadeinventario`.`provedor` ( |
|||
`id` INT NOT NULL AUTO_INCREMENT, |
|||
`nombre` VARCHAR(20) NULL DEFAULT NULL, |
|||
`direccion` VARCHAR(20) NULL DEFAULT NULL, |
|||
`correo` VARCHAR(15) NULL DEFAULT NULL, |
|||
`telefono` VARCHAR(10) NULL DEFAULT NULL, |
|||
`status` INT NULL DEFAULT NULL, |
|||
`estado_idestado` INT NOT NULL, |
|||
`pais_id` INT NOT NULL, |
|||
PRIMARY KEY (`id`), |
|||
INDEX `fk_provedor_estado1_idx` (`estado_idestado` ASC) VISIBLE, |
|||
INDEX `fk_provedor_pais1_idx` (`pais_id` ASC) VISIBLE, |
|||
CONSTRAINT `fk_provedor_estado1` |
|||
FOREIGN KEY (`estado_idestado`) |
|||
REFERENCES `sistemadeinventario`.`estado` (`id`), |
|||
CONSTRAINT `fk_provedor_pais1` |
|||
FOREIGN KEY (`pais_id`) |
|||
REFERENCES `sistemadeinventario`.`pais` (`id`) |
|||
ON DELETE NO ACTION |
|||
ON UPDATE NO ACTION) |
|||
ENGINE = InnoDB |
|||
DEFAULT CHARACTER SET = utf8mb3; |
|||
|
|||
|
|||
-- ----------------------------------------------------- |
|||
-- Table `sistemadeinventario`.`tipo` |
|||
-- ----------------------------------------------------- |
|||
CREATE TABLE IF NOT EXISTS `sistemadeinventario`.`tipo` ( |
|||
`id` INT NOT NULL AUTO_INCREMENT, |
|||
`nombre` VARCHAR(20) NULL DEFAULT NULL, |
|||
`status` INT NULL DEFAULT NULL, |
|||
PRIMARY KEY (`id`)) |
|||
ENGINE = InnoDB |
|||
DEFAULT CHARACTER SET = utf8mb3; |
|||
|
|||
|
|||
-- ----------------------------------------------------- |
|||
-- Table `sistemadeinventario`.`producto` |
|||
-- ----------------------------------------------------- |
|||
CREATE TABLE IF NOT EXISTS `sistemadeinventario`.`producto` ( |
|||
`id` INT NOT NULL AUTO_INCREMENT, |
|||
`cantidad` VARCHAR(10) NULL DEFAULT NULL, |
|||
`nombre` VARCHAR(20) NULL DEFAULT NULL, |
|||
`precio` INT NULL DEFAULT NULL, |
|||
`codigoBarras` VARCHAR(15) NULL DEFAULT NULL, |
|||
`medida` INT NULL DEFAULT NULL, |
|||
`lote` VARCHAR(10) NULL DEFAULT NULL, |
|||
`departamento_id` INT NOT NULL, |
|||
`tipo_idtipo` INT NOT NULL, |
|||
`marca_idmarca` INT NOT NULL, |
|||
`provedor_idprovedor` INT NOT NULL, |
|||
`status` INT NULL DEFAULT NULL, |
|||
PRIMARY KEY (`id`), |
|||
INDEX `fk_producto_departamento_idx` (`departamento_id` ASC) VISIBLE, |
|||
INDEX `fk_producto_tipo1_idx` (`tipo_idtipo` ASC) VISIBLE, |
|||
INDEX `fk_producto_marca1_idx` (`marca_idmarca` ASC) VISIBLE, |
|||
INDEX `fk_producto_provedor1_idx` (`provedor_idprovedor` ASC) VISIBLE, |
|||
CONSTRAINT `fk_producto_departamento` |
|||
FOREIGN KEY (`departamento_id`) |
|||
REFERENCES `sistemadeinventario`.`departamento` (`id`), |
|||
CONSTRAINT `fk_producto_marca1` |
|||
FOREIGN KEY (`marca_idmarca`) |
|||
REFERENCES `sistemadeinventario`.`marca` (`id`), |
|||
CONSTRAINT `fk_producto_provedor1` |
|||
FOREIGN KEY (`provedor_idprovedor`) |
|||
REFERENCES `sistemadeinventario`.`provedor` (`id`), |
|||
CONSTRAINT `fk_producto_tipo1` |
|||
FOREIGN KEY (`tipo_idtipo`) |
|||
REFERENCES `sistemadeinventario`.`tipo` (`id`)) |
|||
ENGINE = InnoDB |
|||
DEFAULT CHARACTER SET = utf8mb3; |
|||
|
|||
|
|||
-- ----------------------------------------------------- |
|||
-- Table `sistemadeinventario`.`rol` |
|||
-- ----------------------------------------------------- |
|||
CREATE TABLE IF NOT EXISTS `sistemadeinventario`.`rol` ( |
|||
`id` INT NOT NULL AUTO_INCREMENT, |
|||
`nombre` VARCHAR(20) NULL DEFAULT NULL, |
|||
`status` INT NULL, |
|||
PRIMARY KEY (`id`)) |
|||
ENGINE = InnoDB |
|||
DEFAULT CHARACTER SET = utf8mb3; |
|||
|
|||
|
|||
-- ----------------------------------------------------- |
|||
-- Table `sistemadeinventario`.`usuario` |
|||
-- ----------------------------------------------------- |
|||
CREATE TABLE IF NOT EXISTS `sistemadeinventario`.`usuario` ( |
|||
`id` INT NOT NULL AUTO_INCREMENT, |
|||
`nombre` VARCHAR(45) NULL DEFAULT NULL, |
|||
`sexo` CHAR(1) NULL DEFAULT NULL, |
|||
`telefono` VARCHAR(10) NULL DEFAULT NULL, |
|||
`correo` VARCHAR(20) NULL DEFAULT NULL, |
|||
`direccion` VARCHAR(40) NULL DEFAULT NULL, |
|||
`status` INT NULL DEFAULT NULL, |
|||
`npila` VARCHAR(15) NULL DEFAULT NULL, |
|||
`username` VARCHAR(20) NULL DEFAULT NULL, |
|||
`rol_idrol` INT NOT NULL, |
|||
`estado_idestado` INT NOT NULL, |
|||
`pais_id` INT NOT NULL, |
|||
PRIMARY KEY (`id`), |
|||
INDEX `fk_usuario_rol1_idx` (`rol_idrol` ASC) VISIBLE, |
|||
INDEX `fk_usuario_estado1_idx` (`estado_idestado` ASC) VISIBLE, |
|||
INDEX `fk_usuario_pais1_idx` (`pais_id` ASC) VISIBLE, |
|||
CONSTRAINT `fk_usuario_estado1` |
|||
FOREIGN KEY (`estado_idestado`) |
|||
REFERENCES `sistemadeinventario`.`estado` (`id`), |
|||
CONSTRAINT `fk_usuario_rol1` |
|||
FOREIGN KEY (`rol_idrol`) |
|||
REFERENCES `sistemadeinventario`.`rol` (`id`), |
|||
CONSTRAINT `fk_usuario_pais1` |
|||
FOREIGN KEY (`pais_id`) |
|||
REFERENCES `sistemadeinventario`.`pais` (`id`) |
|||
ON DELETE NO ACTION |
|||
ON UPDATE NO ACTION) |
|||
ENGINE = InnoDB |
|||
DEFAULT CHARACTER SET = utf8mb3; |
|||
|
|||
USE `sistemadeinventario` ; |
|||
|
|||
SET SQL_MODE=@OLD_SQL_MODE; |
|||
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; |
|||
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; |
After Width: | Height: | Size: 257 KiB |
@ -0,0 +1,131 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- |
|||
|
|||
Licensed to the Apache Software Foundation (ASF) under one |
|||
or more contributor license agreements. See the NOTICE file |
|||
distributed with this work for additional information |
|||
regarding copyright ownership. The ASF licenses this file |
|||
to you under the Apache License, Version 2.0 (the |
|||
"License"); you may not use this file except in compliance |
|||
with the License. You may obtain a copy of the License at |
|||
|
|||
http://www.apache.org/licenses/LICENSE-2.0 |
|||
|
|||
Unless required by applicable law or agreed to in writing, |
|||
software distributed under the License is distributed on an |
|||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|||
KIND, either express or implied. See the License for the |
|||
specific language governing permissions and limitations |
|||
under the License. |
|||
|
|||
--> |
|||
<project default="-deploy-ant" basedir="."> |
|||
<target name="-init-cl-deployment-env" if="deploy.ant.enabled"> |
|||
<property file="${deploy.ant.properties.file}" /> |
|||
<available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/> |
|||
<available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/> |
|||
<available file="${deploy.ant.resource.dir}" property="has.setup"/> |
|||
<tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/> |
|||
</target> |
|||
|
|||
<target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present"> |
|||
<tempfile prefix="gfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/> |
|||
<copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/> |
|||
<!-- The doctype triggers resolution which can fail --> |
|||
<replace file="${temp.sun.web}"> |
|||
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken> |
|||
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue> |
|||
</replace> |
|||
<replace file="${temp.sun.web}"> |
|||
<replacetoken><![CDATA[<sun-web-app]]></replacetoken> |
|||
<replacevalue><![CDATA[--> <sun-web-app]]></replacevalue> |
|||
</replace> |
|||
<xmlproperty file="${temp.sun.web}" validate="false"> |
|||
</xmlproperty> |
|||
<delete file="${temp.sun.web}"/> |
|||
<condition property="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}" else="${gfv3.url}/${ant.project.name}"> |
|||
<isset property="sun-web-app.context-root"/> |
|||
</condition> |
|||
<condition property="deploy.context.root.argument" value="&contextroot=${sun-web-app.context-root}" else="/${ant.project.name}"> |
|||
<isset property="sun-web-app.context-root"/> |
|||
</condition> |
|||
</target> |
|||
<target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present"> |
|||
<tempfile prefix="gfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/> |
|||
<copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/> |
|||
<!-- The doctype triggers resolution which can fail --> |
|||
<replace file="${temp.gf.web}"> |
|||
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken> |
|||
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue> |
|||
</replace> |
|||
<replace file="${temp.gf.web}"> |
|||
<replacetoken><![CDATA[<glassfish-web-app]]></replacetoken> |
|||
<replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue> |
|||
</replace> |
|||
<xmlproperty file="${temp.gf.web}" validate="false"> |
|||
</xmlproperty> |
|||
<delete file="${temp.gf.web}"/> |
|||
<condition property="deploy.ant.client.url" value="${gfv3.url}${glassfish-web-app.context-root}" else="${gfv3.url}/${ant.project.name}"> |
|||
<isset property="glassfish-web-app.context-root"/> |
|||
</condition> |
|||
<condition property="deploy.context.root.argument" value="&contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}"> |
|||
<isset property="glassfish-web-app.context-root"/> |
|||
</condition> |
|||
</target> |
|||
<target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present"> |
|||
<property name="deploy.context.root.argument" value=""/> |
|||
</target> |
|||
<target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup"> |
|||
<tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/> |
|||
<mkdir dir="${gfv3.resources.dir}"/> |
|||
<mkdir dir="${gfv3.resources.dir}/META-INF"/> |
|||
<copy todir="${gfv3.resources.dir}/META-INF"> |
|||
<fileset dir="${deploy.ant.resource.dir}"/> |
|||
</copy> |
|||
<jar destfile="${deploy.ant.archive}" update="true"> |
|||
<fileset dir="${gfv3.resources.dir}"/> |
|||
</jar> |
|||
<delete dir="${gfv3.resources.dir}"/> |
|||
</target> |
|||
<target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled"> |
|||
<antcall target="-deploy-without-pw"/> |
|||
<antcall target="-deploy-with-pw"/> |
|||
</target> |
|||
|
|||
<target name="-deploy-without-pw" unless="gfv3.password"> |
|||
<echo message="Deploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> |
|||
<get src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-deploy-with-pw" if="gfv3.password"> |
|||
<echo message="Deploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> |
|||
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled"> |
|||
<antcall target="-undeploy-without-pw"/> |
|||
<antcall target="-undeploy-with-pw"/> |
|||
</target> |
|||
|
|||
<target name="-undeploy-without-pw" unless="gfv3.password"> |
|||
<echo message="Undeploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<get src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-undeploy-with-pw" if="gfv3.password"> |
|||
<echo message="Undeploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
</project> |
@ -0,0 +1,635 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- |
|||
*** GENERATED FROM project.xml - DO NOT EDIT *** |
|||
*** EDIT ../build.xml INSTEAD *** |
|||
|
|||
For the purpose of easier reading the script |
|||
is divided into following sections: |
|||
|
|||
- initialization |
|||
- compilation |
|||
- dist |
|||
- execution |
|||
- debugging |
|||
- cleanup |
|||
|
|||
--> |
|||
<project xmlns:ear2="http://www.netbeans.org/ns/j2ee-earproject/2" basedir=".." default="default" name="si-impl"> |
|||
<import file="ant-deploy.xml"/> |
|||
<fail message="Please build using Ant 1.7.1 or higher."> |
|||
<condition> |
|||
<not> |
|||
<antversion atleast="1.7.1"/> |
|||
</not> |
|||
</condition> |
|||
</fail> |
|||
<target depends="dist" description="Build whole project." name="default"/> |
|||
<!-- |
|||
INITIALIZATION SECTION |
|||
--> |
|||
<target name="pre-init"> |
|||
<!-- Empty placeholder for easier customization. --> |
|||
<!-- You can override this target in the ../build.xml file. --> |
|||
</target> |
|||
<target depends="pre-init" name="init-private"> |
|||
<property file="nbproject/private/private.properties"/> |
|||
</target> |
|||
<target depends="pre-init,init-private" name="init-userdir"> |
|||
<property location="${netbeans.user}/build.properties" name="user.properties.file"/> |
|||
</target> |
|||
<target depends="pre-init,init-private,init-userdir" name="init-user"> |
|||
<property file="${user.properties.file}"/> |
|||
</target> |
|||
<target depends="pre-init,init-private,init-userdir,init-user" name="init-project"> |
|||
<property file="nbproject/project.properties"/> |
|||
</target> |
|||
<target depends="pre-init,init-private,init-userdir,init-user,init-project" name="do-init"> |
|||
<!-- The two properties below are usually overridden --> |
|||
<!-- by the active platform. Just a fallback. --> |
|||
<property name="default.javac.source" value="1.4"/> |
|||
<property name="default.javac.target" value="1.4"/> |
|||
<condition property="do.compile.jsps"> |
|||
<istrue value="${compile.jsps}"/> |
|||
</condition> |
|||
<condition property="do.display.browser.old"> |
|||
<and> |
|||
<istrue value="${display.browser}"/> |
|||
<isset property="client.module.uri"/> |
|||
<not> |
|||
<isset property="app.client"/> |
|||
</not> |
|||
<not> |
|||
<isset property="browser.context"/> |
|||
</not> |
|||
</and> |
|||
</condition> |
|||
<condition property="do.display.browser"> |
|||
<and> |
|||
<istrue value="${display.browser}"/> |
|||
<isset property="client.module.uri"/> |
|||
<not> |
|||
<isset property="app.client"/> |
|||
</not> |
|||
<isset property="browser.context"/> |
|||
</and> |
|||
</condition> |
|||
<available file="${meta.inf}/MANIFEST.MF" property="has.custom.manifest"/> |
|||
<!-- |
|||
Variables needed to support directory deployment. |
|||
--> |
|||
<condition property="do.package.with.custom.manifest.not.directory.deploy"> |
|||
<and> |
|||
<isset property="has.custom.manifest"/> |
|||
<isfalse value="${directory.deployment.supported}"/> |
|||
</and> |
|||
</condition> |
|||
<condition property="do.package.without.custom.manifest.not.directory.deploy"> |
|||
<and> |
|||
<not> |
|||
<isset property="has.custom.manifest"/> |
|||
</not> |
|||
<isfalse value="${directory.deployment.supported}"/> |
|||
</and> |
|||
</condition> |
|||
<condition property="do.package.not.directory.deploy"> |
|||
<isfalse value="${directory.deployment.supported}"/> |
|||
</condition> |
|||
<!--End Variables needed to support directory deployment.--> |
|||
<condition else="" property="j2ee.appclient.mainclass.tool.param" value="-mainclass ${main.class}"> |
|||
<and> |
|||
<isset property="main.class"/> |
|||
<not> |
|||
<equals arg1="${main.class}" arg2="" trim="true"/> |
|||
</not> |
|||
</and> |
|||
</condition> |
|||
<condition else="" property="j2ee.appclient.jvmoptions.param" value="${j2ee.appclient.jvmoptions}"> |
|||
<and> |
|||
<isset property="j2ee.appclient.jvmoptions"/> |
|||
<not> |
|||
<equals arg1="${j2ee.appclient.jvmoptions}" arg2="" trim="true"/> |
|||
</not> |
|||
</and> |
|||
</condition> |
|||
<condition else="" property="application.args.param" value="${application.args}"> |
|||
<and> |
|||
<isset property="application.args"/> |
|||
<not> |
|||
<equals arg1="${application.args}" arg2="" trim="true"/> |
|||
</not> |
|||
</and> |
|||
</condition> |
|||
<condition property="can.debug.appclient"> |
|||
<and> |
|||
<isset property="netbeans.home"/> |
|||
<isset property="app.client"/> |
|||
</and> |
|||
</condition> |
|||
<path id="endorsed.classpath.path" path="${endorsed.classpath}"/> |
|||
<condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'"> |
|||
<and> |
|||
<isset property="endorsed.classpath"/> |
|||
<length length="0" string="${endorsed.classpath}" when="greater"/> |
|||
</and> |
|||
</condition> |
|||
</target> |
|||
<target depends="init" name="-init-cos"> |
|||
<condition else="false" property="build.deploy.on.save"> |
|||
<or> |
|||
<istrue value="${j2ee.deploy.on.save}"/> |
|||
<istrue value="${j2ee.compile.on.save}"/> |
|||
</or> |
|||
</condition> |
|||
</target> |
|||
<target name="post-init"> |
|||
<!-- Empty placeholder for easier customization. --> |
|||
<!-- You can override this target in the ../build.xml file. --> |
|||
</target> |
|||
<target depends="pre-init,init-private,init-userdir,init-user,init-project,do-init" name="init-check"> |
|||
<fail unless="build.dir">Must set build.dir</fail> |
|||
<fail unless="build.generated.dir">Must set build.generated.dir</fail> |
|||
<fail unless="dist.dir">Must set dist.dir</fail> |
|||
<fail unless="build.classes.excludes">Must set build.classes.excludes</fail> |
|||
<fail unless="dist.jar">Must set dist.jar</fail> |
|||
</target> |
|||
<target name="-init-taskdefs"> |
|||
<fail unless="libs.CopyLibs.classpath"> |
|||
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 |
|||
</fail> |
|||
<taskdef classpath="${libs.CopyLibs.classpath}" resource="org/netbeans/modules/java/j2seproject/copylibstask/antlib.xml"/> |
|||
</target> |
|||
<!-- |
|||
pre NB7.2 profiling section; consider it deprecated |
|||
--> |
|||
<target depends="-profile-pre-init, init, -profile-post-init, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/> |
|||
<target if="profiler.info.jvmargs.agent" name="-profile-pre-init"> |
|||
<!-- Empty placeholder for easier customization. --> |
|||
<!-- You can override this target in the ../build.xml file. --> |
|||
</target> |
|||
<target if="profiler.info.jvmargs.agent" name="-profile-post-init"> |
|||
<!-- Empty placeholder for easier customization. --> |
|||
<!-- You can override this target in the ../build.xml file. --> |
|||
</target> |
|||
<target depends="-profile-pre-init, init, -profile-post-init" if="profiler.info.jvmargs.agent" name="-profile-init-check"> |
|||
<fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail> |
|||
<fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail> |
|||
</target> |
|||
<!-- |
|||
end of pre NB7.2 profiling section |
|||
--> |
|||
<target depends="pre-init,init-private,init-userdir,init-user,init-project,do-init,post-init,init-check,-init-taskdefs" name="init"/> |
|||
<!-- |
|||
COMPILATION SECTION |
|||
--> |
|||
<target depends="init" name="deps-jar" unless="no.deps"> |
|||
<condition property="build.deploy.on.save" value="false"> |
|||
<not> |
|||
<isset property="build.deploy.on.save"/> |
|||
</not> |
|||
</condition> |
|||
</target> |
|||
<target depends="init" name="deps-j2ee-archive" unless="no.deps"> |
|||
<condition property="build.deploy.on.save" value="false"> |
|||
<not> |
|||
<isset property="build.deploy.on.save"/> |
|||
</not> |
|||
</condition> |
|||
<ant antfile="${project.si-ejb}/build.xml" inheritall="false" target="dist-ear"> |
|||
<property location="${build.dir}" name="dist.ear.dir"/> |
|||
<property name="deploy.on.save" value="${build.deploy.on.save}"/> |
|||
</ant> |
|||
<ant antfile="${project.si-war}/build.xml" inheritall="false" target="dist-ear"> |
|||
<property location="${build.dir}" name="dist.ear.dir"/> |
|||
<property name="deploy.on.save" value="${build.deploy.on.save}"/> |
|||
</ant> |
|||
</target> |
|||
<target depends="init,deps-jar,deps-j2ee-archive" name="pre-pre-compile"/> |
|||
<target name="pre-compile"> |
|||
<!-- Empty placeholder for easier customization. --> |
|||
<!-- You can override this target in the ../build.xml file. --> |
|||
</target> |
|||
<target depends="init,deps-jar,pre-pre-compile,pre-compile,-do-compile-deps" name="do-compile"> |
|||
<copy todir="${build.dir}/META-INF"> |
|||
<fileset dir="${meta.inf}"/> |
|||
</copy> |
|||
</target> |
|||
<target depends="init,deps-jar,pre-pre-compile,pre-compile" name="-do-compile-deps"> |
|||
<copyfiles files="${reference.si-war.dist-ear}" todir="${build.dir}//"/> |
|||
<copyfiles files="${reference.si-ejb.dist-ear}" todir="${build.dir}//"/> |
|||
</target> |
|||
<target name="post-compile"> |
|||
<!-- Empty placeholder for easier customization. --> |
|||
<!-- You can override this target in the ../build.xml file. --> |
|||
</target> |
|||
<target depends="init,deps-jar,pre-pre-compile,pre-compile,do-compile,post-compile" description="Compile project." name="compile"/> |
|||
<!-- |
|||
DIST BUILDING SECTION |
|||
--> |
|||
<target name="pre-dist"> |
|||
<!-- Empty placeholder for easier customization. --> |
|||
<!-- You can override this target in the ../build.xml file. --> |
|||
</target> |
|||
<target depends="init,compile,pre-dist" name="do-dist-without-manifest" unless="has.custom.manifest"> |
|||
<dirname file="${dist.jar}" property="dist.jar.dir"/> |
|||
<mkdir dir="${dist.jar.dir}"/> |
|||
<jar compress="${jar.compress}" jarfile="${dist.jar}"> |
|||
<fileset dir="${build.dir}"/> |
|||
</jar> |
|||
</target> |
|||
<target depends="init,compile,pre-dist" if="has.custom.manifest" name="do-dist-with-manifest"> |
|||
<dirname file="${dist.jar}" property="dist.jar.dir"/> |
|||
<mkdir dir="${dist.jar.dir}"/> |
|||
<jar compress="${jar.compress}" jarfile="${dist.jar}" manifest="${meta.inf}/MANIFEST.MF"> |
|||
<fileset dir="${build.dir}"/> |
|||
</jar> |
|||
</target> |
|||
<!-- |
|||
TARGETS NEEDED TO SUPPORT DIRECTORY DEPLOYMENT |
|||
--> |
|||
<target depends="init,compile,pre-dist" if="do.package.without.custom.manifest.not.directory.deploy" name="-do-tmp-dist-without-manifest"> |
|||
<dirname file="${dist.jar}" property="dist.jar.dir"/> |
|||
<mkdir dir="${dist.jar.dir}"/> |
|||
<jar compress="${jar.compress}" jarfile="${dist.jar}"> |
|||
<fileset dir="${build.dir}"/> |
|||
</jar> |
|||
</target> |
|||
<target depends="init,compile,pre-dist" if="do.package.with.custom.manifest.not.directory.deploy" name="-do-tmp-dist-with-manifest"> |
|||
<dirname file="${dist.jar}" property="dist.jar.dir"/> |
|||
<mkdir dir="${dist.jar.dir}"/> |
|||
<jar compress="${jar.compress}" jarfile="${dist.jar}" manifest="${meta.inf}/MANIFEST.MF"> |
|||
<fileset dir="${build.dir}"/> |
|||
</jar> |
|||
</target> |
|||
<target depends="init,compile,pre-dist,-do-tmp-dist-without-manifest,-do-tmp-dist-with-manifest" name="-do-dist-directory-deploy"/> |
|||
<target depends="init,compile,pre-dist,-do-dist-directory-deploy,post-dist" description="Build distribution (JAR) - if directory deployment is not supported." name="dist-directory-deploy"/> |
|||
<!-- |
|||
END TARGETS NEEDED TO SUPPORT DIRECTORY DEPLOYMENT |
|||
--> |
|||
<target name="post-dist"> |
|||
<!-- Empty placeholder for easier customization. --> |
|||
<!-- You can override this target in the ../build.xml file. --> |
|||
</target> |
|||
<target depends="init,compile,pre-dist,do-dist-without-manifest,do-dist-with-manifest,post-dist" description="Build distribution (JAR)." name="dist"/> |
|||
<!-- |
|||
EXECUTION SECTION |
|||
--> |
|||
<target depends="run-deploy,run-display-browser,run-ac" description="Deploy to server." name="run"/> |
|||
<target name="pre-run-deploy"> |
|||
<!-- Empty placeholder for easier customization. --> |
|||
<!-- You can override this target in the ../build.xml file. --> |
|||
</target> |
|||
<target name="post-run-deploy"> |
|||
<!-- Empty placeholder for easier customization. --> |
|||
<!-- You can override this target in the ../build.xml file. --> |
|||
</target> |
|||
<target name="-pre-nbmodule-run-deploy"> |
|||
<!-- Empty placeholder for easier customization. --> |
|||
<!-- This target can be overriden by NetBeans modules. Don't override it directly, use -pre-run-deploy task instead. --> |
|||
</target> |
|||
<target name="-post-nbmodule-run-deploy"> |
|||
<!-- Empty placeholder for easier customization. --> |
|||
<!-- This target can be overriden by NetBeans modules. Don't override it directly, use -post-run-deploy task instead. --> |
|||
</target> |
|||
<target name="-run-deploy-am" unless="no.deps"> |
|||
<!-- Task to deploy to the Access Manager runtime. --> |
|||
<ant antfile="${project.si-ejb}/build.xml" inheritall="false" target="-run-deploy-am"/> |
|||
<ant antfile="${project.si-war}/build.xml" inheritall="false" target="-run-deploy-am"/> |
|||
</target> |
|||
<target depends="-init-cos,dist-directory-deploy,pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,post-run-deploy" name="run-deploy"/> |
|||
<target if="netbeans.home" name="-run-deploy-nb"> |
|||
<nbdeploy clientModuleUri="${client.module.uri}" clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/> |
|||
</target> |
|||
<target name="-init-deploy-ant" unless="netbeans.home"> |
|||
<property name="deploy.ant.archive" value="${dist.jar}"/> |
|||
<property name="deploy.ant.resource.dir" value="${resource.dir}"/> |
|||
<property name="deploy.ant.enabled" value="true"/> |
|||
</target> |
|||
<target depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant" name="run-undeploy"/> |
|||
<target if="netbeans.home" name="-run-undeploy-nb"> |
|||
<fail message="Undeploy is not supported from within the IDE"/> |
|||
</target> |
|||
<target depends="dist" name="verify"> |
|||
<nbverify file="${dist.jar}"/> |
|||
</target> |
|||
<target depends="run-deploy,-init-display-browser,-display-browser-nb-old,-display-browser-nb,-display-browser-cl" name="run-display-browser"/> |
|||
<target if="do.display.browser" name="-init-display-browser"> |
|||
<condition property="do.display.browser.nb.old"> |
|||
<and> |
|||
<isset property="netbeans.home"/> |
|||
<not> |
|||
<isset property="browser.context"/> |
|||
</not> |
|||
</and> |
|||
</condition> |
|||
<condition property="do.display.browser.nb"> |
|||
<and> |
|||
<isset property="netbeans.home"/> |
|||
<isset property="browser.context"/> |
|||
</and> |
|||
</condition> |
|||
<condition property="do.display.browser.cl"> |
|||
<and> |
|||
<isset property="deploy.ant.enabled"/> |
|||
<isset property="deploy.ant.client.url"/> |
|||
</and> |
|||
</condition> |
|||
</target> |
|||
<target if="do.display.browser.nb.old" name="-display-browser-nb-old"> |
|||
<nbbrowse url="${client.url}"/> |
|||
</target> |
|||
<target if="do.display.browser.nb" name="-display-browser-nb"> |
|||
<nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/> |
|||
</target> |
|||
<target if="do.display.browser.cl" name="-get-browser" unless="browser"> |
|||
<condition property="browser" value="rundll32"> |
|||
<os family="windows"/> |
|||
</condition> |
|||
<condition else="" property="browser.args" value="url.dll,FileProtocolHandler"> |
|||
<os family="windows"/> |
|||
</condition> |
|||
<condition property="browser" value="/usr/bin/open"> |
|||
<os family="mac"/> |
|||
</condition> |
|||
<property environment="env"/> |
|||
<condition property="browser" value="${env.BROWSER}"> |
|||
<isset property="env.BROWSER"/> |
|||
</condition> |
|||
<condition property="browser" value="/usr/bin/firefox"> |
|||
<available file="/usr/bin/firefox"/> |
|||
</condition> |
|||
<condition property="browser" value="/usr/local/firefox/firefox"> |
|||
<available file="/usr/local/firefox/firefox"/> |
|||
</condition> |
|||
<condition property="browser" value="/usr/bin/mozilla"> |
|||
<available file="/usr/bin/mozilla"/> |
|||
</condition> |
|||
<condition property="browser" value="/usr/local/mozilla/mozilla"> |
|||
<available file="/usr/local/mozilla/mozilla"/> |
|||
</condition> |
|||
<condition property="browser" value="/usr/sfw/lib/firefox/firefox"> |
|||
<available file="/usr/sfw/lib/firefox/firefox"/> |
|||
</condition> |
|||
<condition property="browser" value="/opt/csw/bin/firefox"> |
|||
<available file="/opt/csw/bin/firefox"/> |
|||
</condition> |
|||
<condition property="browser" value="/usr/sfw/lib/mozilla/mozilla"> |
|||
<available file="/usr/sfw/lib/mozilla/mozilla"/> |
|||
</condition> |
|||
<condition property="browser" value="/opt/csw/bin/mozilla"> |
|||
<available file="/opt/csw/bin/mozilla"/> |
|||
</condition> |
|||
</target> |
|||
<target depends="-get-browser" if="do.display.browser.cl" name="-display-browser-cl"> |
|||
<fail unless="browser"> |
|||
Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. |
|||
</fail> |
|||
<property name="browse.url" value="${deploy.ant.client.url}${client.urlPart}"/> |
|||
<echo>Launching ${browse.url}</echo> |
|||
<exec executable="${browser}" spawn="true"> |
|||
<arg line="${browser.args} ${browse.url}"/> |
|||
</exec> |
|||
</target> |
|||
<target if="app.client" name="run-ac"> |
|||
<antcall target="-run-ac"/> |
|||
</target> |
|||
<target depends="init,-as-retrieve-option-workaround,-init-run-macros,-run-appclient-pregfv3,-run-appclient" name="-run-ac"/> |
|||
<target if="j2ee.appclient.tool.args" name="-run-appclient-pregfv3"> |
|||
<ear2:run-appclient-pregfv3/> |
|||
</target> |
|||
<target name="-run-appclient" unless="j2ee.appclient.tool.args"> |
|||
<ear2:run-appclient subprojectname="${app.client}"/> |
|||
</target> |
|||
<target if="j2ee.appclient.mainclass.args" name="-as-retrieve-option-workaround" unless="j2ee.clientName"> |
|||
<property name="client.jar" value="${dist.dir}/siClient.jar"/> |
|||
<sleep seconds="3"/> |
|||
<copy failonerror="false" file="${wa.copy.client.jar.from}/si/siClient.jar" todir="${dist.dir}"/> |
|||
<copy failonerror="false" flatten="true" todir="${dist.dir}/"> |
|||
<fileset dir="${wa.copy.client.jar.from}/si" includes="**/siClient.jar"/> |
|||
</copy> |
|||
<copy flatten="true" todir="${dist.dir}/siClient"> |
|||
<fileset dir="${wa.copy.client.jar.from}/si" includes="**/*.*ar"/> |
|||
</copy> |
|||
<copy failonerror="false" flatten="false" todir="${dist.dir}/siClient"> |
|||
<fileset dir="${dist.dir}/gfdeploy/si" includes="**/*.jar"/> |
|||
</copy> |
|||
</target> |
|||
<target depends="init" name="-init-run-macros"> |
|||
<macrodef name="run-appclient" uri="http://www.netbeans.org/ns/j2ee-earproject/2"> |
|||
<attribute name="subprojectname"/> |
|||
<attribute default="${application.args.param}" name="args"/> |
|||
<element name="customize" optional="true"/> |
|||
<sequential> |
|||
<java dir="${basedir}" fork="true" jar="${client.jar}"> |
|||
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/> |
|||
<jvmarg line="${j2ee.appclient.tool.jvmoptions}${client.jar},arg=-name,arg=@{subprojectname}"/> |
|||
<jvmarg line="${j2ee.appclient.jvmoptions.param}"/> |
|||
<arg line="@{args}"/> |
|||
<syspropertyset> |
|||
<propertyref prefix="run-sys-prop."/> |
|||
<mapper from="run-sys-prop.*" to="*" type="glob"/> |
|||
</syspropertyset> |
|||
<customize/> |
|||
</java> |
|||
</sequential> |
|||
</macrodef> |
|||
<macrodef name="run-appclient-pregfv3" uri="http://www.netbeans.org/ns/j2ee-earproject/2"> |
|||
<element name="customize" optional="true"/> |
|||
<sequential> |
|||
<java classname="${j2ee.appclient.tool.mainclass}" fork="true"> |
|||
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/> |
|||
<jvmarg line="${j2ee.appclient.tool.jvmoptions}"/> |
|||
<jvmarg line="${j2ee.appclient.jvmoptions.param}"/> |
|||
<arg line="${j2ee.appclient.tool.args}"/> |
|||
<arg line="-client ${client.jar}"/> |
|||
<arg line="${j2ee.appclient.mainclass.tool.param}"/> |
|||
<arg line="${application.args.param}"/> |
|||
<classpath> |
|||
<path path="${j2ee.platform.classpath}:${j2ee.appclient.tool.runtime}"/> |
|||
</classpath> |
|||
<syspropertyset> |
|||
<propertyref prefix="run-sys-prop."/> |
|||
<mapper from="run-sys-prop.*" to="*" type="glob"/> |
|||
</syspropertyset> |
|||
<customize/> |
|||
</java> |
|||
</sequential> |
|||
</macrodef> |
|||
</target> |
|||
<!-- |
|||
DEBUGGING SECTION |
|||
--> |
|||
<target depends="run-debug,run-debug-appclient" description="Deploy to server." name="debug"/> |
|||
<target depends="dist" description="Debug project in IDE." if="netbeans.home" name="run-debug" unless="app.client"> |
|||
<nbdeploy clientModuleUri="${client.module.uri}" clientUrlPart="${client.urlPart}" debugmode="true"/> |
|||
<antcall target="connect-debugger"/> |
|||
<antcall target="debug-display-browser-old"/> |
|||
<antcall target="debug-display-browser"/> |
|||
</target> |
|||
<target name="connect-debugger" unless="is.debugged"> |
|||
<condition property="listeningcp" value="sourcepath"> |
|||
<istrue value="${j2ee.compile.on.save}"/> |
|||
</condition> |
|||
<nbjpdaconnect address="${jpda.address}" host="${jpda.host}" listeningcp="${listeningcp}" name="${jpda.host}:${jpda.address}" transport="${jpda.transport}"> |
|||
<classpath> |
|||
<path path="${debug.classpath}"/> |
|||
<fileset dir="${build.dir}" includes="lib/*.jar"/> |
|||
</classpath> |
|||
<sourcepath> |
|||
<path path="${ear.docbase.dirs}"/> |
|||
</sourcepath> |
|||
</nbjpdaconnect> |
|||
</target> |
|||
<target if="do.display.browser.old" name="debug-display-browser-old"> |
|||
<nbbrowse url="${client.url}"/> |
|||
</target> |
|||
<target if="do.display.browser" name="debug-display-browser"> |
|||
<nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/> |
|||
</target> |
|||
<target if="can.debug.appclient" name="run-debug-appclient"> |
|||
<antcall target="-run-debug-appclient"/> |
|||
</target> |
|||
<target depends="init,-init-debug-args,-debug-appclient-deploy,-as-retrieve-option-workaround,-init-debug-macros,-debug-appclient-start-nbjpda,-debug-appclient-pregfv3,-debug-appclient,connect-debugger" name="-run-debug-appclient"/> |
|||
<target name="-init-debug-args"/> |
|||
<target depends="init,-init-debug-args,-as-retrieve-option-workaround,-init-run-macros" name="-init-debug-macros"> |
|||
<condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem"> |
|||
<os family="windows"/> |
|||
</condition> |
|||
<condition else="${debug-transport-by-os}" property="debug-transport-appclient" value="${debug.transport}"> |
|||
<isset property="debug.transport"/> |
|||
</condition> |
|||
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2ee-earproject/2"> |
|||
<attribute default="${main.class}" name="name"/> |
|||
<attribute default="${debug.classpath}" name="classpath"/> |
|||
<attribute default="" name="stopclassname"/> |
|||
<sequential> |
|||
<nbjpdastart addressproperty="jpda.address.appclient" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport-appclient}"> |
|||
<classpath> |
|||
<path path="@{classpath}"/> |
|||
</classpath> |
|||
</nbjpdastart> |
|||
</sequential> |
|||
</macrodef> |
|||
<macrodef name="debug-appclient" uri="http://www.netbeans.org/ns/j2ee-earproject/2"> |
|||
<attribute name="subprojectname"/> |
|||
<sequential> |
|||
<ear2:run-appclient subprojectname="@{subprojectname}"> |
|||
<customize> |
|||
<jvmarg value="-agentlib:jdwp=transport=${debug-transport-appclient},address=${jpda.address.appclient}"/> |
|||
</customize> |
|||
</ear2:run-appclient> |
|||
</sequential> |
|||
</macrodef> |
|||
<macrodef name="debug-appclient-pregfv3" uri="http://www.netbeans.org/ns/j2ee-earproject/2"> |
|||
<sequential> |
|||
<ear2:run-appclient-pregfv3> |
|||
<customize> |
|||
<jvmarg value="-agentlib:jdwp=transport=${debug-transport-appclient},address=${jpda.address.appclient}"/> |
|||
</customize> |
|||
</ear2:run-appclient-pregfv3> |
|||
</sequential> |
|||
</macrodef> |
|||
</target> |
|||
<target name="-debug-appclient-deploy"> |
|||
<nbstartserver debugmode="true"/> |
|||
<nbdeploy clientModuleUri="${client.module.uri}" clientUrlPart="${client.urlPart}" debugmode="true"/> |
|||
</target> |
|||
<target name="-debug-appclient-start-nbjpda"> |
|||
<ear2:nbjpdastart classpath="" name="${app.client}"/> |
|||
</target> |
|||
<target if="j2ee.appclient.tool.args" name="-debug-appclient-pregfv3"> |
|||
<ear2:debug-appclient-pregfv3/> |
|||
</target> |
|||
<target name="-debug-appclient" unless="j2ee.appclient.tool.args"> |
|||
<ear2:debug-appclient subprojectname="${app.client}"/> |
|||
</target> |
|||
<!-- |
|||
================= |
|||
PROFILING SECTION |
|||
================= |
|||
--> |
|||
<!-- |
|||
pre NB7.2 profiling section; consider it deprecated |
|||
--> |
|||
<target description="Profile a J2EE project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72"> |
|||
<condition else="start-profiled-server" property="profiler.startserver.target" value="start-profiled-server-extraargs"> |
|||
<isset property="profiler.info.jvmargs.extra"/> |
|||
</condition> |
|||
<antcall target="${profiler.startserver.target}"/> |
|||
<antcall target="run"/> |
|||
<antcall target="-profile-start-loadgen"/> |
|||
</target> |
|||
<target name="start-profiled-server"> |
|||
<nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}"> |
|||
<jvmarg value="${profiler.info.jvmargs.agent}"/> |
|||
<jvmarg value="${profiler.j2ee.agentID}"/> |
|||
</nbstartprofiledserver> |
|||
</target> |
|||
<target name="start-profiled-server-extraargs"> |
|||
<nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}"> |
|||
<jvmarg value="${profiler.info.jvmargs.extra}"/> |
|||
<jvmarg value="${profiler.info.jvmargs.agent}"/> |
|||
<jvmarg value="${profiler.j2ee.agentID}"/> |
|||
</nbstartprofiledserver> |
|||
</target> |
|||
<!-- |
|||
end of pre NB7.2 profiling section |
|||
--> |
|||
<target if="netbeans.home" name="-profile-check"> |
|||
<condition property="profiler.configured"> |
|||
<or> |
|||
<contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/> |
|||
<contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/> |
|||
</or> |
|||
</condition> |
|||
</target> |
|||
<target depends="dist" name="-do-profile"> |
|||
<startprofiler/> |
|||
<nbstartserver profilemode="true"/> |
|||
<nbdeploy clientUrlPart="${client.urlPart}" forceRedeploy="true" profilemode="true"/> |
|||
<antcall target="-profile-start-loadgen"/> |
|||
</target> |
|||
<target depends="-profile-check,-profile-pre72" description="Profile a J2EE project in the IDE." if="profiler.configured" name="profile"> |
|||
<antcall target="-do-profile"/> |
|||
</target> |
|||
<target if="profiler.loadgen.path" name="-profile-start-loadgen"> |
|||
<loadgenstart path="${profiler.loadgen.path}"/> |
|||
</target> |
|||
<!-- |
|||
CLEANUP SECTION |
|||
--> |
|||
<target depends="init" name="deps-clean" unless="no.deps"> |
|||
<condition property="build.deploy.on.save" value="false"> |
|||
<not> |
|||
<isset property="build.deploy.on.save"/> |
|||
</not> |
|||
</condition> |
|||
<ant antfile="${project.si-ejb}/build.xml" inheritall="false" target="clean-ear"> |
|||
<property location="${build.dir}" name="dist.ear.dir"/> |
|||
<property name="deploy.on.save" value="${build.deploy.on.save}"/> |
|||
</ant> |
|||
<ant antfile="${project.si-war}/build.xml" inheritall="false" target="clean-ear"> |
|||
<property location="${build.dir}" name="dist.ear.dir"/> |
|||
<property name="deploy.on.save" value="${build.deploy.on.save}"/> |
|||
</ant> |
|||
</target> |
|||
<target depends="init" name="do-clean"> |
|||
<delete dir="${build.dir}"/> |
|||
<delete dir="${dist.dir}"/> |
|||
<delete dir="${build.dir}"/> |
|||
</target> |
|||
<target depends="init" if="netbeans.home" name="undeploy-clean"> |
|||
<nbundeploy failOnError="false" startServer="false"/> |
|||
</target> |
|||
<target name="post-clean"> |
|||
<!-- Empty placeholder for easier customization. --> |
|||
<!-- You can override this target in the ../build.xml file. --> |
|||
</target> |
|||
<target depends="init,undeploy-clean,deps-clean,do-clean,post-clean" description="Clean build products." name="clean"/> |
|||
</project> |
@ -0,0 +1,8 @@ |
|||
build.xml.data.CRC32=34f09548 |
|||
build.xml.script.CRC32=33d89256 |
|||
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=34f09548 |
|||
nbproject/build-impl.xml.script.CRC32=fc2c4efb |
|||
nbproject/build-impl.xml.stylesheet.CRC32=abdce74a@1.73 |
@ -0,0 +1,40 @@ |
|||
build.classes.excludes=**/*.java,**/*.form,**/.nbattrs |
|||
build.dir=build |
|||
build.generated.dir=${build.dir}/generated |
|||
client.module.uri=si-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.si-war.dist-ear}:\ |
|||
${reference.si-ejb.dist-ear} |
|||
jar.name=si.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.si-ejb=si-ejb |
|||
project.si-war=si-war |
|||
reference.si-ejb.dist-ear=${project.si-ejb}/dist/si-ejb.jar |
|||
reference.si-war.dist-ear=${project.si-war}/dist/si-war.war |
|||
resource.dir=setup |
|||
source.root=. |
@ -0,0 +1,39 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://www.netbeans.org/ns/project/1"> |
|||
<type>org.netbeans.modules.j2ee.earproject</type> |
|||
<configuration> |
|||
<data xmlns="http://www.netbeans.org/ns/j2ee-earproject/2"> |
|||
<name>si</name> |
|||
<minimum-ant-version>1.6.5</minimum-ant-version> |
|||
<web-module-libraries/> |
|||
<web-module-additional-libraries> |
|||
<library> |
|||
<file>${reference.si-war.dist-ear}</file> |
|||
<path-in-war>/</path-in-war> |
|||
</library> |
|||
<library> |
|||
<file>${reference.si-ejb.dist-ear}</file> |
|||
<path-in-war>/</path-in-war> |
|||
</library> |
|||
</web-module-additional-libraries> |
|||
</data> |
|||
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1"> |
|||
<reference> |
|||
<foreign-project>si-ejb</foreign-project> |
|||
<artifact-type>j2ee_ear_archive</artifact-type> |
|||
<script>build.xml</script> |
|||
<target>dist-ear</target> |
|||
<clean-target>clean-ear</clean-target> |
|||
<id>dist-ear</id> |
|||
</reference> |
|||
<reference> |
|||
<foreign-project>si-war</foreign-project> |
|||
<artifact-type>j2ee_ear_archive</artifact-type> |
|||
<script>build.xml</script> |
|||
<target>dist-ear</target> |
|||
<clean-target>clean-ear</clean-target> |
|||
<id>dist-ear</id> |
|||
</reference> |
|||
</references> |
|||
</configuration> |
|||
</project> |
Binary file not shown.
@ -0,0 +1,68 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- You may freely edit this file. See commented blocks below for --> |
|||
<!-- some examples of how to customize the build. --> |
|||
<!-- (If you delete it and reopen the project it will be recreated.) --> |
|||
<!-- By default, only the Clean and Build commands use this build script. --> |
|||
<!-- Commands such as Run, Debug, and Test only use this build script if --> |
|||
<!-- the Compile on Save feature is turned off for the project. --> |
|||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> |
|||
<!-- in the project's Project Properties dialog box.--> |
|||
<project name="si-ejb" default="default" basedir="." xmlns:ejbjarproject="http://www.netbeans.org/ns/j2ee-ejbjarproject/3"> |
|||
<description>Builds, tests, and runs the project si-ejb.</description> |
|||
<import file="nbproject/build-impl.xml"/> |
|||
<!-- |
|||
|
|||
There exist several targets which are by default empty and which can be |
|||
used for execution of your tasks. These targets are usually executed |
|||
before and after some main targets. They are: |
|||
|
|||
-pre-init: called before initialization of project properties |
|||
-post-init: called after initialization of project properties |
|||
-pre-compile: called before javac compilation |
|||
-post-compile: called after javac compilation |
|||
-pre-compile-single: called before javac compilation of single file |
|||
-post-compile-single: called after javac compilation of single file |
|||
-pre-dist: called before archive building |
|||
-post-dist: called after archive building |
|||
-post-clean: called after cleaning build products |
|||
-pre-run-deploy: called before deploying |
|||
-post-run-deploy: called after deploying |
|||
|
|||
(Targets beginning with '-' are not intended to be called on their own.) |
|||
|
|||
Example of pluging an obfuscator after the compilation could look like |
|||
|
|||
<target name="-post-compile"> |
|||
<obfuscate> |
|||
<fileset dir="${build.classes.dir}"/> |
|||
</obfuscate> |
|||
</target> |
|||
|
|||
For list of available properties check the imported |
|||
nbproject/build-impl.xml file. |
|||
|
|||
|
|||
Other way how to customize the build is by overriding existing main targets. |
|||
The target of interest are: |
|||
|
|||
init-macrodef-javac: defines macro for javac compilation |
|||
init-macrodef-debug: defines macro for class debugging |
|||
do-dist: archive building |
|||
run: execution of project |
|||
javadoc-build: javadoc generation |
|||
|
|||
Example of overriding the target for project execution could look like |
|||
|
|||
<target name="run" depends="<PROJNAME>-impl.jar"> |
|||
<exec dir="bin" executable="launcher.exe"> |
|||
<arg file="${dist.jar}"/> |
|||
</exec> |
|||
</target> |
|||
|
|||
Notice that overridden target depends on jar target and not only on |
|||
compile target as regular run target does. Again, for list of available |
|||
properties which you can use check the target you are overriding in |
|||
nbproject/build-impl.xml file. |
|||
|
|||
--> |
|||
</project> |
@ -0,0 +1,131 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- |
|||
|
|||
Licensed to the Apache Software Foundation (ASF) under one |
|||
or more contributor license agreements. See the NOTICE file |
|||
distributed with this work for additional information |
|||
regarding copyright ownership. The ASF licenses this file |
|||
to you under the Apache License, Version 2.0 (the |
|||
"License"); you may not use this file except in compliance |
|||
with the License. You may obtain a copy of the License at |
|||
|
|||
http://www.apache.org/licenses/LICENSE-2.0 |
|||
|
|||
Unless required by applicable law or agreed to in writing, |
|||
software distributed under the License is distributed on an |
|||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|||
KIND, either express or implied. See the License for the |
|||
specific language governing permissions and limitations |
|||
under the License. |
|||
|
|||
--> |
|||
<project default="-deploy-ant" basedir="."> |
|||
<target name="-init-cl-deployment-env" if="deploy.ant.enabled"> |
|||
<property file="${deploy.ant.properties.file}" /> |
|||
<available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/> |
|||
<available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/> |
|||
<available file="${deploy.ant.resource.dir}" property="has.setup"/> |
|||
<tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/> |
|||
</target> |
|||
|
|||
<target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present"> |
|||
<tempfile prefix="gfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/> |
|||
<copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/> |
|||
<!-- The doctype triggers resolution which can fail --> |
|||
<replace file="${temp.sun.web}"> |
|||
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken> |
|||
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue> |
|||
</replace> |
|||
<replace file="${temp.sun.web}"> |
|||
<replacetoken><![CDATA[<sun-web-app]]></replacetoken> |
|||
<replacevalue><![CDATA[--> <sun-web-app]]></replacevalue> |
|||
</replace> |
|||
<xmlproperty file="${temp.sun.web}" validate="false"> |
|||
</xmlproperty> |
|||
<delete file="${temp.sun.web}"/> |
|||
<condition property="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}" else="${gfv3.url}/${ant.project.name}"> |
|||
<isset property="sun-web-app.context-root"/> |
|||
</condition> |
|||
<condition property="deploy.context.root.argument" value="&contextroot=${sun-web-app.context-root}" else="/${ant.project.name}"> |
|||
<isset property="sun-web-app.context-root"/> |
|||
</condition> |
|||
</target> |
|||
<target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present"> |
|||
<tempfile prefix="gfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/> |
|||
<copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/> |
|||
<!-- The doctype triggers resolution which can fail --> |
|||
<replace file="${temp.gf.web}"> |
|||
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken> |
|||
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue> |
|||
</replace> |
|||
<replace file="${temp.gf.web}"> |
|||
<replacetoken><![CDATA[<glassfish-web-app]]></replacetoken> |
|||
<replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue> |
|||
</replace> |
|||
<xmlproperty file="${temp.gf.web}" validate="false"> |
|||
</xmlproperty> |
|||
<delete file="${temp.gf.web}"/> |
|||
<condition property="deploy.ant.client.url" value="${gfv3.url}${glassfish-web-app.context-root}" else="${gfv3.url}/${ant.project.name}"> |
|||
<isset property="glassfish-web-app.context-root"/> |
|||
</condition> |
|||
<condition property="deploy.context.root.argument" value="&contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}"> |
|||
<isset property="glassfish-web-app.context-root"/> |
|||
</condition> |
|||
</target> |
|||
<target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present"> |
|||
<property name="deploy.context.root.argument" value=""/> |
|||
</target> |
|||
<target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup"> |
|||
<tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/> |
|||
<mkdir dir="${gfv3.resources.dir}"/> |
|||
<mkdir dir="${gfv3.resources.dir}/META-INF"/> |
|||
<copy todir="${gfv3.resources.dir}/META-INF"> |
|||
<fileset dir="${deploy.ant.resource.dir}"/> |
|||
</copy> |
|||
<jar destfile="${deploy.ant.archive}" update="true"> |
|||
<fileset dir="${gfv3.resources.dir}"/> |
|||
</jar> |
|||
<delete dir="${gfv3.resources.dir}"/> |
|||
</target> |
|||
<target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled"> |
|||
<antcall target="-deploy-without-pw"/> |
|||
<antcall target="-deploy-with-pw"/> |
|||
</target> |
|||
|
|||
<target name="-deploy-without-pw" unless="gfv3.password"> |
|||
<echo message="Deploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> |
|||
<get src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-deploy-with-pw" if="gfv3.password"> |
|||
<echo message="Deploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> |
|||
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled"> |
|||
<antcall target="-undeploy-without-pw"/> |
|||
<antcall target="-undeploy-with-pw"/> |
|||
</target> |
|||
|
|||
<target name="-undeploy-without-pw" unless="gfv3.password"> |
|||
<echo message="Undeploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<get src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-undeploy-with-pw" if="gfv3.password"> |
|||
<echo message="Undeploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
</project> |
File diff suppressed because it is too large
@ -0,0 +1,8 @@ |
|||
build.xml.data.CRC32=a1d126bb |
|||
build.xml.script.CRC32=6d214eeb |
|||
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=a1d126bb |
|||
nbproject/build-impl.xml.script.CRC32=639812f4 |
|||
nbproject/build-impl.xml.stylesheet.CRC32=62693482@1.75 |
@ -0,0 +1,76 @@ |
|||
annotation.processing.enabled=true |
|||
annotation.processing.enabled.in.editor=true |
|||
annotation.processing.processor.options=-Aeclipselink.canonicalmodel.use_static_factory=false |
|||
annotation.processing.processors.list= |
|||
annotation.processing.run.all.processors=true |
|||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output |
|||
build.classes.dir=${build.dir}/classes |
|||
build.classes.excludes=**/*.java,**/*.form,**/.nbattrs |
|||
build.dir=build |
|||
build.ear.classes.dir=${build.dir}/classes |
|||
build.generated.dir=${build.dir}/generated |
|||
build.generated.sources.dir=${build.dir}/generated-sources |
|||
build.test.classes.dir=${build.dir}/test/classes |
|||
build.test.results.dir=${build.dir}/test/results |
|||
debug.classpath=${javac.classpath}:${build.classes.dir} |
|||
debug.test.classpath=\ |
|||
${run.test.classpath} |
|||
dist.dir=dist |
|||
dist.ear.jar=${dist.dir}/${jar.name} |
|||
dist.jar=${dist.dir}/${jar.name} |
|||
dist.javadoc.dir=${dist.dir}/javadoc |
|||
endorsed.classpath=\ |
|||
${libs.javaee-endorsed-api-7.0.classpath} |
|||
excludes= |
|||
includes=** |
|||
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.name=si-ejb.jar |
|||
jars.in.ejbjar=false |
|||
javac.classpath= |
|||
javac.debug=true |
|||
javac.deprecation=false |
|||
javac.processorpath=\ |
|||
${javac.classpath}:\ |
|||
${libs.EclipseLink-GlassFish-v3.classpath} |
|||
javac.source=1.7 |
|||
javac.target=1.7 |
|||
javac.test.classpath=\ |
|||
${javac.classpath}:\ |
|||
${build.classes.dir} |
|||
javac.test.processorpath=${javac.test.classpath} |
|||
javadoc.additionalparam= |
|||
javadoc.author=false |
|||
javadoc.encoding=${source.encoding} |
|||
javadoc.noindex=false |
|||
javadoc.nonavbar=false |
|||
javadoc.notree=false |
|||
javadoc.preview=true |
|||
javadoc.private=false |
|||
javadoc.splitindex=true |
|||
javadoc.use=true |
|||
javadoc.version=false |
|||
javadoc.windowtitle= |
|||
meta.inf=${source.root}/conf |
|||
meta.inf.excludes=sun-cmp-mappings.xml |
|||
platform.active=JDK_21 |
|||
resource.dir=setup |
|||
run.test.classpath=\ |
|||
${javac.test.classpath}:\ |
|||
${build.test.classes.dir} |
|||
# Space-separated list of JVM arguments used when running a class with a main method or a unit test |
|||
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): |
|||
runmain.jvmargs= |
|||
source.encoding=UTF-8 |
|||
source.root=src |
|||
src.dir=${source.root}/java |
|||
test.src.dir=test |
@ -0,0 +1,17 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://www.netbeans.org/ns/project/1"> |
|||
<type>org.netbeans.modules.j2ee.ejbjarproject</type> |
|||
<configuration> |
|||
<data xmlns="http://www.netbeans.org/ns/j2ee-ejbjarproject/3"> |
|||
<name>si-ejb</name> |
|||
<minimum-ant-version>1.6.5</minimum-ant-version> |
|||
<explicit-platform explicit-source-supported="true"/> |
|||
<source-roots> |
|||
<root id="src.dir"/> |
|||
</source-roots> |
|||
<test-roots> |
|||
<root id="test.src.dir"/> |
|||
</test-roots> |
|||
</data> |
|||
</configuration> |
|||
</project> |
@ -0,0 +1,2 @@ |
|||
Manifest-Version: 1.0 |
|||
|
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd"> |
|||
<resources> |
|||
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="mysql_sistemadeinventario_rootPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false"> |
|||
<property name="serverName" value="localhost"/> |
|||
<property name="portNumber" value="3306"/> |
|||
<property name="databaseName" value="sistemadeinventario"/> |
|||
<property name="User" value="root"/> |
|||
<property name="Password" value="Solano.20"/> |
|||
<property name="URL" value="jdbc:mysql://localhost:3306/sistemadeinventario"/> |
|||
<property name="driverClass" value="org.gjt.mm.mysql.Driver"/> |
|||
</jdbc-connection-pool> |
|||
<jdbc-resource enabled="true" jndi-name="java:module/inventariosc" object-type="user" pool-name="mysql_sistemadeinventario_rootPool"/> |
|||
</resources> |
@ -0,0 +1,8 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> |
|||
<persistence-unit name="si-ejbPU" transaction-type="JTA"> |
|||
<jta-data-source>jdbc/sistemadeinventario</jta-data-source> |
|||
<exclude-unlisted-classes>false</exclude-unlisted-classes> |
|||
<properties/> |
|||
</persistence-unit> |
|||
</persistence> |
@ -0,0 +1,110 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
import hola.dao.DepartamentoDAO; |
|||
import hola.modelo.Departamento; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.ejb.Stateless; |
|||
|
|||
/** |
|||
* |
|||
* @author eduar |
|||
*/ |
|||
@Stateless |
|||
public class DepartamentoBL implements DepartamentoBLLocal { |
|||
|
|||
public Mensaje agregar(Departamento departamento) { |
|||
System.out.println("Llegaste al metodo de agregar Departamento"); |
|||
DepartamentoDAO departamentoDAO = new DepartamentoDAO(); |
|||
Mensaje m = null; |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (departamento.getNombre().isEmpty() |
|||
|
|||
|| departamento.getAnaquel().isEmpty()) { |
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
return Mensaje.CAMPOS_INCOMPLETOS; |
|||
} |
|||
|
|||
// Buscar si el proveedor ya existe en la base de datos
|
|||
Optional<Departamento> departamentoEncontradoOptional = departamentoDAO.buscarDepartamento(departamento); |
|||
|
|||
if (departamentoEncontradoOptional.isPresent()) { |
|||
// Manejar el caso en el que se encontró al menos un proveedor duplicado
|
|||
departamentoEncontradoOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
} else { |
|||
// Agregar el proveedor a la base de datos si no está duplicado
|
|||
departamentoDAO.agregar(departamento); |
|||
//registroDAO.agregar(registro);
|
|||
m = Mensaje.SIN_ERROR; |
|||
} |
|||
|
|||
return m; |
|||
} |
|||
|
|||
@Override |
|||
public Departamento buscarId(Departamento departamento) { |
|||
// Comentario de lógica: Método para buscar un proveedor por ID
|
|||
DepartamentoDAO d = new DepartamentoDAO(); |
|||
return d.buscarPorId(departamento); |
|||
} |
|||
|
|||
@Override |
|||
public void eliminarId(Departamento departamento) { |
|||
// Comentario de lógica: Método para eliminar un proveedor por ID
|
|||
DepartamentoDAO d = new DepartamentoDAO(); |
|||
if (d.eliminar(departamento)) { |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
} else { |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void editar(Departamento departamento) { |
|||
// Comentario de lógica: Método para editar un proveedor
|
|||
|
|||
DepartamentoDAO departamentoDAO = new DepartamentoDAO(); |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (departamento.getNombre().isEmpty() |
|||
|| departamento.getNombre().isEmpty() |
|||
|| departamento.getAnaquel().isEmpty() |
|||
|| departamento.getStatus() == null) { |
|||
|
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
return; |
|||
} |
|||
|
|||
try { |
|||
// Editar el proveedor solo si todas las validaciones son exitosas
|
|||
if (departamentoDAO.editar(departamento) == true) { |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
} else { |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
} |
|||
} catch (Exception e) { |
|||
// Capturar cualquier excepción que ocurra durante la edición del proveedor
|
|||
System.out.println(Mensaje.DATOS_INCORRECTOS); |
|||
e.printStackTrace(); |
|||
} |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public List<Departamento> buscarValidos(boolean estado) { |
|||
DepartamentoDAO departamentoDAO = new DepartamentoDAO(); |
|||
List l = departamentoDAO.buscarValidosD(estado); |
|||
// Llama al método buscarValidos de ProductoDAO y devuelve la lista resultante
|
|||
System.out.println(l); |
|||
return l; |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
import hola.modelo.Departamento; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
|
|||
/** |
|||
* |
|||
* @author eduar |
|||
*/ |
|||
@Local |
|||
public interface DepartamentoBLLocal { |
|||
|
|||
Mensaje agregar(Departamento departamento); |
|||
|
|||
Departamento buscarId(Departamento departamento); |
|||
|
|||
List<Departamento> buscarValidos(boolean estado); |
|||
|
|||
void eliminarId(Departamento departamento); |
|||
|
|||
void editar(Departamento departamento); |
|||
} |
@ -0,0 +1,133 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
import hola.dao.EstadoDAO; |
|||
import hola.modelo.Estado; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.ejb.Stateless; |
|||
import javax.faces.application.FacesMessage; |
|||
import javax.faces.context.FacesContext; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Stateless |
|||
public class EstadoBL implements EstadoBLLocal { |
|||
|
|||
// Add business logic below. (Right-click in editor and choose
|
|||
// "Insert Code > Add Business Method")
|
|||
@Override |
|||
public Mensaje agregar(Estado estado) { |
|||
// Comentario de lógica: Método para agregar un proveedor
|
|||
//, Registro registro//
|
|||
System.out.println("Llegaste al metodo de agregar Usuario"); |
|||
EstadoDAO estadoDAO = new EstadoDAO(); |
|||
Mensaje m = null; |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (estado.getNombre().isEmpty()) { |
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
return Mensaje.CAMPOS_INCOMPLETOS; |
|||
} |
|||
|
|||
// Buscar si el proveedor ya existe en la base de datos
|
|||
Optional<Estado> usuarioEncontradoOptional = estadoDAO.buscarEstado(estado); |
|||
|
|||
if (usuarioEncontradoOptional.isPresent()) { |
|||
// Manejar el caso en el que se encontró al menos un proveedor duplicado
|
|||
usuarioEncontradoOptional.get(); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "Error", "Elemento duplicado"); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
} else { |
|||
// Agregar el proveedor a la base de datos si no está duplicado
|
|||
estadoDAO.agregar(estado); |
|||
//registroDAO.agregar(registro);
|
|||
m = Mensaje.SIN_ERROR; |
|||
} |
|||
|
|||
return m; |
|||
} |
|||
|
|||
@Override |
|||
public Estado buscarId(Estado estado) { |
|||
// Comentario de lógica: Método para buscar un proveedor por ID
|
|||
EstadoDAO edao = new EstadoDAO(); |
|||
return edao.buscarPorId(estado); |
|||
} |
|||
|
|||
@Override |
|||
public void eliminarId(Estado estado) { |
|||
// Comentario de lógica: Método para eliminar un proveedor por ID
|
|||
EstadoDAO edao = new EstadoDAO(); |
|||
if (edao.eliminar(estado)) { |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
} else { |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Mensaje editar(Estado estado) { |
|||
// Comentario de lógica: Método para editar un proveedor
|
|||
Mensaje m; |
|||
EstadoDAO estadoDAO = new EstadoDAO(); |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (estado.getNombre().isEmpty() |
|||
|| estado.getStatus() == null) { |
|||
|
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
m = Mensaje.CAMPOS_INCOMPLETOS; |
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
return m; |
|||
} |
|||
|
|||
try { |
|||
// Editar el proveedor solo si todas las validaciones son exitosas
|
|||
Optional<Estado> user = estadoDAO.buscarEstado(estado); |
|||
if (user.isPresent()) { |
|||
|
|||
addMessage(FacesMessage.SEVERITY_ERROR, "Error", "Elemento duplicado"); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
} else { |
|||
|
|||
if (estadoDAO.editar(estado) == true) { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
return m; |
|||
} else { |
|||
m = Mensaje.N0_EXISTE; |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
return m; |
|||
} |
|||
} |
|||
} catch (Exception e) { |
|||
// Capturar cualquier excepción que ocurra durante la edición del proveedor
|
|||
m = Mensaje.DATOS_INCORRECTOS; |
|||
System.out.println(Mensaje.DATOS_INCORRECTOS); |
|||
e.printStackTrace(); |
|||
} |
|||
return m; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public List<Estado> buscarValidos(boolean estado) { |
|||
EstadoDAO estadoDAO = new EstadoDAO(); |
|||
List l = estadoDAO.buscarValidos(estado); |
|||
// Llama al método buscarValidos de ProductoDAO y devuelve la lista resultante
|
|||
System.out.println(l); |
|||
return l; |
|||
} |
|||
|
|||
public void addMessage(FacesMessage.Severity severity, String summary, String detail) { |
|||
FacesContext.getCurrentInstance().addMessage("MensajeUsuario", new FacesMessage(severity, summary, detail)); |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
import hola.modelo.Estado; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Local |
|||
public interface EstadoBLLocal { |
|||
|
|||
public Mensaje agregar(Estado estado); |
|||
|
|||
public Estado buscarId(Estado estado); |
|||
|
|||
public void eliminarId(Estado estado); |
|||
|
|||
public Mensaje editar(Estado estado); |
|||
|
|||
public List<Estado> buscarValidos(boolean estado); |
|||
} |
@ -0,0 +1,104 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
import hola.dao.MarcaDAO; |
|||
import hola.modelo.Marca; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.ejb.Stateless; |
|||
|
|||
/** |
|||
* |
|||
* @author Josue |
|||
*/ |
|||
@Stateless |
|||
public class MarcaBL implements MarcaBLLocal { |
|||
|
|||
@Override |
|||
public Mensaje agregar(Marca marca) { |
|||
// Comentario de lógica: Método para agregar una marca
|
|||
System.out.println("Llegaste al método de agregar Marca"); |
|||
MarcaDAO marcaDAO = new MarcaDAO(); |
|||
Mensaje m = null; |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (marca.getNombre().isEmpty()) { |
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
return Mensaje.CAMPOS_INCOMPLETOS; |
|||
} |
|||
|
|||
// Buscar si la marca ya existe en la base de datos
|
|||
Optional<Marca> marcaEncontradaOptional = marcaDAO.buscarMarca(marca); |
|||
|
|||
if (marcaEncontradaOptional.isPresent()) { |
|||
// Manejar el caso en el que se encontró al menos una marca duplicada
|
|||
marcaEncontradaOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
System.out.println(m); |
|||
} else { |
|||
// Agregar la marca a la base de datos si no está duplicada
|
|||
marcaDAO.agregar(marca); |
|||
m = Mensaje.SIN_ERROR; |
|||
} |
|||
|
|||
return m; |
|||
} |
|||
|
|||
@Override |
|||
public Marca buscarId(Marca marca) { |
|||
// Comentario de lógica: Método para buscar una marca por ID
|
|||
MarcaDAO marcaDAO = new MarcaDAO(); |
|||
return marcaDAO.buscarPorId(marca); |
|||
} |
|||
|
|||
@Override |
|||
public void eliminarId(Marca marca) { |
|||
// Comentario de lógica: Método para eliminar una marca por ID
|
|||
MarcaDAO marcaDAO = new MarcaDAO(); |
|||
if (marcaDAO.eliminar(marca)) { |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
} else { |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void editar(Marca marca) { |
|||
// Comentario de lógica: Método para editar una marca
|
|||
MarcaDAO marcaDAO = new MarcaDAO(); |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (marca.getNombre().isEmpty() || marca.getStatus() == null) { |
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
return; |
|||
} |
|||
|
|||
try { |
|||
// Editar la marca solo si todas las validaciones son exitosas
|
|||
if (marcaDAO.editar(marca)) { |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
} else { |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
} |
|||
} catch (Exception e) { |
|||
// Capturar cualquier excepción que ocurra durante la edición de la marca
|
|||
System.out.println(Mensaje.DATOS_INCORRECTOS); |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public List<Marca> buscarValidos(boolean estado) { |
|||
MarcaDAO marcaDAO = new MarcaDAO(); |
|||
List<Marca> listaMarcas = marcaDAO.buscarValidos(estado); |
|||
// Llama al método buscarValidos de MarcaDAO y devuelve la lista resultante
|
|||
System.out.println(listaMarcas); |
|||
return listaMarcas; |
|||
} |
|||
} |
@ -0,0 +1,24 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
import hola.modelo.Marca; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
|
|||
/** |
|||
* |
|||
* @author Josue |
|||
*/ |
|||
@Local |
|||
public interface MarcaBLLocal { |
|||
public Mensaje agregar(Marca marca); |
|||
public Marca buscarId(Marca marca); |
|||
public void eliminarId(Marca marca); |
|||
public void editar(Marca marca); |
|||
public List<Marca> buscarValidos(boolean estado); |
|||
|
|||
} |
@ -0,0 +1,129 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
import hola.dao.PaisDAO; |
|||
import hola.modelo.Pais; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.ejb.Stateless; |
|||
import javax.faces.application.FacesMessage; |
|||
import javax.faces.context.FacesContext; |
|||
|
|||
/** |
|||
* |
|||
* @author eduar |
|||
*/ |
|||
@Stateless |
|||
public class PaisBL implements PaisLocal { |
|||
|
|||
@Override |
|||
public Mensaje agregar(Pais pais) { |
|||
// Comentario de lógica: Método para agregar una marca
|
|||
System.out.println("Llegaste al método de agregar Pais"); |
|||
PaisDAO pisDAO = new PaisDAO(); |
|||
Mensaje m = null; |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (pais.getNombre().isEmpty()) { |
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
return Mensaje.CAMPOS_INCOMPLETOS; |
|||
} |
|||
|
|||
// Buscar si la pais ya existe en la base de datos
|
|||
Optional<Pais> paisEncontradaOptional = pisDAO.buscarPais(pais); |
|||
|
|||
if (paisEncontradaOptional.isPresent()) { |
|||
// Manejar el caso en el que se encontró al menos un proveedor duplicado
|
|||
paisEncontradaOptional.get(); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "Error", "Elemento duplicado"); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
} else { |
|||
// Agregar el proveedor a la base de datos si no está duplicado
|
|||
pisDAO.agregar(pais); |
|||
//registroDAO.agregar(registro);
|
|||
m = Mensaje.SIN_ERROR; |
|||
} |
|||
return m; |
|||
} |
|||
|
|||
@Override |
|||
public Pais buscarId(Pais pais) { |
|||
// Comentario de lógica: Método para buscar una marca por ID
|
|||
PaisDAO paisDAO = new PaisDAO(); |
|||
return paisDAO.buscarPorId(pais); |
|||
} |
|||
|
|||
@Override |
|||
public void eliminarId(Pais pais) { |
|||
// Comentario de lógica: Método para eliminar una marca por ID
|
|||
PaisDAO paisDAO = new PaisDAO(); |
|||
if (paisDAO.eliminar(pais)) { |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
} else { |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Mensaje editar(Pais pais) { |
|||
// Comentario de lógica: Método para editar una marca
|
|||
Mensaje m; |
|||
PaisDAO paisDAO = new PaisDAO(); |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (pais.getNombre().isEmpty() |
|||
|| pais.getStatus() == null) { |
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
m = Mensaje.CAMPOS_INCOMPLETOS; |
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
return m; |
|||
} |
|||
|
|||
try { |
|||
// Editar el proveedor solo si todas las validaciones son exitosas
|
|||
Optional<Pais> user = paisDAO.buscarPais(pais); |
|||
if (user.isPresent()) { |
|||
|
|||
addMessage(FacesMessage.SEVERITY_ERROR, "Error", "Elemento duplicado"); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
} else { |
|||
|
|||
if (paisDAO.editar(pais) == true) { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
return m; |
|||
} else { |
|||
m = Mensaje.N0_EXISTE; |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
return m; |
|||
} |
|||
} |
|||
} catch (Exception e) { |
|||
// Capturar cualquier excepción que ocurra durante la edición del proveedor
|
|||
m = Mensaje.DATOS_INCORRECTOS; |
|||
System.out.println(Mensaje.DATOS_INCORRECTOS); |
|||
e.printStackTrace(); |
|||
} |
|||
return m; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public List<Pais> buscarValidos(boolean estado) { |
|||
PaisDAO paisDAO = new PaisDAO(); |
|||
List l = paisDAO.buscarValidos(estado); |
|||
// Llama al método buscarValidos de ProductoDAO y devuelve la lista resultante
|
|||
System.out.println(l); |
|||
return l; |
|||
} |
|||
|
|||
public void addMessage(FacesMessage.Severity severity, String summary, String detail) { |
|||
FacesContext.getCurrentInstance().addMessage("MensajePais", new FacesMessage(severity, summary, detail)); |
|||
} |
|||
|
|||
} |
@ -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 hola.BL; |
|||
|
|||
import hola.modelo.Pais; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
|
|||
|
|||
|
|||
/** |
|||
* |
|||
* @author eduar |
|||
*/ |
|||
@Local |
|||
public interface PaisLocal { |
|||
public Mensaje agregar(Pais pais); |
|||
public Pais buscarId(Pais pais); |
|||
public void eliminarId(Pais pais); |
|||
public Mensaje editar(Pais pais); |
|||
public List<Pais> buscarValidos(boolean pais); |
|||
|
|||
} |
@ -0,0 +1,118 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
|
|||
import hola.dao.ProductoDAO; |
|||
|
|||
import hola.modelo.Producto; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.ejb.Stateless; |
|||
|
|||
/** |
|||
* |
|||
* @author eduar |
|||
*/ |
|||
@Stateless |
|||
public class ProductoBL implements ProductoBLLocal { |
|||
@Override |
|||
public Mensaje agregar(Producto producto) { |
|||
System.out.println("Llegaste al metodo de agregar Producto"); |
|||
ProductoDAO productoDAO = new ProductoDAO(); |
|||
Mensaje m = null; |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (producto.getNombre().isEmpty() |
|||
|| producto.getCantidad().isEmpty() |
|||
|| producto.getPrecio()<=0 |
|||
|| producto.getCodigoBarras().isEmpty() |
|||
|| producto.getMedida()<=0 |
|||
|| producto.getLote().isEmpty()) |
|||
{ |
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
return Mensaje.CAMPOS_INCOMPLETOS; |
|||
} |
|||
|
|||
// Buscar si el proveedor ya existe en la base de datos
|
|||
Optional<Producto> productoEncontradoOptional = productoDAO.buscarProducto(producto); |
|||
|
|||
if (productoEncontradoOptional.isPresent()) { |
|||
// Manejar el caso en el que se encontró al menos un proveedor duplicado
|
|||
productoEncontradoOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
} else { |
|||
// Agregar el proveedor a la base de datos si no está duplicado
|
|||
productoDAO.agregar(producto); |
|||
//registroDAO.agregar(registro);
|
|||
m = Mensaje.SIN_ERROR; |
|||
} |
|||
|
|||
return m; |
|||
} |
|||
|
|||
@Override |
|||
public Producto buscarId(Producto producto) { |
|||
// Comentario de lógica: Método para buscar un proveedor por ID
|
|||
ProductoDAO d = new ProductoDAO(); |
|||
return d.buscarPorId(producto); |
|||
} |
|||
|
|||
@Override |
|||
public void eliminarId(Producto producto) { |
|||
// Comentario de lógica: Método para eliminar un proveedor por ID
|
|||
ProductoDAO d = new ProductoDAO(); |
|||
if (d.eliminar(producto)) { |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
} else { |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void editar(Producto producto) { |
|||
// Comentario de lógica: Método para editar un proveedor
|
|||
|
|||
ProductoDAO productoDAO = new ProductoDAO(); |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (producto.getNombre().isEmpty() |
|||
|| producto.getCantidad().isEmpty() |
|||
|| producto.getPrecio()<=0 |
|||
|| producto.getCodigoBarras().isEmpty() |
|||
|| producto.getMedida()<=0 |
|||
|| producto.getLote().isEmpty()){ |
|||
|
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
return; |
|||
} |
|||
|
|||
try { |
|||
// Editar el proveedor solo si todas las validaciones son exitosas
|
|||
if (productoDAO.editar(producto) == true) { |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
} else { |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
} |
|||
} catch (Exception e) { |
|||
// Capturar cualquier excepción que ocurra durante la edición del proveedor
|
|||
System.out.println(Mensaje.DATOS_INCORRECTOS); |
|||
e.printStackTrace(); |
|||
} |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public List<Producto> buscarValidos(boolean estado) { |
|||
ProductoDAO productoDAO = new ProductoDAO(); |
|||
List l = productoDAO.buscarValidosD(estado); |
|||
// Llama al método buscarValidos de ProductoDAO y devuelve la lista resultante
|
|||
System.out.println(l); |
|||
return l; |
|||
} |
|||
} |
@ -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 hola.BL; |
|||
|
|||
|
|||
import hola.modelo.Producto; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
|
|||
/** |
|||
* |
|||
* @author eduar |
|||
*/ |
|||
@Local |
|||
public interface ProductoBLLocal { |
|||
|
|||
Mensaje agregar(Producto producto); |
|||
|
|||
Producto buscarId(Producto producto); |
|||
|
|||
List<Producto> buscarValidos(boolean estado); |
|||
|
|||
void eliminarId(Producto producto); |
|||
|
|||
void editar(Producto producto); |
|||
} |
@ -0,0 +1,113 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
import hola.dao.ProvedorDAO; |
|||
import hola.modelo.Provedor; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.ejb.Stateless; |
|||
|
|||
/** |
|||
* |
|||
* @author Josue |
|||
*/ |
|||
@Stateless |
|||
public class ProvedorBL implements ProvedorBLLocal { |
|||
|
|||
@Override |
|||
public Mensaje agregar(Provedor provedor) { |
|||
// Comentario de lógica: Método para agregar un proveedor
|
|||
//, Registro registro//
|
|||
System.out.println("Llegaste al metodo de agregar Proveedor"); |
|||
ProvedorDAO provedorDAO = new ProvedorDAO(); |
|||
Mensaje m = null; |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (provedor.getNombre().isEmpty() |
|||
|| provedor.getDireccion().isEmpty() |
|||
|| provedor.getCorreo().isEmpty() |
|||
|| provedor.getTelefono().isEmpty()) { |
|||
|
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
return Mensaje.CAMPOS_INCOMPLETOS; |
|||
} |
|||
|
|||
// Buscar si el proveedor ya existe en la base de datos
|
|||
Optional<Provedor> provedorEncontradoOptional = provedorDAO.buscarProvedor(provedor); |
|||
|
|||
if (provedorEncontradoOptional.isPresent()) { |
|||
// Manejar el caso en el que se encontró al menos un proveedor duplicado
|
|||
provedorEncontradoOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
} else { |
|||
// Agregar el proveedor a la base de datos si no está duplicado
|
|||
provedorDAO.agregar(provedor); |
|||
//registroDAO.agregar(registro);
|
|||
m = Mensaje.SIN_ERROR; |
|||
} |
|||
|
|||
return m; |
|||
} |
|||
|
|||
@Override |
|||
public Provedor buscarId(Provedor provedor) { |
|||
// Comentario de lógica: Método para buscar un proveedor por ID
|
|||
ProvedorDAO p = new ProvedorDAO(); |
|||
return p.buscarPorId(provedor); |
|||
} |
|||
|
|||
@Override |
|||
public void eliminarId(Provedor provedor) { |
|||
// Comentario de lógica: Método para eliminar un proveedor por ID
|
|||
ProvedorDAO p = new ProvedorDAO(); |
|||
if (p.eliminar(provedor)) { |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
} else { |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void editar(Provedor provedor) { |
|||
// Comentario de lógica: Método para editar un proveedor
|
|||
|
|||
ProvedorDAO provedorDAO = new ProvedorDAO(); |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (provedor.getNombre().isEmpty() |
|||
|| provedor.getDireccion().isEmpty() |
|||
|| provedor.getCorreo().isEmpty() |
|||
|| provedor.getTelefono().isEmpty()) { |
|||
|
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
return; |
|||
} |
|||
|
|||
try { |
|||
// Editar el proveedor solo si todas las validaciones son exitosas
|
|||
if (provedorDAO.editar(provedor) == true) { |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
} else { |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
} |
|||
} catch (Exception e) { |
|||
// Capturar cualquier excepción que ocurra durante la edición del proveedor
|
|||
System.out.println(Mensaje.DATOS_INCORRECTOS); |
|||
e.printStackTrace(); |
|||
} |
|||
|
|||
} |
|||
@Override |
|||
public List<Provedor> buscarValidos(boolean estado) { |
|||
ProvedorDAO proovedorDAO = new ProvedorDAO(); |
|||
List l = proovedorDAO.buscarValidos(estado); |
|||
// Llama al método buscarValidos de ProductoDAO y devuelve la lista resultante
|
|||
System.out.println(l); |
|||
return l; |
|||
} |
|||
} |
@ -0,0 +1,24 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
import hola.modelo.Provedor; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
|
|||
/** |
|||
* |
|||
* @author Josue |
|||
*/ |
|||
@Local |
|||
public interface ProvedorBLLocal { |
|||
public Mensaje agregar(Provedor provedor); |
|||
public Provedor buscarId(Provedor provedor); |
|||
public void eliminarId(Provedor provedor); |
|||
public void editar(Provedor provedor); |
|||
public List<Provedor> buscarValidos(boolean estado); |
|||
|
|||
} |
@ -0,0 +1,141 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
import hola.dao.UsuarioDAO; |
|||
import hola.msg.Mensaje; |
|||
import javax.ejb.Stateless; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Stateless |
|||
public class RolBL implements RolBLLocal { |
|||
|
|||
// Add business logic below. (Right-click in editor and choose
|
|||
// "Insert Code > Add Business Method")
|
|||
@Override |
|||
public Mensaje agregar(Rol rol) { |
|||
// Comentario de lógica: Método para agregar un proveedor
|
|||
//, Registro registro//
|
|||
System.out.println("Llegaste al metodo de agregar Rol"); |
|||
RolDAO usuarioDAO = new R; |
|||
Mensaje m = null; |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (rol.getNombre().isEmpty() |
|||
|| rol.getSexo()== null |
|||
|| rol.getTelefono().isEmpty() |
|||
|| rol.getCorreo().isEmpty() |
|||
|| rol.getDireccion().isEmpty() |
|||
|| rol.getNpila().isEmpty() |
|||
|| rol.getUsername().isEmpty()) { |
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
return Mensaje.CAMPOS_INCOMPLETOS; |
|||
} |
|||
|
|||
// Buscar si el proveedor ya existe en la base de datos
|
|||
Optional<Usuario> usuarioEncontradoOptional = usuarioDAO.buscarUsuario(rol); |
|||
|
|||
if (usuarioEncontradoOptional.isPresent()) { |
|||
// Manejar el caso en el que se encontró al menos un proveedor duplicado
|
|||
usuarioEncontradoOptional.get(); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "Error", "Elemento duplicado"); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
} else { |
|||
// Agregar el proveedor a la base de datos si no está duplicado
|
|||
usuarioDAO.agregar(rol); |
|||
//registroDAO.agregar(registro);
|
|||
m = Mensaje.SIN_ERROR; |
|||
} |
|||
|
|||
return m; |
|||
} |
|||
|
|||
@Override |
|||
public Usuario buscarId(Usuario usuario) { |
|||
// Comentario de lógica: Método para buscar un proveedor por ID
|
|||
UsuarioDAO udao = new UsuarioDAO(); |
|||
return udao.buscarPorId(usuario); |
|||
} |
|||
|
|||
@Override |
|||
public void eliminarId(Usuario usuario) { |
|||
// Comentario de lógica: Método para eliminar un proveedor por ID
|
|||
UsuarioDAO udao = new UsuarioDAO(); |
|||
if (udao.eliminar(usuario)) { |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
} else { |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Mensaje editar(Usuario usuario) { |
|||
// Comentario de lógica: Método para editar un proveedor
|
|||
Mensaje m; |
|||
UsuarioDAO usuarioDAO = new UsuarioDAO(); |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (usuario.getNombre().isEmpty() |
|||
|| usuario.getSexo()== null |
|||
|| usuario.getNombre().isEmpty() |
|||
|| usuario.getTelefono().isEmpty() |
|||
|| usuario.getCorreo().isEmpty() |
|||
|| usuario.getDireccion().isEmpty() |
|||
|| usuario.getNpila().isEmpty() |
|||
|| usuario.getUsername().isEmpty() |
|||
|| usuario.getStatus() == null) { |
|||
|
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
m = Mensaje.CAMPOS_INCOMPLETOS; |
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
return m; |
|||
} |
|||
|
|||
try { |
|||
// Editar el proveedor solo si todas las validaciones son exitosas
|
|||
Optional<Usuario> user = usuarioDAO.buscarUsuario(usuario); |
|||
if (user.isPresent()) { |
|||
|
|||
addMessage(FacesMessage.SEVERITY_ERROR, "Error", "Elemento duplicado"); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
} else { |
|||
|
|||
if (usuarioDAO.editar(usuario) == true) { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
return m; |
|||
} else { |
|||
m = Mensaje.N0_EXISTE; |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
return m; |
|||
} |
|||
} |
|||
} catch (Exception e) { |
|||
// Capturar cualquier excepción que ocurra durante la edición del proveedor
|
|||
m = Mensaje.DATOS_INCORRECTOS; |
|||
System.out.println(Mensaje.DATOS_INCORRECTOS); |
|||
e.printStackTrace(); |
|||
} |
|||
return m; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public List<Usuario> buscarValidos(boolean estado) { |
|||
UsuarioDAO usuarioDAO = new UsuarioDAO(); |
|||
List l = usuarioDAO.buscarValidos(estado); |
|||
// Llama al método buscarValidos de ProductoDAO y devuelve la lista resultante
|
|||
System.out.println(l); |
|||
return l; |
|||
} |
|||
|
|||
public void addMessage(FacesMessage.Severity severity, String summary, String detail) { |
|||
FacesContext.getCurrentInstance().addMessage("MensajeUsuario", new FacesMessage(severity, summary, detail)); |
|||
} |
|||
} |
@ -0,0 +1,16 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
import javax.ejb.Local; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Local |
|||
public interface RolBLLocal { |
|||
|
|||
} |
@ -0,0 +1,112 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
import hola.dao.TipoDAO; |
|||
import hola.modelo.Tipo; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.ejb.Stateless; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Stateless |
|||
public class TipoBL implements TipoBLLocal { |
|||
|
|||
// Add business logic below. (Right-click in editor and choose
|
|||
// "Insert Code > Add Business Method")
|
|||
@Override |
|||
public Mensaje agregar(Tipo tipo) { |
|||
// Comentario de lógica: Método para agregar un proveedor
|
|||
//, Registro registro//
|
|||
System.out.println("Llegaste al metodo de agregar Tipo"); |
|||
TipoDAO tipoDAO = new TipoDAO(); |
|||
Mensaje m = null; |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (tipo.getNombre().isEmpty()) { |
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
return Mensaje.CAMPOS_INCOMPLETOS; |
|||
} |
|||
|
|||
// Buscar si el proveedor ya existe en la base de datos
|
|||
Optional<Tipo> tipoEncontradoOptional = tipoDAO.buscarTipo(tipo); |
|||
|
|||
if (tipoEncontradoOptional.isPresent()) { |
|||
// Manejar el caso en el que se encontró al menos un proveedor duplicado
|
|||
tipoEncontradoOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
} else { |
|||
// Agregar el proveedor a la base de datos si no está duplicado
|
|||
tipoDAO.agregar(tipo); |
|||
//registroDAO.agregar(registro);
|
|||
m = Mensaje.SIN_ERROR; |
|||
} |
|||
|
|||
return m; |
|||
} |
|||
|
|||
@Override |
|||
public Tipo buscarId(Tipo tipo) { |
|||
// Comentario de lógica: Método para buscar un proveedor por ID
|
|||
TipoDAO tdao = new TipoDAO(); |
|||
return tdao.buscarPorId(tipo); |
|||
} |
|||
|
|||
@Override |
|||
public void eliminarId(Tipo tipo) { |
|||
// Comentario de lógica: Método para eliminar un proveedor por ID
|
|||
TipoDAO tdao = new TipoDAO(); |
|||
if (tdao.eliminar(tipo)) { |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
} else { |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void editar(Tipo tipo) { |
|||
// Comentario de lógica: Método para editar un proveedor
|
|||
|
|||
TipoDAO tipoDAO = new TipoDAO(); |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (tipo.getNombre().isEmpty() |
|||
|| tipo.getNombre().isEmpty() |
|||
|| tipo.getStatus() == null) { |
|||
|
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
return; |
|||
} |
|||
|
|||
try { |
|||
// Editar el proveedor solo si todas las validaciones son exitosas
|
|||
if (tipoDAO.editar(tipo) == true) { |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
} else { |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
} |
|||
} catch (Exception e) { |
|||
// Capturar cualquier excepción que ocurra durante la edición del proveedor
|
|||
System.out.println(Mensaje.DATOS_INCORRECTOS); |
|||
e.printStackTrace(); |
|||
} |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public List<Tipo> buscarValidos(boolean estado) { |
|||
TipoDAO tipoDAO = new TipoDAO(); |
|||
List l = tipoDAO.buscarValidos(estado); |
|||
// Llama al método buscarValidos de ProductoDAO y devuelve la lista resultante
|
|||
System.out.println(l); |
|||
return l; |
|||
} |
|||
} |
@ -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 hola.BL; |
|||
|
|||
import hola.modelo.Tipo; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Local |
|||
public interface TipoBLLocal { |
|||
|
|||
public Mensaje agregar(Tipo tipo); |
|||
|
|||
public Tipo buscarId(Tipo tipo); |
|||
|
|||
public void eliminarId(Tipo tipo); |
|||
|
|||
public void editar(Tipo tipo); |
|||
|
|||
public List<Tipo> buscarValidos(boolean estado); |
|||
|
|||
} |
@ -0,0 +1,147 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
import hola.dao.UsuarioDAO; |
|||
import hola.modelo.Usuario; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.ejb.Stateless; |
|||
import javax.faces.application.FacesMessage; |
|||
import javax.faces.context.FacesContext; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Stateless |
|||
public class UsuarioBL implements UsuarioBLLocal { |
|||
|
|||
// Add business logic below. (Right-click in editor and choose
|
|||
// "Insert Code > Add Business Method")
|
|||
@Override |
|||
public Mensaje agregar(Usuario usuario) { |
|||
// Comentario de lógica: Método para agregar un proveedor
|
|||
//, Registro registro//
|
|||
System.out.println("Llegaste al metodo de agregar Usuario"); |
|||
UsuarioDAO usuarioDAO = new UsuarioDAO(); |
|||
Mensaje m = null; |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (usuario.getNombre().isEmpty() |
|||
|| usuario.getSexo()== null |
|||
|| usuario.getTelefono().isEmpty() |
|||
|| usuario.getCorreo().isEmpty() |
|||
|| usuario.getDireccion().isEmpty() |
|||
|| usuario.getNpila().isEmpty() |
|||
|| usuario.getUsername().isEmpty()) { |
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
return Mensaje.CAMPOS_INCOMPLETOS; |
|||
} |
|||
|
|||
// Buscar si el proveedor ya existe en la base de datos
|
|||
Optional<Usuario> usuarioEncontradoOptional = usuarioDAO.buscarUsuario(usuario); |
|||
|
|||
if (usuarioEncontradoOptional.isPresent()) { |
|||
// Manejar el caso en el que se encontró al menos un proveedor duplicado
|
|||
usuarioEncontradoOptional.get(); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "Error", "Elemento duplicado"); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
} else { |
|||
// Agregar el proveedor a la base de datos si no está duplicado
|
|||
usuarioDAO.agregar(usuario); |
|||
//registroDAO.agregar(registro);
|
|||
m = Mensaje.SIN_ERROR; |
|||
} |
|||
|
|||
return m; |
|||
} |
|||
|
|||
@Override |
|||
public Usuario buscarId(Usuario usuario) { |
|||
// Comentario de lógica: Método para buscar un proveedor por ID
|
|||
UsuarioDAO udao = new UsuarioDAO(); |
|||
return udao.buscarPorId(usuario); |
|||
} |
|||
|
|||
@Override |
|||
public void eliminarId(Usuario usuario) { |
|||
// Comentario de lógica: Método para eliminar un proveedor por ID
|
|||
UsuarioDAO udao = new UsuarioDAO(); |
|||
if (udao.eliminar(usuario)) { |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
} else { |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Mensaje editar(Usuario usuario) { |
|||
// Comentario de lógica: Método para editar un proveedor
|
|||
Mensaje m; |
|||
UsuarioDAO usuarioDAO = new UsuarioDAO(); |
|||
|
|||
// Validar que los campos requeridos no estén vacíos
|
|||
if (usuario.getNombre().isEmpty() |
|||
|| usuario.getSexo()== null |
|||
|| usuario.getNombre().isEmpty() |
|||
|| usuario.getTelefono().isEmpty() |
|||
|| usuario.getCorreo().isEmpty() |
|||
|| usuario.getDireccion().isEmpty() |
|||
|| usuario.getNpila().isEmpty() |
|||
|| usuario.getUsername().isEmpty() |
|||
|| usuario.getStatus() == null) { |
|||
|
|||
// Enviar mensaje de error si algún campo está incompleto
|
|||
m = Mensaje.CAMPOS_INCOMPLETOS; |
|||
System.out.println(Mensaje.CAMPOS_INCOMPLETOS); |
|||
return m; |
|||
} |
|||
|
|||
try { |
|||
// Editar el proveedor solo si todas las validaciones son exitosas
|
|||
Optional<Usuario> user = usuarioDAO.buscarUsuario(usuario); |
|||
if (user.isPresent()) { |
|||
|
|||
addMessage(FacesMessage.SEVERITY_ERROR, "Error", "Elemento duplicado"); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
} else { |
|||
|
|||
if (usuarioDAO.editar(usuario) == true) { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println(Mensaje.SIN_ERROR); |
|||
return m; |
|||
} else { |
|||
m = Mensaje.N0_EXISTE; |
|||
System.out.println(Mensaje.NO_EXISTE); |
|||
return m; |
|||
} |
|||
} |
|||
} catch (Exception e) { |
|||
// Capturar cualquier excepción que ocurra durante la edición del proveedor
|
|||
m = Mensaje.DATOS_INCORRECTOS; |
|||
System.out.println(Mensaje.DATOS_INCORRECTOS); |
|||
e.printStackTrace(); |
|||
} |
|||
return m; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public List<Usuario> buscarValidos(boolean estado) { |
|||
UsuarioDAO usuarioDAO = new UsuarioDAO(); |
|||
List l = usuarioDAO.buscarValidos(estado); |
|||
// Llama al método buscarValidos de ProductoDAO y devuelve la lista resultante
|
|||
System.out.println(l); |
|||
return l; |
|||
} |
|||
|
|||
public void addMessage(FacesMessage.Severity severity, String summary, String detail) { |
|||
FacesContext.getCurrentInstance().addMessage("MensajeUsuario", new FacesMessage(severity, summary, detail)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
/* |
|||
* 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 hola.BL; |
|||
|
|||
import hola.modelo.Usuario; |
|||
import hola.msg.Mensaje; |
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Local |
|||
public interface UsuarioBLLocal { |
|||
|
|||
public Mensaje agregar(Usuario usuario); |
|||
|
|||
public Usuario buscarId(Usuario usuario); |
|||
|
|||
public void eliminarId(Usuario usuario); |
|||
|
|||
public Mensaje editar(Usuario usuario); |
|||
|
|||
public List<Usuario> buscarValidos(boolean estado); |
|||
} |
@ -0,0 +1,134 @@ |
|||
/* |
|||
* 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 hola.dao; |
|||
|
|||
import hola.modelo.Departamento; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
|
|||
/** |
|||
* |
|||
* @author eduar |
|||
*/ |
|||
public class DepartamentoDAO { |
|||
|
|||
|
|||
private EntityManager em;//Manejador de entidades
|
|||
|
|||
public DepartamentoDAO() { |
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("si-ejbPU"); |
|||
em = emf.createEntityManager(); |
|||
|
|||
} |
|||
|
|||
public void agregar(Departamento departamento) { |
|||
em.getTransaction().begin(); |
|||
departamento.setStatus(1); |
|||
em.persist(departamento);//Almacenar en DB
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public boolean editar(Departamento departamento) { |
|||
if (buscarPorId(departamento) == null) { |
|||
return false; |
|||
} else { |
|||
em.getTransaction().begin(); |
|||
em.merge(departamento);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public boolean eliminar(Departamento departamento) { |
|||
if (buscarPorId(departamento) == null) { |
|||
return false; |
|||
} else { |
|||
|
|||
// Iniciar transacción
|
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Departamento t = em.find(Departamento.class, departamento.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
departamento.setNombre(t.getNombre()); |
|||
departamento.setAnaquel(t.getAnaquel()); |
|||
|
|||
// Modificar solo el estado
|
|||
departamento.setStatus(0); |
|||
em.merge(departamento); |
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public Departamento buscarPorId(Departamento departamento) { |
|||
Query q = em.createNamedQuery("Departamento.findById"); |
|||
q.setParameter("id", departamento.getId()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Departamento) q.getResultList().get(0); |
|||
} |
|||
|
|||
} |
|||
|
|||
public List<Departamento> buscarValidosD(boolean status) { |
|||
Query q = em.createNamedQuery("Departamento.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
q.setParameter("status", s); |
|||
if (s == 1) { |
|||
System.out.println("Activos"); |
|||
} else { |
|||
System.out.println("Inactivos"); |
|||
} |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
public Departamento buscarPorNombre(Departamento departamento) { |
|||
Query q = em.createNamedQuery("Departamento.findByNombre"); |
|||
q.setParameter("nombre", departamento.getNombre()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Departamento) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
public Optional<Departamento> buscarDepartamento(Departamento departamento) { |
|||
|
|||
Query q1 = em.createNamedQuery("Departamento.findByNombre"); |
|||
q1.setParameter("nombre", departamento.getNombre()); |
|||
|
|||
Query q2 = em.createNamedQuery("Departamento.findByAnaquel"); |
|||
q2.setParameter("anaquel", departamento.getNombre()); |
|||
|
|||
List<Departamento> resultadoNombre = q1.getResultList(); |
|||
List<Departamento> resultadoAnaquel = q2.getResultList(); |
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoNombre.isEmpty() |
|||
&& !resultadoAnaquel.isEmpty()) { |
|||
// Compara si la misma editorial está en los tres resultados
|
|||
Departamento departamentoEncontrado = resultadoNombre.stream() |
|||
.filter(resultadoAnaquel::contains) |
|||
.findFirst() |
|||
.orElse(null); |
|||
|
|||
return Optional.ofNullable(departamentoEncontrado); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
|
|||
} |
@ -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 hola.dao; |
|||
|
|||
import hola.modelo.Estado; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
public class EstadoDAO { |
|||
|
|||
private EntityManager em; |
|||
public EstadoDAO() { |
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("si-ejbPU"); |
|||
em = emf.createEntityManager(); |
|||
|
|||
} |
|||
public void agregar(Estado estado) { |
|||
em.getTransaction().begin(); |
|||
estado.setStatus(1); |
|||
em.persist(estado);//Almacenar en DB
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public boolean editar(Estado estado) { |
|||
if (buscarPorId(estado) == null) { |
|||
return false; |
|||
} else { |
|||
em.getTransaction().begin(); |
|||
em.merge(estado);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public boolean eliminar(Estado estado) { |
|||
if (buscarPorId(estado) == null) { |
|||
return false; |
|||
} else { |
|||
|
|||
// Iniciar transacción
|
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Estado u = em.find(Estado.class, estado.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
estado.setNombre(u.getNombre()); |
|||
|
|||
|
|||
|
|||
// Modificar solo el estado
|
|||
estado.setStatus(0); |
|||
em.merge(estado); |
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public Estado buscarPorId(Estado estado) { |
|||
Query q = em.createNamedQuery("Estado.findById"); |
|||
q.setParameter("id", estado.getId()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Estado) q.getResultList().get(0); |
|||
} |
|||
|
|||
} |
|||
|
|||
public List<Estado> buscarValidos(boolean status) { |
|||
Query q = em.createNamedQuery("Estado.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
q.setParameter("status", s); |
|||
if (s == 1) { |
|||
System.out.println("Activos"); |
|||
} else { |
|||
System.out.println("Inactivos"); |
|||
} |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
public Estado buscarPorNombre(Estado estado) { |
|||
Query q = em.createNamedQuery("Estado.findByNombre"); |
|||
q.setParameter("nombre", estado.getNombre()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Estado) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
public Optional<Estado> buscarEstado(Estado estado) { |
|||
|
|||
Query q1 = em.createNamedQuery("Estado.findByNombre"); |
|||
q1.setParameter("nombre", estado.getNombre()); |
|||
|
|||
|
|||
|
|||
List<Estado> resultadoNombre = q1.getResultList(); |
|||
|
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoNombre.isEmpty()) { |
|||
// Compara si la misma editorial está en los tres resultados
|
|||
Estado usuarioEncontrado = resultadoNombre.stream() |
|||
.findFirst() |
|||
.orElse(null); |
|||
|
|||
return Optional.ofNullable(usuarioEncontrado); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,105 @@ |
|||
/* |
|||
* 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 hola.dao; |
|||
import hola.modelo.Marca; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
|
|||
public class MarcaDAO { |
|||
|
|||
private EntityManager eme; |
|||
|
|||
public MarcaDAO() { |
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("si-ejbPU"); |
|||
eme = emf.createEntityManager(); |
|||
} |
|||
|
|||
public void agregar(Marca marca) { |
|||
eme.getTransaction().begin(); |
|||
marca.setStatus(1); |
|||
eme.persist(marca); // Almacenar en la base de datos
|
|||
eme.getTransaction().commit(); |
|||
} |
|||
|
|||
public boolean editar(Marca marca) { |
|||
if (buscarPorId(marca) == null) { |
|||
return false; |
|||
} else { |
|||
eme.getTransaction().begin(); |
|||
eme.merge(marca); // Editar en la base de datos
|
|||
eme.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
public boolean eliminar(Marca marca) { |
|||
if (buscarPorId(marca) == null) { |
|||
return false; |
|||
} else { |
|||
eme.getTransaction().begin(); |
|||
// Obtener la marca actualizada desde la base de datos
|
|||
Marca m = eme.find(Marca.class, marca.getId()); |
|||
// Conservar otros datos y modificar solo el estado
|
|||
marca.setNombre(m.getNombre()); |
|||
marca.setStatus(0); |
|||
eme.merge(marca); |
|||
eme.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
public Marca buscarPorId(Marca marca) { |
|||
Query q = eme.createNamedQuery("Marca.findById"); |
|||
q.setParameter("id", marca.getId()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Marca) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
public List<Marca> buscarValidos(boolean status) { |
|||
Query q = eme.createNamedQuery("Marca.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
q.setParameter("status", s); |
|||
if (s == 1) { |
|||
System.out.println("Marcas Activas"); |
|||
} else { |
|||
System.out.println("Marcas Inactivas"); |
|||
} |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
public Marca buscarPorNombre(Marca marca) { |
|||
Query q = eme.createNamedQuery("Marca.findByNombre"); |
|||
q.setParameter("nombre", marca.getNombre()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Marca) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
public Optional<Marca> buscarMarca(Marca marca) { |
|||
Query q = eme.createNamedQuery("Marca.findByNombre"); |
|||
q.setParameter("nombre", marca.getNombre()); |
|||
|
|||
List<Marca> resultadoNombre = q.getResultList(); |
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoNombre.isEmpty()) { |
|||
// Devuelve el primer resultado encontrado
|
|||
Marca marcaEncontrada = resultadoNombre.get(0); |
|||
return Optional.ofNullable(marcaEncontrada); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,127 @@ |
|||
/* |
|||
* 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 hola.dao; |
|||
|
|||
import hola.modelo.Marca; |
|||
import hola.modelo.Pais; |
|||
import hola.modelo.Usuario; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
|
|||
/** |
|||
* |
|||
* @author eduar |
|||
*/ |
|||
public class PaisDAO { |
|||
|
|||
private EntityManager em; |
|||
|
|||
public PaisDAO() { |
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("si-ejbPU"); |
|||
em = emf.createEntityManager(); |
|||
} |
|||
|
|||
public void agregar(Pais pais) { |
|||
em.getTransaction().begin(); |
|||
pais.setStatus(1); |
|||
em.persist(pais);//Almacenar en DB
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public boolean editar(Pais pais) { |
|||
if (buscarPorId(pais) == null) { |
|||
return false; |
|||
} else { |
|||
em.getTransaction().begin(); |
|||
em.merge(pais);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public boolean eliminar(Pais pais) { |
|||
if (buscarPorId(pais) == null) { |
|||
return false; |
|||
} else { |
|||
|
|||
// Iniciar transacción
|
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Pais u = em.find(Pais.class, pais.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
pais.setNombre(u.getNombre()); |
|||
// Modificar solo el estado
|
|||
pais.setStatus(0); |
|||
em.merge(pais); |
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public Pais buscarPorId(Pais pais) { |
|||
Query q = em.createNamedQuery("Pais.findById"); |
|||
q.setParameter("id", pais.getId()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Pais) q.getResultList().get(0); |
|||
} |
|||
|
|||
} |
|||
|
|||
public List<Pais> buscarValidos(boolean status) { |
|||
Query q = em.createNamedQuery("Pais.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
q.setParameter("status", s); |
|||
if (s == 1) { |
|||
System.out.println("Activos"); |
|||
} else { |
|||
System.out.println("Inactivos"); |
|||
} |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
public Pais buscarPorNombre(Pais pais) { |
|||
Query q = em.createNamedQuery("Pais.findByNombre"); |
|||
q.setParameter("nombre", pais.getNombre()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Pais) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
public Optional<Pais> buscarPais(Pais pais) { |
|||
|
|||
Query q1 = em.createNamedQuery("Pais.findByNombre"); |
|||
q1.setParameter("nombre", pais.getNombre()); |
|||
|
|||
List<Pais> resultadoNombre = q1.getResultList(); |
|||
|
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoNombre.isEmpty()) { |
|||
// Compara si la misma editorial está en los tres resultados
|
|||
Pais paisEncontrado = resultadoNombre.stream() |
|||
.findFirst() |
|||
.orElse(null); |
|||
|
|||
return Optional.ofNullable(paisEncontrado); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,162 @@ |
|||
/* |
|||
* 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 hola.dao; |
|||
|
|||
import hola.modelo.Producto; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
|
|||
/** |
|||
* |
|||
* @author eduar |
|||
*/ |
|||
public class ProductoDAO { |
|||
|
|||
private EntityManager em;//Manejador de entidades
|
|||
|
|||
public ProductoDAO() { |
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("si-ejbPU"); |
|||
em = emf.createEntityManager(); |
|||
|
|||
} |
|||
|
|||
public void agregar(Producto producto) { |
|||
em.getTransaction().begin(); |
|||
producto.setStatus(1); |
|||
em.persist(producto);//Almacenar en DB
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public boolean editar(Producto producto) { |
|||
if (buscarPorId(producto) == null) { |
|||
return false; |
|||
} else { |
|||
em.getTransaction().begin(); |
|||
em.merge(producto);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public boolean eliminar(Producto producto) { |
|||
if (buscarPorId(producto) == null) { |
|||
return false; |
|||
} else { |
|||
|
|||
// Iniciar transacción
|
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Producto t = em.find(Producto.class, producto.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
producto.setNombre(t.getNombre()); |
|||
producto.setCantidad(t.getCantidad()); |
|||
producto.setPrecio(t.getPrecio()); |
|||
producto.setCodigoBarras(t.getCodigoBarras()); |
|||
producto.setMedida(t.getMedida()); |
|||
producto.setLote(t.getLote()); |
|||
|
|||
|
|||
// Modificar solo el estado
|
|||
producto.setStatus(0); |
|||
em.merge(producto); |
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public Producto buscarPorId(Producto producto) { |
|||
Query q = em.createNamedQuery("Producto.findById"); |
|||
q.setParameter("id", producto.getId()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Producto) q.getResultList().get(0); |
|||
} |
|||
|
|||
} |
|||
|
|||
public List<Producto> buscarValidosD(boolean status) { |
|||
Query q = em.createNamedQuery("Producto.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
q.setParameter("status", s); |
|||
if (s == 1) { |
|||
System.out.println("Activos"); |
|||
} else { |
|||
System.out.println("Inactivos"); |
|||
} |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
public Producto buscarPorNombre(Producto producto) { |
|||
Query q = em.createNamedQuery("Producto.findByNombre"); |
|||
q.setParameter("nombre", producto.getNombre()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Producto) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
public Optional<Producto> buscarProducto(Producto producto) { |
|||
|
|||
Query q1 = em.createNamedQuery("Producto.findByNombre"); |
|||
q1.setParameter("nombre", producto.getNombre()); |
|||
|
|||
Query q2 = em.createNamedQuery("Producto.findByCantidad"); |
|||
q2.setParameter("cantidad", producto.getCantidad()); |
|||
|
|||
Query q3 = em.createNamedQuery("Producto.findByPrecio"); |
|||
q3.setParameter("precio", producto.getPrecio()); |
|||
|
|||
Query q4 = em.createNamedQuery("Producto.findByCodigoBarras"); |
|||
q4.setParameter("codigoBarras", producto.getCodigoBarras()); |
|||
|
|||
Query q5 = em.createNamedQuery("Producto.findByMedida"); |
|||
q5.setParameter("medida", producto.getMedida()); |
|||
|
|||
Query q6 = em.createNamedQuery("Producto.findByLote"); |
|||
q6.setParameter("lote", producto.getLote()); |
|||
|
|||
List<Producto> resultadoNombre = q1.getResultList(); |
|||
List<Producto> resultadoCantidad = q2.getResultList(); |
|||
List<Producto> resultadoPrecio = q3.getResultList(); |
|||
List<Producto> resultadoCodigoBarras = q4.getResultList(); |
|||
List<Producto> resultadoMedida = q5.getResultList(); |
|||
List<Producto> resultadoLote = q6.getResultList(); |
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoNombre.isEmpty() |
|||
&& !resultadoCantidad.isEmpty() |
|||
&& !resultadoPrecio.isEmpty() |
|||
&& !resultadoCodigoBarras.isEmpty() |
|||
&& !resultadoMedida.isEmpty() |
|||
&& !resultadoLote.isEmpty()) { |
|||
// Compara si la misma editorial está en los tres resultados
|
|||
Producto productoEncontrado = resultadoNombre.stream() |
|||
.filter(resultadoCantidad::contains) |
|||
.filter(resultadoPrecio::contains) |
|||
.filter(resultadoCodigoBarras::contains) |
|||
.filter(resultadoMedida::contains) |
|||
.filter(resultadoLote::contains) |
|||
.findFirst() |
|||
.orElse(null); |
|||
|
|||
return Optional.ofNullable(productoEncontrado); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,148 @@ |
|||
/* |
|||
* 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 hola.dao; |
|||
|
|||
import hola.modelo.Provedor; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
|
|||
/** |
|||
* |
|||
* @author Josue |
|||
*/ |
|||
public class ProvedorDAO { |
|||
|
|||
private EntityManager em; |
|||
|
|||
public ProvedorDAO() { |
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("si-ejbPU"); |
|||
em = emf.createEntityManager(); |
|||
|
|||
} |
|||
|
|||
public void agregar(Provedor provedor) { |
|||
em.getTransaction().begin(); |
|||
provedor.setStatus(1); |
|||
em.persist(provedor);//Almacenar en DB
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public boolean editar(Provedor provedor) { |
|||
if (buscarPorId(provedor) == null) { |
|||
return false; |
|||
} else { |
|||
em.getTransaction().begin(); |
|||
em.merge(provedor);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public boolean eliminar(Provedor provedor) { |
|||
if (buscarPorId(provedor) == null) { |
|||
return false; |
|||
} else { |
|||
|
|||
// Iniciar transacción
|
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Provedor p = em.find(Provedor.class, provedor.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
provedor.setNombre(p.getNombre()); |
|||
provedor.setDireccion(p.getDireccion()); |
|||
provedor.setCorreo(p.getCorreo()); |
|||
provedor.setTelefono(p.getTelefono()); |
|||
|
|||
|
|||
// Modificar solo el estado
|
|||
provedor.setStatus(2); |
|||
em.merge(provedor); |
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public Provedor buscarPorId(Provedor d) { |
|||
Query q = em.createNamedQuery("Provedor.findById"); |
|||
q.setParameter("id", d.getId()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Provedor) q.getResultList().get(0); |
|||
} |
|||
|
|||
} |
|||
|
|||
public List<Provedor> buscarValidos(boolean status) { |
|||
Query q = em.createNamedQuery("Provedor.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
q.setParameter("status", s); |
|||
if (s == 1) { |
|||
System.out.println("Activos"); |
|||
} else { |
|||
System.out.println("Inactivos"); |
|||
} |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
public Provedor buscarPorNombre(Provedor departamento) { |
|||
Query q = em.createNamedQuery("Provedor.findByNombre"); |
|||
q.setParameter("nombre", departamento.getNombre()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Provedor) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
public Optional<Provedor> buscarProvedor(Provedor d) { |
|||
|
|||
Query q1 = em.createNamedQuery("Provedor.findByNombre"); |
|||
q1.setParameter("nombre", d.getNombre()); |
|||
|
|||
Query q2 = em.createNamedQuery("Provedor.findByDireccion"); |
|||
q2.setParameter("direccion", d.getDireccion()); |
|||
|
|||
Query q3 = em.createNamedQuery("Provedor.findByCorreo"); |
|||
q3.setParameter("correo", d.getCorreo()); |
|||
|
|||
Query q4 = em.createNamedQuery("Provedor.findByTelefono"); |
|||
q4.setParameter("telefono", d.getTelefono()); |
|||
|
|||
List<Provedor> resultadoNombre = q1.getResultList(); |
|||
List<Provedor> resultadoDireccion = q2.getResultList(); |
|||
List<Provedor> resultadoCorreo = q3.getResultList(); |
|||
List<Provedor> resultadoTelefono = q4.getResultList(); |
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoNombre.isEmpty() |
|||
&& !resultadoDireccion.isEmpty() |
|||
&& !resultadoCorreo.isEmpty() |
|||
&& !resultadoTelefono.isEmpty()) { |
|||
// Compara si la misma editorial está en los tres resultados
|
|||
Provedor departamentoEncontrado = resultadoNombre.stream() |
|||
.filter(resultadoDireccion::contains) |
|||
.filter(resultadoCorreo::contains) |
|||
.filter(resultadoTelefono::contains) |
|||
.findFirst() |
|||
.orElse(null); |
|||
|
|||
return Optional.ofNullable(departamentoEncontrado); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,125 @@ |
|||
/* |
|||
* 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 hola.dao; |
|||
|
|||
import hola.modelo.Rol; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
public class RolDAO { |
|||
|
|||
private EntityManager em; |
|||
|
|||
public RolDAO() { |
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("si-ejbPU"); |
|||
em = emf.createEntityManager(); |
|||
|
|||
} |
|||
|
|||
public void agregar(Rol rol) { |
|||
em.getTransaction().begin(); |
|||
rol.setStatus(1); |
|||
em.persist(rol);//Almacenar en DB
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public boolean editar(Rol rol) { |
|||
if (buscarPorId(rol) == null) { |
|||
return false; |
|||
} else { |
|||
em.getTransaction().begin(); |
|||
em.merge(rol);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public boolean eliminar(Rol rol) { |
|||
if (buscarPorId(rol) == null) { |
|||
return false; |
|||
} else { |
|||
|
|||
// Iniciar transacción
|
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Rol r = em.find(Rol.class, rol.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
rol.setNombre(r.getNombre()); |
|||
|
|||
// Modificar solo el estado
|
|||
rol.setStatus(0); |
|||
em.merge(rol); |
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public Rol buscarPorId(Rol rol) { |
|||
Query q = em.createNamedQuery("Rol.findById"); |
|||
q.setParameter("id", rol.getId()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Rol) q.getResultList().get(0); |
|||
} |
|||
|
|||
} |
|||
|
|||
public List<Rol> buscarValidos(boolean status) { |
|||
Query q = em.createNamedQuery("Rol.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
q.setParameter("status", s); |
|||
if (s == 1) { |
|||
System.out.println("Activos"); |
|||
} else { |
|||
System.out.println("Inactivos"); |
|||
} |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
public Rol buscarPorNombre(Rol rol) { |
|||
Query q = em.createNamedQuery("Rol.findByNombre"); |
|||
q.setParameter("nombre", rol.getNombre()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Rol) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
public Optional<Rol> buscarRol(Rol rol) { |
|||
|
|||
Query q1 = em.createNamedQuery("Rol.findByNombre"); |
|||
q1.setParameter("nombre", rol.getNombre()); |
|||
|
|||
List<Tipo> resultadoNombre = q1.getResultList(); |
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoNombre.isEmpty()) { |
|||
// Compara si la misma editorial está en los tres resultados
|
|||
Tipo tipoEncontrado = resultadoNombre.stream() |
|||
.findFirst() |
|||
.orElse(null); |
|||
|
|||
return Optional.ofNullable(tipoEncontrado); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
} |
@ -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 hola.dao; |
|||
|
|||
import hola.modelo.Tipo; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
public class TipoDAO { |
|||
|
|||
private EntityManager em; |
|||
|
|||
public TipoDAO() { |
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("si-ejbPU"); |
|||
em = emf.createEntityManager(); |
|||
|
|||
} |
|||
|
|||
public void agregar(Tipo tipo) { |
|||
em.getTransaction().begin(); |
|||
tipo.setStatus(1); |
|||
em.persist(tipo);//Almacenar en DB
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public boolean editar(Tipo tipo) { |
|||
if (buscarPorId(tipo) == null) { |
|||
return false; |
|||
} else { |
|||
em.getTransaction().begin(); |
|||
em.merge(tipo);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public boolean eliminar(Tipo tipo) { |
|||
if (buscarPorId(tipo) == null) { |
|||
return false; |
|||
} else { |
|||
|
|||
// Iniciar transacción
|
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Tipo t = em.find(Tipo.class, tipo.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
tipo.setNombre(t.getNombre()); |
|||
|
|||
// Modificar solo el estado
|
|||
tipo.setStatus(0); |
|||
em.merge(tipo); |
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public Tipo buscarPorId(Tipo tipo) { |
|||
Query q = em.createNamedQuery("Tipo.findById"); |
|||
q.setParameter("id", tipo.getId()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Tipo) q.getResultList().get(0); |
|||
} |
|||
|
|||
} |
|||
|
|||
public List<Tipo> buscarValidos(boolean status) { |
|||
Query q = em.createNamedQuery("Tipo.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
q.setParameter("status", s); |
|||
if (s == 1) { |
|||
System.out.println("Activos"); |
|||
} else { |
|||
System.out.println("Inactivos"); |
|||
} |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
public Tipo buscarPorNombre(Tipo tipo) { |
|||
Query q = em.createNamedQuery("Tipo.findByNombre"); |
|||
q.setParameter("nombre", tipo.getNombre()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Tipo) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
public Optional<Tipo> buscarTipo(Tipo tipo) { |
|||
|
|||
Query q1 = em.createNamedQuery("Tipo.findByNombre"); |
|||
q1.setParameter("nombre", tipo.getNombre()); |
|||
|
|||
List<Tipo> resultadoNombre = q1.getResultList(); |
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoNombre.isEmpty()) { |
|||
// Compara si la misma editorial está en los tres resultados
|
|||
Tipo tipoEncontrado = resultadoNombre.stream() |
|||
.findFirst() |
|||
.orElse(null); |
|||
|
|||
return Optional.ofNullable(tipoEncontrado); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,146 @@ |
|||
/* |
|||
* 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 hola.dao; |
|||
|
|||
import hola.modelo.Usuario; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
public class UsuarioDAO { |
|||
private EntityManager em; |
|||
|
|||
public UsuarioDAO() { |
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("si-ejbPU"); |
|||
em = emf.createEntityManager(); |
|||
|
|||
} |
|||
public void agregar(Usuario usuario) { |
|||
em.getTransaction().begin(); |
|||
usuario.setStatus(1); |
|||
em.persist(usuario);//Almacenar en DB
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public boolean editar(Usuario usuario) { |
|||
if (buscarPorId(usuario) == null) { |
|||
return false; |
|||
} else { |
|||
em.getTransaction().begin(); |
|||
em.merge(usuario);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public boolean eliminar(Usuario usuario) { |
|||
if (buscarPorId(usuario) == null) { |
|||
return false; |
|||
} else { |
|||
|
|||
// Iniciar transacción
|
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Usuario u = em.find(Usuario.class, usuario.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
usuario.setNombre(u.getNombre()); |
|||
usuario.setTelefono(u.getTelefono()); |
|||
usuario.setCorreo(u.getCorreo()); |
|||
usuario.setDireccion(u.getDireccion()); |
|||
|
|||
|
|||
// Modificar solo el estado
|
|||
usuario.setStatus(0); |
|||
em.merge(usuario); |
|||
em.getTransaction().commit(); |
|||
return true; |
|||
} |
|||
|
|||
} |
|||
|
|||
public Usuario buscarPorId(Usuario usuario) { |
|||
Query q = em.createNamedQuery("Usuario.findById"); |
|||
q.setParameter("id", usuario.getId()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Usuario) q.getResultList().get(0); |
|||
} |
|||
|
|||
} |
|||
|
|||
public List<Usuario> buscarValidos(boolean status) { |
|||
Query q = em.createNamedQuery("Usuario.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
q.setParameter("status", s); |
|||
if (s == 1) { |
|||
System.out.println("Activos"); |
|||
} else { |
|||
System.out.println("Inactivos"); |
|||
} |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
public Usuario buscarPorNombre(Usuario usuario) { |
|||
Query q = em.createNamedQuery("Usuario.findByNombre"); |
|||
q.setParameter("nombre", usuario.getNombre()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Usuario) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
public Optional<Usuario> buscarUsuario(Usuario usuario) { |
|||
|
|||
Query q1 = em.createNamedQuery("Usuario.findByNombre"); |
|||
q1.setParameter("nombre", usuario.getNombre()); |
|||
|
|||
Query q2 = em.createNamedQuery("Usuario.findByTelefono"); |
|||
q2.setParameter("telefono", usuario.getTelefono()); |
|||
|
|||
Query q3 = em.createNamedQuery("Usuario.findByCorreo"); |
|||
q3.setParameter("correo", usuario.getCorreo()); |
|||
|
|||
Query q4 = em.createNamedQuery("Usuario.findByDireccion"); |
|||
q4.setParameter("direccion", usuario.getDireccion()); |
|||
|
|||
List<Usuario> resultadoNombre = q1.getResultList(); |
|||
List<Usuario> resultadoTelefono = q2.getResultList(); |
|||
List<Usuario> resultadoCorreo = q3.getResultList(); |
|||
List<Usuario> resultadoDireccion = q4.getResultList(); |
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoNombre.isEmpty() |
|||
&& !resultadoTelefono.isEmpty() |
|||
&& !resultadoCorreo.isEmpty() |
|||
&& !resultadoDireccion.isEmpty()) { |
|||
// Compara si la misma editorial está en los tres resultados
|
|||
Usuario usuarioEncontrado = resultadoNombre.stream() |
|||
.filter(resultadoTelefono::contains) |
|||
.filter(resultadoCorreo::contains) |
|||
.filter(resultadoDireccion::contains) |
|||
.findFirst() |
|||
.orElse(null); |
|||
|
|||
return Optional.ofNullable(usuarioEncontrado); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,129 @@ |
|||
/* |
|||
* 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 hola.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.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Entity |
|||
@Table(name = "departamento", catalog = "sistemadeinventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Departamento.findAll", query = "SELECT d FROM Departamento d"), |
|||
@NamedQuery(name = "Departamento.findById", query = "SELECT d FROM Departamento d WHERE d.id = :id"), |
|||
@NamedQuery(name = "Departamento.findByNombre", query = "SELECT d FROM Departamento d WHERE d.nombre = :nombre"), |
|||
@NamedQuery(name = "Departamento.findByAnaquel", query = "SELECT d FROM Departamento d WHERE d.anaquel = :anaquel"), |
|||
@NamedQuery(name = "Departamento.findByStatus", query = "SELECT d FROM Departamento d WHERE d.status = :status")}) |
|||
public class Departamento implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Size(max = 20) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Size(max = 15) |
|||
@Column(name = "anaquel") |
|||
private String anaquel; |
|||
@Column(name = "status") |
|||
private Integer status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "departamentoId") |
|||
private List<Producto> productoList; |
|||
|
|||
public Departamento() { |
|||
} |
|||
|
|||
public Departamento(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
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 getAnaquel() { |
|||
return anaquel; |
|||
} |
|||
|
|||
public void setAnaquel(String anaquel) { |
|||
this.anaquel = anaquel; |
|||
} |
|||
|
|||
public Integer getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(Integer status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Producto> getProductoList() { |
|||
return productoList; |
|||
} |
|||
|
|||
public void setProductoList(List<Producto> 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 Departamento)) { |
|||
return false; |
|||
} |
|||
Departamento other = (Departamento) 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 "hola.modelo.Departamento[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -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 hola.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.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Entity |
|||
@Table(name = "estado", catalog = "sistemadeinventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Estado.findAll", query = "SELECT e FROM Estado e"), |
|||
@NamedQuery(name = "Estado.findById", query = "SELECT e FROM Estado e WHERE e.id = :id"), |
|||
@NamedQuery(name = "Estado.findByNombre", query = "SELECT e FROM Estado e WHERE e.nombre = :nombre"), |
|||
@NamedQuery(name = "Estado.findByStatus", query = "SELECT e FROM Estado e WHERE e.status = :status")}) |
|||
public class Estado implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Size(max = 45) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Column(name = "status") |
|||
private Integer status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "estadoIdestado") |
|||
private List<Provedor> provedorList; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "estadoIdestado") |
|||
private List<Usuario> usuarioList; |
|||
|
|||
public Estado() { |
|||
} |
|||
|
|||
public Estado(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
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 Integer getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(Integer status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Provedor> getProvedorList() { |
|||
return provedorList; |
|||
} |
|||
|
|||
public void setProvedorList(List<Provedor> provedorList) { |
|||
this.provedorList = provedorList; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Usuario> getUsuarioList() { |
|||
return usuarioList; |
|||
} |
|||
|
|||
public void setUsuarioList(List<Usuario> 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 Estado)) { |
|||
return false; |
|||
} |
|||
Estado other = (Estado) 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 "hola.modelo.Estado[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,117 @@ |
|||
/* |
|||
* 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 hola.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.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Entity |
|||
@Table(name = "marca", catalog = "sistemadeinventario", 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; |
|||
@Size(max = 20) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Column(name = "status") |
|||
private Integer status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "marcaIdmarca") |
|||
private List<Producto> productoList; |
|||
|
|||
public Marca() { |
|||
} |
|||
|
|||
public Marca(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
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 Integer getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(Integer status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Producto> getProductoList() { |
|||
return productoList; |
|||
} |
|||
|
|||
public void setProductoList(List<Producto> 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 "hola.modelo.Marca[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,127 @@ |
|||
/* |
|||
* 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 hola.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.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 chore |
|||
*/ |
|||
@Entity |
|||
@Table(name = "pais", catalog = "sistemadeinventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Pais.findAll", query = "SELECT p FROM Pais p"), |
|||
@NamedQuery(name = "Pais.findById", query = "SELECT p FROM Pais p WHERE p.id = :id"), |
|||
@NamedQuery(name = "Pais.findByNombre", query = "SELECT p FROM Pais p WHERE p.nombre = :nombre"), |
|||
@NamedQuery(name = "Pais.findByStatus", query = "SELECT p FROM Pais p WHERE p.status = :status")}) |
|||
public class Pais implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Size(max = 45) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Column(name = "status") |
|||
private Integer status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "paisId") |
|||
private List<Provedor> provedorList; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "paisId") |
|||
private List<Usuario> usuarioList; |
|||
|
|||
public Pais() { |
|||
} |
|||
|
|||
public Pais(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
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 Integer getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(Integer status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Provedor> getProvedorList() { |
|||
return provedorList; |
|||
} |
|||
|
|||
public void setProvedorList(List<Provedor> provedorList) { |
|||
this.provedorList = provedorList; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Usuario> getUsuarioList() { |
|||
return usuarioList; |
|||
} |
|||
|
|||
public void setUsuarioList(List<Usuario> 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 Pais)) { |
|||
return false; |
|||
} |
|||
Pais other = (Pais) 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 "hola.modelo.Pais[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,206 @@ |
|||
/* |
|||
* 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 hola.modelo; |
|||
|
|||
import java.io.Serializable; |
|||
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.validation.constraints.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Entity |
|||
@Table(name = "producto", catalog = "sistemadeinventario", 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.findByCantidad", query = "SELECT p FROM Producto p WHERE p.cantidad = :cantidad"), |
|||
@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.findByCodigoBarras", query = "SELECT p FROM Producto p WHERE p.codigoBarras = :codigoBarras"), |
|||
@NamedQuery(name = "Producto.findByMedida", query = "SELECT p FROM Producto p WHERE p.medida = :medida"), |
|||
@NamedQuery(name = "Producto.findByLote", query = "SELECT p FROM Producto p WHERE p.lote = :lote"), |
|||
@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; |
|||
@Size(max = 10) |
|||
@Column(name = "cantidad") |
|||
private String cantidad; |
|||
@Size(max = 20) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Column(name = "precio") |
|||
private Integer precio; |
|||
@Size(max = 15) |
|||
@Column(name = "codigoBarras") |
|||
private String codigoBarras; |
|||
@Column(name = "medida") |
|||
private Integer medida; |
|||
@Size(max = 10) |
|||
@Column(name = "lote") |
|||
private String lote; |
|||
@Column(name = "status") |
|||
private Integer status; |
|||
@JoinColumn(name = "departamento_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Departamento departamentoId; |
|||
@JoinColumn(name = "marca_idmarca", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Marca marcaIdmarca; |
|||
@JoinColumn(name = "provedor_idprovedor", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Provedor provedorIdprovedor; |
|||
@JoinColumn(name = "tipo_idtipo", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Tipo tipoIdtipo; |
|||
|
|||
public Producto() { |
|||
} |
|||
|
|||
public Producto(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getCantidad() { |
|||
return cantidad; |
|||
} |
|||
|
|||
public void setCantidad(String cantidad) { |
|||
this.cantidad = cantidad; |
|||
} |
|||
|
|||
public String getNombre() { |
|||
return nombre; |
|||
} |
|||
|
|||
public void setNombre(String nombre) { |
|||
this.nombre = nombre; |
|||
} |
|||
|
|||
public Integer getPrecio() { |
|||
return precio; |
|||
} |
|||
|
|||
public void setPrecio(Integer precio) { |
|||
this.precio = precio; |
|||
} |
|||
|
|||
public String getCodigoBarras() { |
|||
return codigoBarras; |
|||
} |
|||
|
|||
public void setCodigoBarras(String codigoBarras) { |
|||
this.codigoBarras = codigoBarras; |
|||
} |
|||
|
|||
public Integer getMedida() { |
|||
return medida; |
|||
} |
|||
|
|||
public void setMedida(Integer medida) { |
|||
this.medida = medida; |
|||
} |
|||
|
|||
public String getLote() { |
|||
return lote; |
|||
} |
|||
|
|||
public void setLote(String lote) { |
|||
this.lote = lote; |
|||
} |
|||
|
|||
public Integer getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(Integer status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
public Departamento getDepartamentoId() { |
|||
return departamentoId; |
|||
} |
|||
|
|||
public void setDepartamentoId(Departamento departamentoId) { |
|||
this.departamentoId = departamentoId; |
|||
} |
|||
|
|||
public Marca getMarcaIdmarca() { |
|||
return marcaIdmarca; |
|||
} |
|||
|
|||
public void setMarcaIdmarca(Marca marcaIdmarca) { |
|||
this.marcaIdmarca = marcaIdmarca; |
|||
} |
|||
|
|||
public Provedor getProvedorIdprovedor() { |
|||
return provedorIdprovedor; |
|||
} |
|||
|
|||
public void setProvedorIdprovedor(Provedor provedorIdprovedor) { |
|||
this.provedorIdprovedor = provedorIdprovedor; |
|||
} |
|||
|
|||
public Tipo getTipoIdtipo() { |
|||
return tipoIdtipo; |
|||
} |
|||
|
|||
public void setTipoIdtipo(Tipo tipoIdtipo) { |
|||
this.tipoIdtipo = tipoIdtipo; |
|||
} |
|||
|
|||
@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 "hola.modelo.Producto[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,177 @@ |
|||
/* |
|||
* 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 hola.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.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Entity |
|||
@Table(name = "provedor", catalog = "sistemadeinventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Provedor.findAll", query = "SELECT p FROM Provedor p"), |
|||
@NamedQuery(name = "Provedor.findById", query = "SELECT p FROM Provedor p WHERE p.id = :id"), |
|||
@NamedQuery(name = "Provedor.findByNombre", query = "SELECT p FROM Provedor p WHERE p.nombre = :nombre"), |
|||
@NamedQuery(name = "Provedor.findByDireccion", query = "SELECT p FROM Provedor p WHERE p.direccion = :direccion"), |
|||
@NamedQuery(name = "Provedor.findByCorreo", query = "SELECT p FROM Provedor p WHERE p.correo = :correo"), |
|||
@NamedQuery(name = "Provedor.findByTelefono", query = "SELECT p FROM Provedor p WHERE p.telefono = :telefono"), |
|||
@NamedQuery(name = "Provedor.findByStatus", query = "SELECT p FROM Provedor p WHERE p.status = :status")}) |
|||
public class Provedor implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Size(max = 20) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Size(max = 20) |
|||
@Column(name = "direccion") |
|||
private String direccion; |
|||
@Size(max = 15) |
|||
@Column(name = "correo") |
|||
private String correo; |
|||
@Size(max = 10) |
|||
@Column(name = "telefono") |
|||
private String telefono; |
|||
@Column(name = "status") |
|||
private Integer status; |
|||
@JoinColumn(name = "estado_idestado", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Estado estadoIdestado; |
|||
@JoinColumn(name = "pais_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Pais paisId; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "provedorIdprovedor") |
|||
private List<Producto> productoList; |
|||
|
|||
public Provedor() { |
|||
} |
|||
|
|||
public Provedor(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
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 getCorreo() { |
|||
return correo; |
|||
} |
|||
|
|||
public void setCorreo(String correo) { |
|||
this.correo = correo; |
|||
} |
|||
|
|||
public String getTelefono() { |
|||
return telefono; |
|||
} |
|||
|
|||
public void setTelefono(String telefono) { |
|||
this.telefono = telefono; |
|||
} |
|||
|
|||
public Integer getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(Integer status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
public Estado getEstadoIdestado() { |
|||
return estadoIdestado; |
|||
} |
|||
|
|||
public void setEstadoIdestado(Estado estadoIdestado) { |
|||
this.estadoIdestado = estadoIdestado; |
|||
} |
|||
|
|||
public Pais getPaisId() { |
|||
return paisId; |
|||
} |
|||
|
|||
public void setPaisId(Pais paisId) { |
|||
this.paisId = paisId; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Producto> getProductoList() { |
|||
return productoList; |
|||
} |
|||
|
|||
public void setProductoList(List<Producto> 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 Provedor)) { |
|||
return false; |
|||
} |
|||
Provedor other = (Provedor) 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 "hola.modelo.Provedor[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,138 @@ |
|||
/* |
|||
* 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 hola.modelo; |
|||
|
|||
import java.io.Serializable; |
|||
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.NamedQueries; |
|||
import javax.persistence.NamedQuery; |
|||
import javax.persistence.Table; |
|||
import javax.validation.constraints.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Entity |
|||
@Table(name = "registro", catalog = "sistemadeinventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Registro.findAll", query = "SELECT r FROM Registro r"), |
|||
@NamedQuery(name = "Registro.findById", query = "SELECT r FROM Registro r WHERE r.id = :id"), |
|||
@NamedQuery(name = "Registro.findByEntrada", query = "SELECT r FROM Registro r WHERE r.entrada = :entrada"), |
|||
@NamedQuery(name = "Registro.findBySalida", query = "SELECT r FROM Registro r WHERE r.salida = :salida"), |
|||
@NamedQuery(name = "Registro.findByAlta", query = "SELECT r FROM Registro r WHERE r.alta = :alta"), |
|||
@NamedQuery(name = "Registro.findByBaja", query = "SELECT r FROM Registro r WHERE r.baja = :baja"), |
|||
@NamedQuery(name = "Registro.findByStatus", query = "SELECT r FROM Registro r WHERE r.status = :status")}) |
|||
public class Registro implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Size(max = 10) |
|||
@Column(name = "Entrada") |
|||
private String entrada; |
|||
@Size(max = 10) |
|||
@Column(name = "salida") |
|||
private String salida; |
|||
@Size(max = 45) |
|||
@Column(name = "Alta") |
|||
private String alta; |
|||
@Size(max = 45) |
|||
@Column(name = "baja") |
|||
private String baja; |
|||
@Column(name = "status") |
|||
private Integer status; |
|||
|
|||
public Registro() { |
|||
} |
|||
|
|||
public Registro(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getEntrada() { |
|||
return entrada; |
|||
} |
|||
|
|||
public void setEntrada(String entrada) { |
|||
this.entrada = entrada; |
|||
} |
|||
|
|||
public String getSalida() { |
|||
return salida; |
|||
} |
|||
|
|||
public void setSalida(String salida) { |
|||
this.salida = salida; |
|||
} |
|||
|
|||
public String getAlta() { |
|||
return alta; |
|||
} |
|||
|
|||
public void setAlta(String alta) { |
|||
this.alta = alta; |
|||
} |
|||
|
|||
public String getBaja() { |
|||
return baja; |
|||
} |
|||
|
|||
public void setBaja(String baja) { |
|||
this.baja = baja; |
|||
} |
|||
|
|||
public Integer getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(Integer status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@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 Registro)) { |
|||
return false; |
|||
} |
|||
Registro other = (Registro) 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 "hola.modelo.Registro[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,117 @@ |
|||
/* |
|||
* 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 hola.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.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Entity |
|||
@Table(name = "rol", catalog = "sistemadeinventario", 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.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; |
|||
@Size(max = 20) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Column(name = "status") |
|||
private Integer status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "rolIdrol") |
|||
private List<Usuario> usuarioList; |
|||
|
|||
public Rol() { |
|||
} |
|||
|
|||
public Rol(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
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 Integer getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(Integer status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Usuario> getUsuarioList() { |
|||
return usuarioList; |
|||
} |
|||
|
|||
public void setUsuarioList(List<Usuario> 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 "hola.modelo.Rol[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,117 @@ |
|||
/* |
|||
* 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 hola.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.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Entity |
|||
@Table(name = "tipo", catalog = "sistemadeinventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Tipo.findAll", query = "SELECT t FROM Tipo t"), |
|||
@NamedQuery(name = "Tipo.findById", query = "SELECT t FROM Tipo t WHERE t.id = :id"), |
|||
@NamedQuery(name = "Tipo.findByNombre", query = "SELECT t FROM Tipo t WHERE t.nombre = :nombre"), |
|||
@NamedQuery(name = "Tipo.findByStatus", query = "SELECT t FROM Tipo t WHERE t.status = :status")}) |
|||
public class Tipo implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Size(max = 20) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Column(name = "status") |
|||
private Integer status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "tipoIdtipo") |
|||
private List<Producto> productoList; |
|||
|
|||
public Tipo() { |
|||
} |
|||
|
|||
public Tipo(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
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 Integer getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(Integer status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Producto> getProductoList() { |
|||
return productoList; |
|||
} |
|||
|
|||
public void setProductoList(List<Producto> 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 Tipo)) { |
|||
return false; |
|||
} |
|||
Tipo other = (Tipo) 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 "hola.modelo.Tipo[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,208 @@ |
|||
/* |
|||
* 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 hola.modelo; |
|||
|
|||
import java.io.Serializable; |
|||
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.validation.constraints.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Entity |
|||
@Table(name = "usuario", catalog = "sistemadeinventario", 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.findBySexo", query = "SELECT u FROM Usuario u WHERE u.sexo = :sexo"), |
|||
@NamedQuery(name = "Usuario.findByTelefono", query = "SELECT u FROM Usuario u WHERE u.telefono = :telefono"), |
|||
@NamedQuery(name = "Usuario.findByCorreo", query = "SELECT u FROM Usuario u WHERE u.correo = :correo"), |
|||
@NamedQuery(name = "Usuario.findByDireccion", query = "SELECT u FROM Usuario u WHERE u.direccion = :direccion"), |
|||
@NamedQuery(name = "Usuario.findByStatus", query = "SELECT u FROM Usuario u WHERE u.status = :status"), |
|||
@NamedQuery(name = "Usuario.findByNpila", query = "SELECT u FROM Usuario u WHERE u.npila = :npila"), |
|||
@NamedQuery(name = "Usuario.findByUsername", query = "SELECT u FROM Usuario u WHERE u.username = :username")}) |
|||
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; |
|||
@Size(max = 45) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Column(name = "sexo") |
|||
private Character sexo; |
|||
@Size(max = 10) |
|||
@Column(name = "telefono") |
|||
private String telefono; |
|||
@Size(max = 20) |
|||
@Column(name = "correo") |
|||
private String correo; |
|||
@Size(max = 40) |
|||
@Column(name = "direccion") |
|||
private String direccion; |
|||
@Column(name = "status") |
|||
private Integer status; |
|||
@Size(max = 15) |
|||
@Column(name = "npila") |
|||
private String npila; |
|||
@Size(max = 20) |
|||
@Column(name = "username") |
|||
private String username; |
|||
@JoinColumn(name = "estado_idestado", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Estado estadoIdestado; |
|||
@JoinColumn(name = "pais_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Pais paisId; |
|||
@JoinColumn(name = "rol_idrol", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Rol rolIdrol; |
|||
|
|||
public Usuario() { |
|||
} |
|||
|
|||
public Usuario(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
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 Character getSexo() { |
|||
return sexo; |
|||
} |
|||
|
|||
public void setSexo(Character sexo) { |
|||
this.sexo = sexo; |
|||
} |
|||
|
|||
public String getTelefono() { |
|||
return telefono; |
|||
} |
|||
|
|||
public void setTelefono(String telefono) { |
|||
this.telefono = telefono; |
|||
} |
|||
|
|||
public String getCorreo() { |
|||
return correo; |
|||
} |
|||
|
|||
public void setCorreo(String correo) { |
|||
this.correo = correo; |
|||
} |
|||
|
|||
public String getDireccion() { |
|||
return direccion; |
|||
} |
|||
|
|||
public void setDireccion(String direccion) { |
|||
this.direccion = direccion; |
|||
} |
|||
|
|||
public Integer getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(Integer status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
public String getNpila() { |
|||
return npila; |
|||
} |
|||
|
|||
public void setNpila(String npila) { |
|||
this.npila = npila; |
|||
} |
|||
|
|||
public String getUsername() { |
|||
return username; |
|||
} |
|||
|
|||
public void setUsername(String username) { |
|||
this.username = username; |
|||
} |
|||
|
|||
public Estado getEstadoIdestado() { |
|||
return estadoIdestado; |
|||
} |
|||
|
|||
public void setEstadoIdestado(Estado estadoIdestado) { |
|||
this.estadoIdestado = estadoIdestado; |
|||
} |
|||
|
|||
public Pais getPaisId() { |
|||
return paisId; |
|||
} |
|||
|
|||
public void setPaisId(Pais paisId) { |
|||
this.paisId = paisId; |
|||
} |
|||
|
|||
public Rol getRolIdrol() { |
|||
return rolIdrol; |
|||
} |
|||
|
|||
public void setRolIdrol(Rol rolIdrol) { |
|||
this.rolIdrol = rolIdrol; |
|||
} |
|||
|
|||
@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 "hola.modelo.Usuario[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,18 @@ |
|||
/* |
|||
* 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 hola.msg; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
public enum Mensaje { |
|||
SIN_ERROR, |
|||
CAMPOS_INCOMPLETOS, |
|||
DATOS_INCORRECTOS, |
|||
ELEMENTO_DUPLICADO, |
|||
N0_EXISTE, ERROR_INTERNO, NO_EXISTE, |
|||
|
|||
} |
@ -0,0 +1,71 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- You may freely edit this file. See commented blocks below for --> |
|||
<!-- some examples of how to customize the build. --> |
|||
<!-- (If you delete it and reopen the project it will be recreated.) --> |
|||
<!-- By default, only the Clean and Build commands use this build script. --> |
|||
<!-- Commands such as Run, Debug, and Test only use this build script if --> |
|||
<!-- the Compile on Save feature is turned off for the project. --> |
|||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> |
|||
<!-- in the project's Project Properties dialog box.--> |
|||
<project name="si-war" default="default" basedir="."> |
|||
<description>Builds, tests, and runs the project si-war.</description> |
|||
<import file="nbproject/build-impl.xml"/> |
|||
<!-- |
|||
|
|||
There exist several targets which are by default empty and which can be |
|||
used for execution of your tasks. These targets are usually executed |
|||
before and after some main targets. They are: |
|||
|
|||
-pre-init: called before initialization of project properties |
|||
-post-init: called after initialization of project properties |
|||
-pre-compile: called before javac compilation |
|||
-post-compile: called after javac compilation |
|||
-pre-compile-single: called before javac compilation of single file |
|||
-post-compile-single: called after javac compilation of single file |
|||
-pre-compile-test: called before javac compilation of JUnit tests |
|||
-post-compile-test: called after javac compilation of JUnit tests |
|||
-pre-compile-test-single: called before javac compilation of single JUnit test |
|||
-post-compile-test-single: called after javac compilation of single JUunit test |
|||
-pre-dist: called before archive building |
|||
-post-dist: called after archive building |
|||
-post-clean: called after cleaning build products |
|||
-pre-run-deploy: called before deploying |
|||
-post-run-deploy: called after deploying |
|||
|
|||
Example of pluging an obfuscator after the compilation could look like |
|||
|
|||
<target name="-post-compile"> |
|||
<obfuscate> |
|||
<fileset dir="${build.classes.dir}"/> |
|||
</obfuscate> |
|||
</target> |
|||
|
|||
For list of available properties check the imported |
|||
nbproject/build-impl.xml file. |
|||
|
|||
|
|||
Other way how to customize the build is by overriding existing main targets. |
|||
The target of interest are: |
|||
|
|||
init-macrodef-javac: defines macro for javac compilation |
|||
init-macrodef-junit: defines macro for junit execution |
|||
init-macrodef-debug: defines macro for class debugging |
|||
do-dist: archive building |
|||
run: execution of project |
|||
javadoc-build: javadoc generation |
|||
|
|||
Example of overriding the target for project execution could look like |
|||
|
|||
<target name="run" depends="<PROJNAME>-impl.jar"> |
|||
<exec dir="bin" executable="launcher.exe"> |
|||
<arg file="${dist.jar}"/> |
|||
</exec> |
|||
</target> |
|||
|
|||
Notice that overridden target depends on jar target and not only on |
|||
compile target as regular run target does. Again, for list of available |
|||
properties which you can use check the target you are overriding in |
|||
nbproject/build-impl.xml file. |
|||
|
|||
--> |
|||
</project> |
@ -0,0 +1,131 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- |
|||
|
|||
Licensed to the Apache Software Foundation (ASF) under one |
|||
or more contributor license agreements. See the NOTICE file |
|||
distributed with this work for additional information |
|||
regarding copyright ownership. The ASF licenses this file |
|||
to you under the Apache License, Version 2.0 (the |
|||
"License"); you may not use this file except in compliance |
|||
with the License. You may obtain a copy of the License at |
|||
|
|||
http://www.apache.org/licenses/LICENSE-2.0 |
|||
|
|||
Unless required by applicable law or agreed to in writing, |
|||
software distributed under the License is distributed on an |
|||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|||
KIND, either express or implied. See the License for the |
|||
specific language governing permissions and limitations |
|||
under the License. |
|||
|
|||
--> |
|||
<project default="-deploy-ant" basedir="."> |
|||
<target name="-init-cl-deployment-env" if="deploy.ant.enabled"> |
|||
<property file="${deploy.ant.properties.file}" /> |
|||
<available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/> |
|||
<available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/> |
|||
<available file="${deploy.ant.resource.dir}" property="has.setup"/> |
|||
<tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/> |
|||
</target> |
|||
|
|||
<target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present"> |
|||
<tempfile prefix="gfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/> |
|||
<copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/> |
|||
<!-- The doctype triggers resolution which can fail --> |
|||
<replace file="${temp.sun.web}"> |
|||
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken> |
|||
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue> |
|||
</replace> |
|||
<replace file="${temp.sun.web}"> |
|||
<replacetoken><![CDATA[<sun-web-app]]></replacetoken> |
|||
<replacevalue><![CDATA[--> <sun-web-app]]></replacevalue> |
|||
</replace> |
|||
<xmlproperty file="${temp.sun.web}" validate="false"> |
|||
</xmlproperty> |
|||
<delete file="${temp.sun.web}"/> |
|||
<condition property="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}" else="${gfv3.url}/${ant.project.name}"> |
|||
<isset property="sun-web-app.context-root"/> |
|||
</condition> |
|||
<condition property="deploy.context.root.argument" value="&contextroot=${sun-web-app.context-root}" else="/${ant.project.name}"> |
|||
<isset property="sun-web-app.context-root"/> |
|||
</condition> |
|||
</target> |
|||
<target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present"> |
|||
<tempfile prefix="gfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/> |
|||
<copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/> |
|||
<!-- The doctype triggers resolution which can fail --> |
|||
<replace file="${temp.gf.web}"> |
|||
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken> |
|||
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue> |
|||
</replace> |
|||
<replace file="${temp.gf.web}"> |
|||
<replacetoken><![CDATA[<glassfish-web-app]]></replacetoken> |
|||
<replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue> |
|||
</replace> |
|||
<xmlproperty file="${temp.gf.web}" validate="false"> |
|||
</xmlproperty> |
|||
<delete file="${temp.gf.web}"/> |
|||
<condition property="deploy.ant.client.url" value="${gfv3.url}${glassfish-web-app.context-root}" else="${gfv3.url}/${ant.project.name}"> |
|||
<isset property="glassfish-web-app.context-root"/> |
|||
</condition> |
|||
<condition property="deploy.context.root.argument" value="&contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}"> |
|||
<isset property="glassfish-web-app.context-root"/> |
|||
</condition> |
|||
</target> |
|||
<target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present"> |
|||
<property name="deploy.context.root.argument" value=""/> |
|||
</target> |
|||
<target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup"> |
|||
<tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/> |
|||
<mkdir dir="${gfv3.resources.dir}"/> |
|||
<mkdir dir="${gfv3.resources.dir}/META-INF"/> |
|||
<copy todir="${gfv3.resources.dir}/META-INF"> |
|||
<fileset dir="${deploy.ant.resource.dir}"/> |
|||
</copy> |
|||
<jar destfile="${deploy.ant.archive}" update="true"> |
|||
<fileset dir="${gfv3.resources.dir}"/> |
|||
</jar> |
|||
<delete dir="${gfv3.resources.dir}"/> |
|||
</target> |
|||
<target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled"> |
|||
<antcall target="-deploy-without-pw"/> |
|||
<antcall target="-deploy-with-pw"/> |
|||
</target> |
|||
|
|||
<target name="-deploy-without-pw" unless="gfv3.password"> |
|||
<echo message="Deploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> |
|||
<get src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-deploy-with-pw" if="gfv3.password"> |
|||
<echo message="Deploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> |
|||
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled"> |
|||
<antcall target="-undeploy-without-pw"/> |
|||
<antcall target="-undeploy-with-pw"/> |
|||
</target> |
|||
|
|||
<target name="-undeploy-without-pw" unless="gfv3.password"> |
|||
<echo message="Undeploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<get src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-undeploy-with-pw" if="gfv3.password"> |
|||
<echo message="Undeploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
</project> |
File diff suppressed because it is too large
@ -0,0 +1,8 @@ |
|||
build.xml.data.CRC32=0499affd |
|||
build.xml.script.CRC32=3bf2a027 |
|||
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=0499affd |
|||
nbproject/build-impl.xml.script.CRC32=a23c42c9 |
|||
nbproject/build-impl.xml.stylesheet.CRC32=334708a0@1.96.0.1 |
@ -0,0 +1,94 @@ |
|||
annotation.processing.enabled=true |
|||
annotation.processing.enabled.in.editor=true |
|||
annotation.processing.processors.list= |
|||
annotation.processing.run.all.processors=true |
|||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output |
|||
auxiliary.org-netbeans-modules-projectapi.jsf_2e_language=Facelets |
|||
build.classes.dir=${build.web.dir}/WEB-INF/classes |
|||
build.classes.excludes=**/*.java,**/*.form |
|||
build.dir=build |
|||
build.generated.dir=${build.dir}/generated |
|||
build.generated.sources.dir=${build.dir}/generated-sources |
|||
build.test.classes.dir=${build.dir}/test/classes |
|||
build.test.results.dir=${build.dir}/test/results |
|||
build.web.dir=${build.dir}/web |
|||
build.web.excludes=${build.classes.excludes} |
|||
client.urlPart= |
|||
compile.jsps=false |
|||
conf.dir=${source.root}/conf |
|||
debug.classpath=${build.classes.dir}:${javac.classpath} |
|||
debug.test.classpath=\ |
|||
${run.test.classpath} |
|||
display.browser=true |
|||
# Files to be excluded from distribution war |
|||
dist.archive.excludes= |
|||
dist.dir=dist |
|||
dist.ear.war=${dist.dir}/${war.ear.name} |
|||
dist.javadoc.dir=${dist.dir}/javadoc |
|||
dist.war=${dist.dir}/${war.name} |
|||
endorsed.classpath=\ |
|||
${libs.javaee-endorsed-api-7.0.classpath} |
|||
excludes= |
|||
file.reference.primefaces-12.0.0.jar=C:\\Users\\chore\\Downloads\\primefaces-12.0.0.jar |
|||
includes=** |
|||
j2ee.compile.on.save=true |
|||
j2ee.copy.static.files.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 |
|||
javac.classpath=\ |
|||
${reference.si-ejb.dist}:\ |
|||
${file.reference.primefaces-12.0.0.jar} |
|||
# Space-separated list of extra javac options |
|||
javac.compilerargs= |
|||
javac.debug=true |
|||
javac.deprecation=false |
|||
javac.processorpath=\ |
|||
${javac.classpath} |
|||
javac.source=1.7 |
|||
javac.target=1.7 |
|||
javac.test.classpath=\ |
|||
${javac.classpath}:\ |
|||
${build.classes.dir} |
|||
javac.test.processorpath=\ |
|||
${javac.test.classpath} |
|||
javadoc.additionalparam= |
|||
javadoc.author=false |
|||
javadoc.encoding=${source.encoding} |
|||
javadoc.noindex=false |
|||
javadoc.nonavbar=false |
|||
javadoc.notree=false |
|||
javadoc.preview=true |
|||
javadoc.private=false |
|||
javadoc.splitindex=true |
|||
javadoc.use=true |
|||
javadoc.version=false |
|||
javadoc.windowtitle= |
|||
lib.dir=${web.docbase.dir}/WEB-INF/lib |
|||
persistence.xml.dir=${conf.dir} |
|||
platform.active=JDK_21 |
|||
project.si-ejb=../si-ejb |
|||
reference.si-ejb.dist=${project.si-ejb}/dist/si-ejb.jar |
|||
resource.dir=setup |
|||
run.test.classpath=\ |
|||
${javac.test.classpath}:\ |
|||
${build.test.classes.dir} |
|||
# Space-separated list of JVM arguments used when running a class with a main method or a unit test |
|||
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): |
|||
runmain.jvmargs= |
|||
source.encoding=UTF-8 |
|||
source.root=src |
|||
src.dir=${source.root}/java |
|||
test.src.dir=test |
|||
war.content.additional= |
|||
war.ear.name=${war.name} |
|||
war.name=si-war.war |
|||
web.docbase.dir=web |
|||
webinf.dir=web/WEB-INF |
@ -0,0 +1,37 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://www.netbeans.org/ns/project/1"> |
|||
<type>org.netbeans.modules.web.project</type> |
|||
<configuration> |
|||
<data xmlns="http://www.netbeans.org/ns/web-project/3"> |
|||
<name>si-war</name> |
|||
<minimum-ant-version>1.6.5</minimum-ant-version> |
|||
<explicit-platform explicit-source-supported="true"/> |
|||
<web-module-libraries> |
|||
<library dirs="100"> |
|||
<file>${reference.si-ejb.dist}</file> |
|||
</library> |
|||
<library dirs="200"> |
|||
<file>${file.reference.primefaces-12.0.0.jar}</file> |
|||
<path-in-war>WEB-INF/lib</path-in-war> |
|||
</library> |
|||
</web-module-libraries> |
|||
<web-module-additional-libraries/> |
|||
<source-roots> |
|||
<root id="src.dir"/> |
|||
</source-roots> |
|||
<test-roots> |
|||
<root id="test.src.dir"/> |
|||
</test-roots> |
|||
</data> |
|||
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1"> |
|||
<reference> |
|||
<foreign-project>si-ejb</foreign-project> |
|||
<artifact-type>jar</artifact-type> |
|||
<script>build.xml</script> |
|||
<target>dist</target> |
|||
<clean-target>clean</clean-target> |
|||
<id>dist</id> |
|||
</reference> |
|||
</references> |
|||
</configuration> |
|||
</project> |
@ -0,0 +1,2 @@ |
|||
Manifest-Version: 1.0 |
|||
|
@ -0,0 +1,115 @@ |
|||
/* |
|||
* 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 hola.vista; |
|||
|
|||
import hola.BL.DepartamentoBLLocal; |
|||
import hola.modelo.Departamento; |
|||
import hola.modelo.Producto; |
|||
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 org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author eduar |
|||
*/ |
|||
@Named(value = "demoBeanDepartamento") |
|||
@SessionScoped |
|||
public class DemoBeanDepartamento implements Serializable { |
|||
@EJB |
|||
private DepartamentoBLLocal departamentoBL; |
|||
/** |
|||
* Creates a new instance of DemoBeanDepartamento |
|||
*/ |
|||
public DemoBeanDepartamento() { |
|||
} |
|||
|
|||
private Departamento departamento = new Departamento(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
|
|||
private List<Departamento> filteredCustomers3; |
|||
|
|||
public List<Departamento> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Departamento> 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; |
|||
} |
|||
//BUSCADOR DE CADA CAMPO
|
|||
Departamento customer = (Departamento) value; |
|||
return customer.getNombre().toLowerCase().contains(filterText) |
|||
|| customer.getAnaquel().toLowerCase().contains(filterText); |
|||
} |
|||
|
|||
|
|||
|
|||
public String agregarDepartamento() { |
|||
|
|||
departamento.setStatus(1); |
|||
departamentoBL.agregar(departamento); |
|||
return "Departamento.xhtml"; |
|||
} |
|||
|
|||
public List<Departamento> getDepartamentos() { |
|||
return departamentoBL.buscarValidos(true); |
|||
} |
|||
|
|||
public Departamento getDepartamento() { |
|||
return departamento; |
|||
} |
|||
|
|||
public void setDepartamento(Departamento departamento) { |
|||
this.departamento = departamento; |
|||
} |
|||
|
|||
public void prepararEditar(Departamento departamento) { |
|||
nuevo = false; |
|||
titulo = "Editar Departamento"; |
|||
this.departamento = departamento; |
|||
|
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void prepararNuevo() { |
|||
nuevo = true; |
|||
titulo = "Agregar departameto"; |
|||
departamento = new Departamento(); |
|||
} |
|||
|
|||
public void editarDepartamento() { |
|||
|
|||
departamentoBL.editar(departamento); |
|||
|
|||
} |
|||
|
|||
public void prepararEliminar(Departamento departamento) { |
|||
this.departamento = departamento; |
|||
} |
|||
|
|||
public void eliminarDepartamento() { |
|||
departamentoBL.eliminarId(departamento); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,125 @@ |
|||
/* |
|||
* 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 hola.vista; |
|||
|
|||
import hola.BL.EstadoBLLocal; |
|||
import hola.modelo.Estado; |
|||
import hola.msg.Mensaje; |
|||
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 org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Named(value = "demoBeanEstado") |
|||
@SessionScoped |
|||
public class DemoBeanEstado implements Serializable { |
|||
|
|||
@EJB |
|||
private EstadoBLLocal estadodBL; |
|||
/** |
|||
* Creates a new instance of DemoBeanEstado |
|||
*/ |
|||
public DemoBeanEstado() { |
|||
} |
|||
private Estado estado = new Estado(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
|
|||
private List<Estado> filteredCustomers3; |
|||
|
|||
public List<Estado> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Estado> 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; |
|||
} |
|||
//BUSCADOR DE CADA CAMPO
|
|||
Estado customer = (Estado) value; |
|||
return customer.getNombre().toLowerCase().contains(filterText); |
|||
} |
|||
|
|||
public String agregarUsuario() { |
|||
|
|||
estado.setStatus(1); |
|||
// limpiarFormulario();
|
|||
Mensaje mensaje = estadodBL.agregar(estado); |
|||
|
|||
switch (mensaje) { |
|||
case SIN_ERROR: |
|||
estado = new Estado(); |
|||
return "Estado.xhtml";//"productoLista?faces-redirect=true"; // Redirecciona a la lista de productos
|
|||
case ELEMENTO_DUPLICADO: |
|||
return null; |
|||
case CAMPOS_INCOMPLETOS: |
|||
return null; |
|||
case DATOS_INCORRECTOS: |
|||
return null; |
|||
default: |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
|
|||
public List<Estado> getEstados() { |
|||
return estadodBL.buscarValidos(true); |
|||
} |
|||
|
|||
public Estado getTEstado() { |
|||
return estado; |
|||
} |
|||
|
|||
public void setEstado(Estado estado) { |
|||
this.estado = estado; |
|||
} |
|||
|
|||
public void prepararEditar(Estado estado) { |
|||
nuevo = false; |
|||
titulo = "Editar usuario"; |
|||
this.estado = estado; |
|||
|
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void preparar() { |
|||
nuevo = true; |
|||
titulo = "Agregar Estado"; |
|||
estado = new Estado(); |
|||
} |
|||
|
|||
public void editarEstado() { |
|||
|
|||
estadodBL.editar(estado); |
|||
|
|||
} |
|||
|
|||
public void prepararEliminar(Estado estado) { |
|||
this.estado = estado; |
|||
} |
|||
|
|||
public void eliminaEstado() { |
|||
estadodBL.eliminarId(estado); |
|||
} |
|||
} |
@ -0,0 +1,99 @@ |
|||
/* |
|||
* 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 hola.vista; |
|||
|
|||
import hola.BL.MarcaBLLocal; |
|||
import hola.modelo.Marca; |
|||
import hola.msg.Mensaje; |
|||
import javax.inject.Named; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import javax.ejb.EJB; |
|||
|
|||
/** |
|||
* |
|||
* @author Josue |
|||
*/ |
|||
@Named(value = "demoBeanMarca") |
|||
@SessionScoped |
|||
public class DemoBeanMarca implements Serializable { |
|||
|
|||
@EJB |
|||
private MarcaBLLocal marcaBL; |
|||
|
|||
/** |
|||
* Creates a new instance of DemoBeanMarca |
|||
*/ |
|||
public DemoBeanMarca() { |
|||
} |
|||
|
|||
private Marca marca = new Marca(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
|
|||
public String agregarMarca() { |
|||
|
|||
marca.setStatus(1); |
|||
Mensaje m = marcaBL.agregar(marca); |
|||
switch (m) { |
|||
case ELEMENTO_DUPLICADO: |
|||
|
|||
return null; |
|||
case SIN_ERROR: |
|||
|
|||
return "Marca.xhtml"; |
|||
|
|||
default: |
|||
return null; |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
public List<Marca> getMarcas() { |
|||
return marcaBL.buscarValidos(true); |
|||
} |
|||
|
|||
public Marca getMarca() { |
|||
return marca; |
|||
} |
|||
|
|||
public void setMarca(Marca marca) { |
|||
this.marca = marca; |
|||
} |
|||
|
|||
public void prepararEditar(Marca marca) { |
|||
nuevo = false; |
|||
titulo = "Editando marca"; |
|||
this.marca = marca; |
|||
|
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void preparar() { |
|||
nuevo = true; |
|||
titulo = "Agregando marca"; |
|||
marca = new Marca(); |
|||
} |
|||
|
|||
public void editarMarca() { |
|||
|
|||
marcaBL.editar(marca); |
|||
|
|||
} |
|||
|
|||
public void prepararEliminar(Marca marca) { |
|||
this.marca = marca; |
|||
} |
|||
|
|||
public void eliminarTipo() { |
|||
marcaBL.eliminarId(marca); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,127 @@ |
|||
/* |
|||
* 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 hola.vista; |
|||
|
|||
import hola.BL.PaisLocal; |
|||
import hola.modelo.Pais; |
|||
import hola.msg.Mensaje; |
|||
import static hola.msg.Mensaje.CAMPOS_INCOMPLETOS; |
|||
import static hola.msg.Mensaje.DATOS_INCORRECTOS; |
|||
import static hola.msg.Mensaje.ELEMENTO_DUPLICADO; |
|||
import static hola.msg.Mensaje.SIN_ERROR; |
|||
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 org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author eduar |
|||
*/ |
|||
@Named(value = "demoBeanPais") |
|||
@SessionScoped |
|||
public class DemoBeanPais implements Serializable { |
|||
|
|||
@EJB |
|||
private PaisLocal paisBL; |
|||
|
|||
public DemoBeanPais() { |
|||
} |
|||
private Pais pais = new Pais(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
|
|||
private List<Pais> filteredCustomers3; |
|||
|
|||
public List<Pais> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Pais> 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; |
|||
} |
|||
//BUSCADOR DE CADA CAMPO
|
|||
Pais customer = (Pais) value; |
|||
return customer.getNombre().toLowerCase().contains(filterText); |
|||
} |
|||
|
|||
public String agregarPais() { |
|||
|
|||
pais.setStatus(1); |
|||
// limpiarFormulario();
|
|||
Mensaje mensaje = paisBL.agregar(pais); |
|||
|
|||
switch (mensaje) { |
|||
case SIN_ERROR: |
|||
pais = new Pais(); |
|||
return "Pais.xhtml";//"productoLista?faces-redirect=true"; // Redirecciona a la lista de productos
|
|||
case ELEMENTO_DUPLICADO: |
|||
return null; |
|||
case CAMPOS_INCOMPLETOS: |
|||
return null; |
|||
case DATOS_INCORRECTOS: |
|||
return null; |
|||
default: |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
|
|||
public List<Pais> getPaises() { |
|||
return paisBL.buscarValidos(true); |
|||
} |
|||
|
|||
public Pais getPais() { |
|||
return pais; |
|||
} |
|||
|
|||
public void setPais(Pais pais) { |
|||
this.pais = pais; |
|||
} |
|||
|
|||
public void prepararEditar(Pais pais) { |
|||
nuevo = false; |
|||
titulo = "Editar paises"; |
|||
this.pais = pais; |
|||
|
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void preparar() { |
|||
nuevo = true; |
|||
titulo = "Agregar Pais"; |
|||
pais = new Pais(); |
|||
} |
|||
|
|||
public void editarPais() { |
|||
paisBL.editar(pais); |
|||
|
|||
} |
|||
|
|||
public void prepararEliminar(Pais pais) { |
|||
this.pais = pais; |
|||
} |
|||
|
|||
public void eliminaPais() { |
|||
paisBL.eliminarId(pais); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,121 @@ |
|||
/* |
|||
* 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 hola.vista; |
|||
|
|||
import hola.BL.ProductoBLLocal; |
|||
import hola.modelo.Producto; |
|||
import hola.modelo.Tipo; |
|||
import hola.modelo.Usuario; |
|||
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 org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author eduar |
|||
*/ |
|||
@Named(value = "demoBeanProducto") |
|||
@SessionScoped |
|||
public class DemoBeanProducto implements Serializable { |
|||
|
|||
@EJB |
|||
private ProductoBLLocal productoBL; |
|||
|
|||
/** |
|||
* Creates a new instance of producto |
|||
*/ |
|||
public DemoBeanProducto() { |
|||
} |
|||
|
|||
private Producto producto = new Producto(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
|
|||
private List<Producto> filteredCustomers3; |
|||
|
|||
public List<Producto> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Producto> 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; |
|||
} |
|||
//BUSCADOR DE CADA CAMPO
|
|||
Producto customer = (Producto) value; |
|||
return customer.getNombre().toLowerCase().contains(filterText) |
|||
|| customer.getCantidad().toLowerCase().contains(filterText) |
|||
|| customer.getPrecio()<=0 |
|||
|| customer.getCodigoBarras().toLowerCase().contains(filterText) |
|||
|| customer.getMedida()<=0 |
|||
|| customer.getLote().toLowerCase().contains(filterText); |
|||
} |
|||
|
|||
public String agregarProducto() { |
|||
|
|||
producto.setStatus(1); |
|||
productoBL.agregar(producto); |
|||
return "Producto.xhtml"; |
|||
} |
|||
|
|||
public List<Producto> getProductos() { |
|||
return productoBL.buscarValidos(true); |
|||
} |
|||
|
|||
// public Producto getProducto() {
|
|||
// return DemoBeanProducto;
|
|||
// }
|
|||
public Producto getProducto() { |
|||
return producto; |
|||
} |
|||
|
|||
public void setProducto(Producto producto) { |
|||
this.producto = producto; |
|||
} |
|||
|
|||
public void prepararEditar(Producto producto) { |
|||
nuevo = false; |
|||
titulo = "Editar de Producto"; |
|||
this.producto = producto; |
|||
|
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void prepararNuevo() { |
|||
nuevo = true; |
|||
titulo = "Agregar Producto"; |
|||
producto = new Producto(); |
|||
} |
|||
|
|||
public void editarProducto() { |
|||
|
|||
productoBL.editar(producto); |
|||
|
|||
} |
|||
|
|||
public void prepararEliminar(Producto producto) { |
|||
this.producto = producto; |
|||
} |
|||
|
|||
public void eliminarProducto() { |
|||
productoBL.eliminarId(producto); |
|||
} |
|||
} |
@ -0,0 +1,89 @@ |
|||
package hola.vista; |
|||
|
|||
import hola.BL.ProvedorBLLocal; |
|||
import hola.modelo.Provedor; |
|||
|
|||
import javax.inject.Named; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import javax.ejb.EJB; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
@Named(value = "demoBeanProvedor") |
|||
@SessionScoped |
|||
public class DemoBeanProvedor implements Serializable { |
|||
|
|||
@EJB |
|||
private ProvedorBLLocal provedorBLLocal; |
|||
|
|||
private Provedor provedor = new Provedor(); // Proveedor actual en el formulario
|
|||
private String titulo; // Título para mostrar en el formulario
|
|||
private boolean nuevo; // Indicador de nuevo provedor o edición
|
|||
|
|||
// Constructor por defecto
|
|||
public DemoBeanProvedor() { |
|||
} |
|||
|
|||
// Método para agregar un nuevo provedor
|
|||
public String agregarProveedor() { |
|||
// Configura el provedor con los datos del formulario
|
|||
provedor.setStatus(1); // Estado activo por defecto (puedes cambiar esto según tu lógica)
|
|||
provedorBLLocal.agregar(provedor); // Llama al método de la capa de negocio para agregar el provedor
|
|||
limpiarFormulario(); // Limpia el formulario después de agregar
|
|||
return "Provedor.xhtml"; // Navega de regreso a la página de proveedores
|
|||
} |
|||
|
|||
// Método para obtener la lista de proveedores válidos
|
|||
public List<Provedor> getProvedores() { |
|||
return provedorBLLocal.buscarValidos(true); // Busca y devuelve la lista de proveedores activos
|
|||
} |
|||
|
|||
// Otros métodos de acceso y manipulación de proveedores...
|
|||
|
|||
// Métodos para limpiar y preparar el formulario
|
|||
private void limpiarFormulario() { |
|||
provedor = new Provedor(); // Crea un nuevo objeto provedor para limpiar el formulario
|
|||
} |
|||
|
|||
// Getters y setters para los campos del formulario y propiedades del bean
|
|||
public Provedor getProvedor() { |
|||
return provedor; |
|||
} |
|||
|
|||
public void setProvedor(Provedor provedor) { |
|||
this.provedor = provedor; |
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void prepararNuevo() { |
|||
nuevo = true; |
|||
titulo = "Agregando provedor"; |
|||
limpiarFormulario(); // Limpia el formulario para agregar un nuevo provedor
|
|||
} |
|||
|
|||
public void prepararEditar(Provedor provedor) { |
|||
nuevo = false; |
|||
titulo = "Editando provedor"; |
|||
this.provedor = provedor; // Establece el provedor seleccionado para editar
|
|||
} |
|||
|
|||
public void prepararEliminar(Provedor provedor) { |
|||
this.provedor = provedor; |
|||
} |
|||
|
|||
public void editarProvedor() { |
|||
provedorBLLocal.editar(provedor); // Llama al método de la capa de negocio para editar el provedor
|
|||
limpiarFormulario(); // Limpia el formulario después de editar
|
|||
} |
|||
|
|||
public void eliminarProvedor() { |
|||
provedorBLLocal.eliminarId(provedor); // Llama al método de la capa de negocio para eliminar el provedor
|
|||
} |
|||
} |
@ -0,0 +1,126 @@ |
|||
/* |
|||
* 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 hola.vista; |
|||
|
|||
import hola.BL.RolBLLocal; |
|||
import hola.modelo.Rol; |
|||
import hola.msg.Mensaje; |
|||
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 org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Named(value = "demoBeanRol") |
|||
@SessionScoped |
|||
public class DemoBeanRol implements Serializable { |
|||
|
|||
@EJB |
|||
private RolBLLocal rolBL; |
|||
/** |
|||
* Creates a new instance of DemoBeanRol |
|||
*/ |
|||
public DemoBeanRol() { |
|||
} |
|||
private Rol rol = new Rol(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
|
|||
private List<Rol> filteredCustomers3; |
|||
|
|||
public List<Rol> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Rol> 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; |
|||
} |
|||
//BUSCADOR DE CADA CAMPO
|
|||
Rol customer = (Rol) value; |
|||
return customer.getNombre().toLowerCase().contains(filterText); |
|||
} |
|||
|
|||
public String agregarRol() { |
|||
|
|||
rol.setStatus(1); |
|||
rolBL.agregar(rol); |
|||
// limpiarFormulario();
|
|||
Mensaje mensaje = rolBL.agregar(rol); |
|||
|
|||
switch (mensaje) { |
|||
case SIN_ERROR: |
|||
rol = new Rol(); |
|||
return "menu.xhtml";//"productoLista?faces-redirect=true"; // Redirecciona a la lista de productos
|
|||
case ELEMENTO_DUPLICADO: |
|||
return null; |
|||
case CAMPOS_INCOMPLETOS: |
|||
return null; |
|||
case DATOS_INCORRECTOS: |
|||
return null; |
|||
default: |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
|
|||
public List<Rol> getRols() { |
|||
return rolBL.buscarValidos(true); |
|||
} |
|||
|
|||
public Rol getRol() { |
|||
return rol; |
|||
} |
|||
|
|||
public void setRol(Rol rol) { |
|||
this.rol = rol; |
|||
} |
|||
|
|||
public void prepararEditar(Rol rol) { |
|||
nuevo = false; |
|||
titulo = "Editar rol"; |
|||
this.rol = rol; |
|||
|
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void preparar() { |
|||
nuevo = true; |
|||
titulo = "Agregar Rol"; |
|||
rol = new Rol(); |
|||
} |
|||
|
|||
public void editarRol() { |
|||
|
|||
rolBL.editar(rol); |
|||
|
|||
} |
|||
|
|||
public void prepararEliminar(Rol rol) { |
|||
this.rol = rol; |
|||
} |
|||
|
|||
public void eliminaRol() { |
|||
rolBL.eliminarId(rol); |
|||
} |
|||
} |
@ -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 hola.vista; |
|||
|
|||
import hola.BL.TipoBLLocal; |
|||
import hola.modelo.Tipo; |
|||
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 org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Named(value = "demoBeanTipo") |
|||
@SessionScoped |
|||
|
|||
public class DemoBeanTipo implements Serializable { |
|||
|
|||
@EJB |
|||
private TipoBLLocal tipoBL; |
|||
|
|||
/** |
|||
* Creates a new instance of DemoBeanTipo |
|||
*/ |
|||
public DemoBeanTipo() { |
|||
} |
|||
|
|||
private Tipo tipo = new Tipo(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
|
|||
private List<Tipo> filteredCustomers3; |
|||
|
|||
public List<Tipo> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Tipo> 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; |
|||
} |
|||
|
|||
Tipo customer = (Tipo) value; |
|||
return customer.getNombre().toLowerCase().contains(filterText); |
|||
} |
|||
|
|||
public String agregarTipo() { |
|||
|
|||
tipo.setStatus(1); |
|||
tipoBL.agregar(tipo); |
|||
return "Tipo.xhtml"; |
|||
} |
|||
|
|||
public List<Tipo> getTipos() { |
|||
return tipoBL.buscarValidos(true); |
|||
} |
|||
|
|||
public Tipo getTipo() { |
|||
return tipo; |
|||
} |
|||
|
|||
public void setTipo(Tipo tipo) { |
|||
this.tipo = tipo; |
|||
} |
|||
|
|||
public void prepararEditar(Tipo tipo) { |
|||
nuevo = false; |
|||
titulo = "Editar Tipo"; |
|||
this.tipo = tipo; |
|||
|
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void preparar() { |
|||
nuevo = true; |
|||
titulo = "Agregar Tipo"; |
|||
tipo = new Tipo(); |
|||
} |
|||
|
|||
public void editarTipo() { |
|||
|
|||
tipoBL.editar(tipo); |
|||
|
|||
} |
|||
|
|||
public void prepararEliminar(Tipo tipo) { |
|||
this.tipo = tipo; |
|||
} |
|||
|
|||
public void eliminarTipo() { |
|||
tipoBL.eliminarId(tipo); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,131 @@ |
|||
/* |
|||
* 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 hola.vista; |
|||
|
|||
import hola.BL.UsuarioBLLocal; |
|||
import hola.modelo.Usuario; |
|||
import hola.msg.Mensaje; |
|||
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 org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author chore |
|||
*/ |
|||
@Named(value = "demoBeanUsuario") |
|||
@SessionScoped |
|||
public class DemoBeanUsuario implements Serializable { |
|||
|
|||
@EJB |
|||
private UsuarioBLLocal usuarioBL; |
|||
/** |
|||
* Creates a new instance of DemoBeanUsuario |
|||
*/ |
|||
public DemoBeanUsuario() { |
|||
} |
|||
|
|||
private Usuario usuario = new Usuario(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
|
|||
private List<Usuario> filteredCustomers3; |
|||
|
|||
public List<Usuario> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Usuario> 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; |
|||
} |
|||
//BUSCADOR DE CADA CAMPO
|
|||
Usuario customer = (Usuario) value; |
|||
return customer.getNombre().toLowerCase().contains(filterText) |
|||
|| customer.getTelefono().toLowerCase().contains(filterText) |
|||
|| customer.getCorreo().toLowerCase().contains(filterText) |
|||
|| customer.getDireccion().toLowerCase().contains(filterText); |
|||
} |
|||
|
|||
public String agregarUsuario() { |
|||
|
|||
usuario.setStatus(1); |
|||
usuarioBL.agregar(usuario); |
|||
// limpiarFormulario();
|
|||
Mensaje mensaje = usuarioBL.agregar(usuario); |
|||
|
|||
switch (mensaje) { |
|||
case SIN_ERROR: |
|||
usuario = new Usuario(); |
|||
return "Usuario.xhtml";//"productoLista?faces-redirect=true"; // Redirecciona a la lista de productos
|
|||
case ELEMENTO_DUPLICADO: |
|||
return null; |
|||
case CAMPOS_INCOMPLETOS: |
|||
return null; |
|||
case DATOS_INCORRECTOS: |
|||
return null; |
|||
default: |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
|
|||
public List<Usuario> getUsuarios() { |
|||
return usuarioBL.buscarValidos(true); |
|||
} |
|||
|
|||
public Usuario getTUsuario() { |
|||
return usuario; |
|||
} |
|||
|
|||
public void setUsuario(Usuario usuario) { |
|||
this.usuario = usuario; |
|||
} |
|||
|
|||
public void prepararEditar(Usuario usuario) { |
|||
nuevo = false; |
|||
titulo = "Editar usuario"; |
|||
this.usuario = usuario; |
|||
|
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void preparar() { |
|||
nuevo = true; |
|||
titulo = "Agregar Usuario"; |
|||
usuario = new Usuario(); |
|||
} |
|||
|
|||
public void editarUsuario() { |
|||
|
|||
usuarioBL.editar(usuario); |
|||
|
|||
} |
|||
|
|||
public void prepararEliminar(Usuario usuario) { |
|||
this.usuario = usuario; |
|||
} |
|||
|
|||
public void eliminaUsuario() { |
|||
usuarioBL.eliminarId(usuario); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,38 @@ |
|||
/* |
|||
* 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 hola.vista; |
|||
|
|||
import java.io.IOException; |
|||
import javax.annotation.ManagedBean; |
|||
import javax.faces.application.FacesMessage; |
|||
import javax.faces.bean.ViewScoped; |
|||
import javax.faces.context.FacesContext; |
|||
|
|||
@ManagedBean |
|||
@ViewScoped |
|||
public class SelectOneButtonView { |
|||
|
|||
private String option; |
|||
|
|||
public String getOption() { |
|||
return option; |
|||
} |
|||
|
|||
public void setOption(String option) { |
|||
this.option = option; |
|||
} |
|||
|
|||
public void navigateToPage() { |
|||
if (option != null) { |
|||
try { |
|||
FacesContext.getCurrentInstance().getExternalContext().redirect(option); |
|||
} catch (IOException e) { |
|||
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error", "Error al redireccionar a la página."); |
|||
FacesContext.getCurrentInstance().addMessage(null, message); |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,90 @@ |
|||
/* |
|||
* 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 hola.vista; |
|||
|
|||
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; |
|||
|
|||
/** |
|||
* |
|||
* @author eduar |
|||
*/ |
|||
@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<Object> elements = (List<Object>) 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); |
|||
} |
|||
} |
@ -0,0 +1,121 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
<center> |
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
<ui:define name="left"> |
|||
<div class="card"> |
|||
<h:form> |
|||
<p:growl id="messages"/> |
|||
|
|||
<p:menubar> |
|||
<p:menuitem value="Agregar" icon="pi pi-fw pi-plus" |
|||
action="DepartamentoCrear.xhtml" |
|||
actionListener="#{demoBeanDepartamento.prepararNuevo()}"/> |
|||
|
|||
|
|||
<p:menuitem value="Departamento" icon="pi pi-fw pi-building" disabled="true" action="Departamento.xhtml"/> |
|||
<p:menuitem value="Marca" icon="pi pi-fw pi-tag" action="Marca.xhtml"/> |
|||
<p:menuitem value="Producto" icon="pi pi-fw pi-shopping-bag" action="Producto.xhtml"/> |
|||
<p:menuitem value="Proveedor" icon="pi pi-fw pi-truck" action="Provedor.xhtml"/> |
|||
<p:menuitem value="Registro" icon="pi pi-fw pi-book " action="Registro.xhtml"/> |
|||
<p:menuitem value="Tipo" icon="pi pi-fw pi-table" action="Tipo.xhtml"/> |
|||
<p:menuitem value="Usuario" icon="pi pi-fw pi-user" action="Usuario.xhtml"/> |
|||
<p:menuitem value="Inicio" icon="pi pi-fw pi-home" action="Menu.xhtml"/> |
|||
|
|||
<p:divider layout="vertical"/> |
|||
</p:menubar> |
|||
</h:form> |
|||
</div> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
|
|||
<h3><h:outputText value="Departamentos"/></h3> |
|||
|
|||
<p:dataTable value="#{demoBeanDepartamento.departamentos}" var="item" |
|||
widgetVar="departamentos" |
|||
emptyMessage="No coincide con ningun registro" |
|||
filteredValue="#{demoBeanDepartamento.filteredCustomers3}" |
|||
globalFilterFunction="#{demoBeanDepartamento.globalFilterFunction}"> |
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end" style="position: absolute; right: 40px; top: 190px; "> |
|||
<p:inputText id="globalFilter" onkeyup="PF('departamentos').filter()" style="width:300px" |
|||
placeholder="Buscar" /> |
|||
</div> |
|||
</f:facet> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Anaquel"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.anaquel}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1 ? 'activo':'Inactivo'}"/> |
|||
</p:column> |
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
<p:commandButton action="DepartamentoCrear.xhtml" icon="pi pi-fw pi-pencil" |
|||
actionListener="#{demoBeanDepartamento.prepararEditar(item)}" |
|||
style="padding: 2px 8px; font-size: 11px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
value="Editar" |
|||
ajax="false"/> |
|||
<p:commandButton action="DepartamentoEliminar.xhtml" icon="pi pi-fw pi-trash" |
|||
actionListener="#{demoBeanDepartamento.prepararEliminar(item)}" |
|||
value="Eliminar" |
|||
style=" padding: 2px 8px; font-size: 11px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
ajax="false"/> |
|||
|
|||
|
|||
</p:column> |
|||
</p:dataTable> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
</ui:composition> |
|||
</center> |
|||
</body> |
|||
</html> |
@ -0,0 +1,86 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
<center> |
|||
|
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
Sistemas de Inventario |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<f:view> |
|||
|
|||
<h:form> |
|||
<h1><h:outputText value="#{demoBeanDepartamento.titulo}"/></h1> |
|||
<h:panelGrid columns="3"> |
|||
|
|||
<p:outputLabel for="nombre" value="Nombre:"/> |
|||
<p:inputText id="nombre" value="#{demoBeanDepartamento.departamento.nombre}" |
|||
title="Nombre" required="true" |
|||
requiredMessage="El campo nombre es obligatorio" |
|||
validatorMessage="El campo nombre solo letras un máximo 15 letras"> |
|||
<f:validateRegex pattern="[a-zA-Z ]+" /> |
|||
<f:validateLength minimum="3" maximum="15" /> |
|||
</p:inputText> |
|||
<p:message for="nombre"/> |
|||
|
|||
<p:outputLabel for="anaquel" value="Anaquel:"/> |
|||
<p:inputText id="anaquel" value="#{demoBeanDepartamento.departamento.anaquel}" |
|||
title="Anaquel" required="true" |
|||
requiredMessage="El campo anaquel es obligatorio" |
|||
validatorMessage="El campo anaquel debe incluir una letra y un número"> |
|||
<f:validateRegex pattern="^[a-zA-Z]\d$" /> |
|||
<f:validateLength minimum="1" maximum="2" /> |
|||
</p:inputText> |
|||
<p:message for="anaquel"/> |
|||
</h:panelGrid> |
|||
<p:commandButton action="#{demoBeanDepartamento.agregarDepartamento()}" |
|||
icon="pi pi-fw pi-check" |
|||
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
|
|||
rendered="#{demoBeanDepartamento.nuevo}" |
|||
value="Agregar" |
|||
ajax="false"/> |
|||
|
|||
<p:commandButton action="Departamento.xhtml" |
|||
actionListener="#{demoBeanDepartamento.editarDepartamento()}" |
|||
icon="pi pi-fw pi-pencil" |
|||
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
|
|||
rendered="#{!demoBeanDepartamento.nuevo}" |
|||
value="Editar" |
|||
ajax="false"/> |
|||
|
|||
<p:commandButton action="Departamento.xhtml" icon="pi pi-fw pi-times" |
|||
value="Cancelar" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
|
|||
immediate="true" |
|||
ajax="false"/> |
|||
|
|||
</h:form> |
|||
</f:view> |
|||
</ui:define> |
|||
<ui:define name="bottom"> |
|||
</ui:define> |
|||
</ui:composition> |
|||
</center> |
|||
</body> |
|||
</html> |
@ -0,0 +1,65 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
<center> |
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
|
|||
|
|||
<h1><h:outputText value="Eliminar"/></h1> |
|||
<p:panelGrid columns="2"> |
|||
|
|||
<h:outputText value="Nombre:"/> |
|||
<h:outputText value="#{demoBeanDepartamento.departamento.nombre}" title="Nombre"/> |
|||
<h:outputText value="Anaquel:"/> |
|||
<h:outputText value="#{demoBeanDepartamento.departamento.anaquel}" title="Anaquel"/> |
|||
|
|||
<p:commandButton action="Departamento.xhtml" icon="pi pi-fw pi-trash" |
|||
actionListener="#{demoBeanDepartamento.eliminarDepartamento()}" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
value="Eliminar" |
|||
ajax="false"/> |
|||
<p:commandButton action="Departamento.xhtml" icon="pi pi-fw pi-times" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
value="Cancelar" |
|||
immediate="true" |
|||
ajax="false"/> |
|||
</p:panelGrid> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
|
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
</center> |
|||
</body> |
|||
</html> |
@ -0,0 +1,120 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
|
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<head> |
|||
<title>Marca</title> |
|||
</head> |
|||
|
|||
<body> |
|||
<center> |
|||
|
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
<div class="card"> |
|||
<h:form> |
|||
<p:growl id="messages"/> |
|||
|
|||
<p:menubar> |
|||
<p:menuitem value="Agregar" icon="pi pi-fw pi-plus" |
|||
action="MarcaCrear.xhtml" |
|||
actionListener="#{demoBeanMarca.preparar()}"/> |
|||
|
|||
<p:menuitem value="Departamento" icon="pi pi-fw pi-building " action="Departamento.xhtml"/> |
|||
<p:menuitem value="Marca" icon="pi pi-fw pi-tag" disabled="true" action="Marca.xhtml"/> |
|||
<p:menuitem value="Producto" icon="pi pi-fw pi-shopping-bag" action="Producto.xhtml"/> |
|||
<p:menuitem value="Proveedor" icon="pi pi-fw pi-truck" action="Provedor.xhtml"/> |
|||
<!-- comment <p:menuitem value="Registro" icon="pi pi-fw pi-book " disabled="true" action="Registro.xhtml"/> --> |
|||
<p:menuitem value="Tipo" icon="pi pi-fw pi-table" action="Tipo.xhtml"/> |
|||
<p:menuitem value="Usuario" icon="pi pi-fw pi-user" action="Usuario.xhtml"/> |
|||
<p:menuitem value="Inicio" icon="pi pi-fw pi-home" action="Menu.xhtml"/> |
|||
<p:divider layout="vertical"/> |
|||
</p:menubar> |
|||
</h:form> |
|||
</div> |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
|
|||
<h:form style="text-align: left; margin-top: 20px;"> |
|||
<div style="margin-bottom: 10px;"> |
|||
|
|||
</div> |
|||
</h:form> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
|
|||
<h3><h:outputText value="Marcas "/></h3> |
|||
|
|||
<p:dataTable value="#{demoBeanMarca.marcas}" var="item"> |
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end" style="position: absolute; right: 40px; top: 190px; "> |
|||
<p:inputText id="globalFilter" onkeyup="PF('usuarios').filter()" style="width:300px" |
|||
placeholder="Buscar" /> |
|||
</div> |
|||
</f:facet> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1 ? 'activo':'inactivo'}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
|
|||
<p:commandButton action="MarcaCrear.xhtml" |
|||
style="padding: 2px 8px; font-size: 11px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
actionListener="#{demoBeanMarca.prepararEditar(item)}" |
|||
value="Editar" |
|||
ajax="false"/> |
|||
<p:commandButton action="MarcaEliminar.xhtml" |
|||
style=" padding: 2px 8px; font-size: 11px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
actionListener="#{demoBeanMarca.prepararEliminar(item)}" |
|||
value="Eliminar" |
|||
ajax="false"/> |
|||
</p:column> |
|||
</p:dataTable> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
</center> |
|||
</body> |
|||
</html> |
@ -0,0 +1,80 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
<center> |
|||
|
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
<h1><h:outputText value="Create/Edit"/></h1> |
|||
<p:panelGrid columns="4"> |
|||
|
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{demoBeanMarca.marca.nombre}" |
|||
title="Nombre" |
|||
required="true"/> |
|||
<p:message for="nombre"/> |
|||
|
|||
</p:panelGrid> |
|||
|
|||
<p:commandButton action="#{demoBeanMarca.agregarMarca()}" |
|||
icon="pi pi-fw pi-check" |
|||
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
rendered="#{demoBeanMarca.nuevo}" |
|||
value="Agregar" |
|||
ajax="false" |
|||
/> |
|||
|
|||
|
|||
|
|||
<p:commandButton action="Marca.xhtml" |
|||
actionListener="#{demoBeanMarca.editarMarca()}" |
|||
icon="pi pi-fw pi-pencil" |
|||
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
rendered="#{!demoBeanMarca.nuevo}" |
|||
value="Editar" |
|||
ajax="false" |
|||
/> |
|||
|
|||
<p:commandButton action="Marca.xhtml" |
|||
icon="pi pi-fw pi-times" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
value="Cancelar" |
|||
immediate="true" |
|||
ajax="false"/> |
|||
|
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
</center> |
|||
</body> |
|||
</html> |
@ -0,0 +1,59 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
top |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
left |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
right |
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
<h1><h:outputText value="View"/></h1> |
|||
<p:panelGrid columns="2"> |
|||
|
|||
<h:outputText value="Nombre:"/> |
|||
<h:outputText value="#{demoBeanMarca.marca.nombre}" title="Nombre"/> |
|||
|
|||
|
|||
<p:commandButton action="Marca.xhtml" |
|||
actionListener="#{demoBeanMarca.eliminarTipo()}" |
|||
value="Eliminar" |
|||
ajax="false"/> |
|||
<p:commandButton action="Marca.xhtml" |
|||
value="Cancelar" |
|||
immediate="true" |
|||
ajax="false"/> |
|||
|
|||
</p:panelGrid> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
bottom |
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,50 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
<center> |
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
<ui:define name="left"> |
|||
<div class="card"> |
|||
<h:form> |
|||
<p:growl id="messages"/> |
|||
|
|||
<p:menubar> |
|||
|
|||
<p:menuitem value="Departamento" icon="pi pi-fw pi-building " action="Departamento.xhtml"/> |
|||
<p:menuitem value="Marca" icon="pi pi-fw pi-tag" action="Marca.xhtml"/> |
|||
<p:menuitem value="Producto" icon="pi pi-fw pi-shopping-bag" action="Producto.xhtml"/> |
|||
<p:menuitem value="Proveedor" icon="pi pi-fw pi-truck" action="Provedor.xhtml"/> |
|||
<!-- <p:menuitem value="Registro" icon="pi pi-fw pi-book " disabled="true" action="Registro.xhtml"/>--> |
|||
<p:menuitem value="Tipo" icon="pi pi-fw pi-table" action="Tipo.xhtml"/> |
|||
<p:menuitem value="Usuario" icon="pi pi-fw pi-user" action="Usuario.xhtml"/> |
|||
<!-- <p:menuitem value="Inicio" icon="pi pi-fw pi-home" action="Menu.xhtml"/>--> |
|||
<p:divider layout="vertical"/> |
|||
</p:menubar> |
|||
</h:form> |
|||
</div> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
</ui:define> |
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
</ui:composition> |
|||
</center> |
|||
</body> |
|||
</html> |
@ -0,0 +1,114 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
<body> |
|||
|
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
top |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
<div class="card"> |
|||
<h:form> |
|||
<p:growl id="messages"/> |
|||
|
|||
<p:menubar> |
|||
<p:menuitem value="Agregar" icon="pi pi-fw pi-plus" |
|||
action="UsuarioCrear.xhtml" |
|||
actionListener="#{demoBeanUsuario.preparar()}"/> |
|||
|
|||
<p:menuitem value="Departamento" icon="pi pi-fw pi-building " action="Departamento.xhtml"/> |
|||
<p:menuitem value="Marca" icon="pi pi-fw pi-tag" action="Marca.xhtml"/> |
|||
<p:menuitem value="Producto" icon="pi pi-fw pi-shopping-bag" action="Producto.xhtml"/> |
|||
<p:menuitem value="Proveedor" icon="pi pi-fw pi-truck" action="Provedor.xhtml"/> |
|||
<!-- comment <p:menuitem value="Registro" icon="pi pi-fw pi-book " disabled="true" action="Registro.xhtml"/> --> |
|||
<p:menuitem value="Tipo" icon="pi pi-fw pi-table" action="Tipo.xhtml"/> |
|||
<p:menuitem value="Usuario" icon="pi pi-fw pi-user" disabled="true" action="Usuario.xhtml"/> |
|||
<p:menuitem value="Inicio" icon="pi pi-fw pi-home" action="Menu.xhtml"/> |
|||
<p:divider layout="vertical"/> |
|||
</p:menubar> |
|||
</h:form> |
|||
</div> |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
right |
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<h:form style="text-align: center; margin-top: 20px;"> |
|||
|
|||
</h:form> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
|
|||
<h3><h:outputText value="Paises"/></h3> |
|||
|
|||
<p:dataTable value="#{demoBeanPais.paises}" var="item" |
|||
widgetVar="paises" |
|||
emptyMessage="No coincide con ningun registro" |
|||
filteredValue="#{demoBeanPais.filteredCustomers3}" |
|||
globalFilterFunction="#{demoBeanPais.globalFilterFunction}"> |
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end" style="position: absolute; right: 40px; top: 190px; "> |
|||
<p:inputText id="globalFilter" onkeyup="PF('paises').filter()" style="width:300px" |
|||
placeholder="Buscar" /> |
|||
</div> |
|||
</f:facet> |
|||
<p:column style="width: 10px;"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1 ? 'activo':'inactivo'}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
<p:commandButton action="PaisCrear.xhtml" icon="pi pi-fw pi-pencil" |
|||
actionListener="#{demoBeanPais.prepararEditar(item)}" |
|||
style="padding: 2px 8px; font-size: 11px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
value="Editar" |
|||
ajax="false"/> |
|||
<p:commandButton action="PaisEliminar.xhtml" icon="pi pi-fw pi-trash" |
|||
actionListener="#{demoBeanPais.prepararEliminar(item)}" |
|||
value="Eliminar" |
|||
style=" padding: 2px 8px; font-size: 11px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
ajax="false"/> |
|||
|
|||
|
|||
</p:column> |
|||
</p:dataTable> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,84 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
<p:growl id="growl" showDetail="true" for="MensajePais"/> |
|||
|
|||
<h1><h:outputText value="#{demoBeanPais.titulo}"/></h1> |
|||
<h:panelGrid columns="3"> |
|||
|
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{demoBeanPais.pais.nombre}" |
|||
title="Nombre" |
|||
required="true" |
|||
requiredMessage="El campo nombre es obligatorio" |
|||
validatorMessage="El campo nombre no debe incluir números, debe incluir mínimo 3 letras y máximo 15 letras"> |
|||
<f:validateRegex pattern="[a-zA-Z ]+" /> |
|||
<f:validateLength minimum="3" maximum="15" /> |
|||
</p:inputText> |
|||
<p:message for="nombre" /> |
|||
</h:panelGrid> |
|||
<p:commandButton action="#{demoBeanPais.agregarPais()}" |
|||
icon="pi pi-fw pi-check" |
|||
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
|
|||
rendered="#{demoBeanPais.nuevo}" |
|||
value="Agregar" |
|||
update="growl" |
|||
ajax="false"/> |
|||
|
|||
<p:commandButton action="Pais.xhtml" |
|||
actionListener="#{demoBeanPais.editarPais()}" |
|||
icon="pi pi-fw pi-pencil" |
|||
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
|
|||
rendered="#{!demoBeanPais.nuevo}" |
|||
value="Editar" |
|||
update="growl" |
|||
ajax="false"/> |
|||
|
|||
<p:commandButton action="Pais.xhtml" icon="pi pi-fw pi-times" |
|||
value="Cancelar" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
|
|||
immediate="true" |
|||
ajax="false"/> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,62 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
<h1><h:outputText value="Eliminar"/></h1> |
|||
<p:panelGrid columns="2"> |
|||
<h:outputText value="Id:"/> |
|||
<h:outputText value="#{demoBeanPais.filteredCustomers3.id}" title="Id"/> |
|||
<h:outputText value="Nombre:"/> |
|||
<h:outputText value="#{demoBeanPais.filteredCustomers3.nombre}" title="Nombre"/> |
|||
<h:outputText value="Status:"/> |
|||
<h:outputText value="#{demoBeanPais.filteredCustomers3.status}" title="Status"/> |
|||
|
|||
<p:commandButton action="Pais.xhtml" icon="pi pi-fw pi-trash" |
|||
actionListener="#{demoBeanPais.eliminaPais()}" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
value="Eliminar" |
|||
ajax="false"/> |
|||
<p:commandButton action="Pais.xhtml" icon="pi pi-fw pi-times" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
value="Cancelar" |
|||
immediate="true" |
|||
ajax="false"/> |
|||
</p:panelGrid> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,164 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
<center> |
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
Sistemas de Inventario |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
<div class="card"> |
|||
<h:form> |
|||
<p:growl id="messages"/> |
|||
|
|||
<p:menubar> |
|||
<p:menuitem value="Agregar" icon="pi pi-fw pi-plus" |
|||
action="ProductoCrear.xhtml" |
|||
actionListener="#{demoBeanProducto.prepararNuevo()}"/> |
|||
|
|||
<p:menuitem value="Departamento" icon="pi pi-fw pi-building " action="Departamento.xhtml"/> |
|||
<p:menuitem value="Marca" icon="pi pi-fw pi-tag" action="Marca.xhtml"/> |
|||
<p:menuitem value="Producto" icon="pi pi-fw pi-shopping-bag" disabled="true" action="Producto.xhtml"/> |
|||
<p:menuitem value="Proveedor" icon="pi pi-fw pi-truck" action="Provedor.xhtml"/> |
|||
<!-- <p:menuitem value="Registro" icon="pi pi-fw pi-book " disabled="true" action="Registro.xhtml"/>--> |
|||
<p:menuitem value="Tipo" icon="pi pi-fw pi-table" action="Tipo.xhtml"/> |
|||
<p:menuitem value="Usuario" icon="pi pi-fw pi-user" action="Usuario.xhtml"/> |
|||
<p:menuitem value="Inicio" icon="pi pi-fw pi-home" action="Menu.xhtml"/> |
|||
<p:divider layout="vertical"/> |
|||
</p:menubar> |
|||
</h:form> |
|||
</div> |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<h:form style="text-align: center; margin-top: 20px;"> |
|||
</h:form> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
|
|||
<h3><h:outputText value="Productos"/></h3> |
|||
|
|||
<p:dataTable value="#{demoBeanProducto.productos}" var="item" |
|||
widgetVar="productos" |
|||
emptyMessage="No coincide con ningun registro" |
|||
filteredValue="#{demoBeanProducto.filteredCustomers3}" |
|||
globalFilterFunction="#{demoBeanProducto.globalFilterFunction}"> |
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end" style="position: absolute; right: 40px; top: 190px; "> |
|||
<p:inputText id="globalFilter" onkeyup="PF('productos').filter()" style="width:300px" |
|||
placeholder="Buscar" /> |
|||
</div> |
|||
</f:facet> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Cantidad"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.cantidad}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Precio"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.precio}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="CodigoBarras"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.codigoBarras}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Medida"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.medida}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Lote"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.lote}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="TipoId"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.tipoId.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="DepartamentoId"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.departamentoId.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="MarcasId"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.marcasId.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="ProvedoresId"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.provedoresId.nombre}||#{item.provedoresId.correo}"/> |
|||
</p:column> |
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opcioones"/> |
|||
</f:facet> |
|||
<p:commandButton action="ProductoCrear.xhtml" icon="pi pi-fw pi-pencil" |
|||
actionListener="#{demoBeanProducto.prepararEditar(item)}" |
|||
value="Editar" |
|||
style="padding: 2px 8px; font-size: 11px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
ajax="false"/> |
|||
<p:commandButton action="ProductoEliminar.xhtml" icon="pi pi-fw pi-trash" |
|||
actionListener="#{demoBeanProducto.prepararEliminar(item)}" |
|||
value="Eliminar" |
|||
style=" padding: 2px 8px; font-size: 11px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
ajax="false"/> |
|||
</p:column> |
|||
</p:dataTable> |
|||
</h:form> |
|||
</f:view> |
|||
</ui:define> |
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
</ui:composition> |
|||
</center> |
|||
</body> |
|||
</html> |
@ -0,0 +1,164 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
<center> |
|||
|
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<f:view> |
|||
|
|||
<h:form> |
|||
<h1><h:outputText value="#{demoBeanProducto.titulo}"/></h1> |
|||
<h:panelGrid columns="3"> |
|||
|
|||
<p:outputLabel value="Cantidad:" for="cantidad" /> |
|||
<p:inputText id="cantidad" value="#{demoBeanProducto.producto.cantidad}" |
|||
title="Cantidad" |
|||
required="true" |
|||
requiredMessage="El campo cantidad es obligatorio" |
|||
validatorMessage="El campo cantidad debe contener numeros espacios y letras"> |
|||
</p:inputText> |
|||
<p:message for="cantidad" /> |
|||
|
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{demoBeanProducto.producto.nombre}" |
|||
title="Nombre" |
|||
required="true" |
|||
requiredMessage="El campo nombre es obligatorio" |
|||
validatorMessage="El campo nombre de contener solo letras mayúsculas"> |
|||
<f:validateRegex pattern="^[a-zA-Z\s]+$" /> |
|||
</p:inputText> |
|||
<p:message for="nombre" /> |
|||
|
|||
<p:outputLabel value="Precio:" for="precio" /> |
|||
<p:inputText id="precio" value="#{demoBeanProducto.producto.precio}" |
|||
title="Precio" |
|||
required="true" |
|||
requiredMessage="El campo precio es obligatorio" |
|||
validatorMessage="El campo precio debe ser un número entero entre -2147483648 y 2147483647"> |
|||
<f:validateLength minimum="1" maximum="10" /> |
|||
</p:inputText> |
|||
<p:message for="precio" /> |
|||
|
|||
<p:outputLabel value="Código de Barras:" for="codigoBarras" /> |
|||
<p:inputText id="codigoBarras" value="#{demoBeanProducto.producto.codigoBarras}" |
|||
title="CódigoBarras" |
|||
required="true" |
|||
requiredMessage="El campo Código de Barras es obligatorio" |
|||
validatorMessage="El campo CódigoBarras debe incluir números y letras, y tener una longitud de 1 a 12 caracteres"> |
|||
<f:validateLength minimum="1" maximum="12" /> |
|||
</p:inputText> |
|||
<p:message for="codigoBarras" /> |
|||
|
|||
<p:outputLabel value="Medida:" for="medida" /> |
|||
<p:inputText id="medida" value="#{demoBeanProducto.producto.medida}" |
|||
title="Medida" |
|||
required="true" |
|||
requiredMessage="El campo medida es obligatorio" |
|||
validatorMessage="El campo medida debe tene solo números minimo de un 1 digito máximo 10 dígitos"> |
|||
<f:validateLength minimum="1" maximum="10" /> |
|||
</p:inputText> |
|||
<p:message for="medida" /> |
|||
|
|||
<p:outputLabel value="Lote:" for="lote" /> |
|||
<p:inputText id="lote" value="#{demoBeanProducto.producto.lote}" |
|||
title="Lote" |
|||
required="true" |
|||
requiredMessage="El campo lote es obligatorio" |
|||
validatorMessage="El campo lote debe comenzar con '#' seguido de entre 1 y 10 números"> |
|||
<f:validateRegex pattern="^#\d{1,10}$" /> |
|||
<f:validateLength minimum="2" maximum="10" /> |
|||
</p:inputText> |
|||
<p:message for="lote" /> |
|||
|
|||
|
|||
<p:outputLabel value="Tipo:" for="tipoId"/> |
|||
<p:selectOneMenu id="tipoId" value="#{demoBeanProducto.producto.tipoId}" converter="selectOneMenuConverter" |
|||
required="true" requiredMessage="The TipoId fiel is required."> |
|||
<f:selectItems value="#{demoBeanTipo.tipos}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}"/> |
|||
|
|||
</p:selectOneMenu> |
|||
<p:message for="tipoId" /> |
|||
|
|||
<p:outputLabel value="Departamento:" for="departamentoId"/> |
|||
<p:selectOneMenu id="departamentoId" value="#{demoBeanProducto.producto.departamentoId}" converter="selectOneMenuConverter" |
|||
required="true" requiredMessage="The DepartamentoId fiel is required."> |
|||
<f:selectItems value="#{demoBeanDepartamento.departamentos}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}"/> |
|||
|
|||
</p:selectOneMenu> |
|||
<p:message for="departamentoId" /> |
|||
|
|||
<p:outputLabel value="Marca:" for="marcaId"/> |
|||
<p:selectOneMenu id="marcaId" value="#{demoBeanProducto.producto.marcasId}" converter="selectOneMenuConverter" |
|||
required="true" requiredMessage="The MarcaId fiel is required."> |
|||
<f:selectItems value="#{demoBeanMarca.marcas}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
<p:message for="marcaId" /> |
|||
|
|||
<p:outputLabel value="Provedores:" for="provedoresId" /> |
|||
<p:selectOneMenu id="provedoresId" value="#{demoBeanProducto.producto.provedoresId}" converter="selectOneMenuConverter" |
|||
required="true" requiredMessage="The ProvedoresId field is required."> |
|||
<f:selectItems value="#{demoBeanProvedor.provedores}" var="item" itemLabel="#{item.nombre}" itemValue="#{fixme}"/> |
|||
</p:selectOneMenu> |
|||
<p:message for="provedoresId" /> |
|||
|
|||
</h:panelGrid> |
|||
|
|||
<p:commandButton action="#{demoBeanProducto.agregarProducto()}" |
|||
icon="pi pi-fw pi-check" |
|||
rendered="#{demoBeanProducto.nuevo}" |
|||
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
value="Agregar" |
|||
ajax="false"/> |
|||
|
|||
<p:commandButton action="Producto.xhtml" |
|||
actionListener="#{demoBeanProducto.editarProducto()}" |
|||
icon="pi pi-fw pi-pencil" |
|||
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
rendered="#{!demoBeanProducto.nuevo}" |
|||
value="Editar" |
|||
ajax="false"/> |
|||
|
|||
<p:commandButton action="Producto.xhtml" icon="pi pi-fw pi-times" |
|||
value="Cancelar" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
immediate="true" |
|||
ajax="false"/> |
|||
|
|||
|
|||
|
|||
</h:form> |
|||
|
|||
</f:view> |
|||
|
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
</center> |
|||
</body> |
|||
</html> |
@ -0,0 +1,85 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
<center> |
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
|
|||
<h1><h:outputText value="Eliminnar"/></h1> |
|||
<p:panelGrid columns="2"> |
|||
<h:outputText value="Id:"/> |
|||
<h:outputText value="#{demoBeanProducto.producto.id}" title="Id"/> |
|||
<h:outputText value="Cantidad:"/> |
|||
<h:outputText value="#{demoBeanProducto.producto.cantidad}" title="Cantidad"/> |
|||
<h:outputText value="Nombre:"/> |
|||
<h:outputText value="#{demoBeanProducto.producto.nombre}" title="Nombre"/> |
|||
<h:outputText value="Precio:"/> |
|||
<h:outputText value="#{demoBeanProducto.producto.precio}" title="Precio"/> |
|||
<h:outputText value="CodigoBarras:"/> |
|||
<h:outputText value="#{demoBeanProducto.producto.codigoBarras}" title="CodigoBarras"/> |
|||
<h:outputText value="Medida:"/> |
|||
<h:outputText value="#{demoBeanProducto.producto.medida}" title="Medida"/> |
|||
<h:outputText value="Lote:"/> |
|||
<h:outputText value="#{demoBeanProducto.producto.lote}" title="Lote"/> |
|||
<h:outputText value="Status:"/> |
|||
<h:outputText value="#{demoBeanProducto.producto.status}" title="Status"/> |
|||
<h:outputText value="TipoId:"/> |
|||
<h:outputText value="#{demoBeanProducto.producto.tipoId.nombre}" title="TipoId"/> |
|||
<h:outputText value="DepartamentoId:"/> |
|||
<h:outputText value="#{demoBeanProducto.producto.departamentoId.nombre}" title="DepartamentoId"/> |
|||
<h:outputText value="MarcasId:"/> |
|||
<h:outputText value="#{demoBeanProducto.producto.marcasId.nombre}" title="MarcasId"/> |
|||
<h:outputText value="ProvedoresId:"/> |
|||
<h:outputText value="#{demoBeanProducto.producto.provedoresId.nombre}" title="ProvedoresId"/> |
|||
|
|||
|
|||
<p:commandButton action="Producto.xhtml" icon="pi pi-fw pi-trash" |
|||
actionListener="#{demoBeanProducto.eliminarProducto()}" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
value="Eliminar" |
|||
ajax="false"/> |
|||
<p:commandButton action="Producto.xhtml" icon="pi pi-fw pi-times" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
value="Cancelar" |
|||
immediate="true" |
|||
ajax="false"/> |
|||
|
|||
</p:panelGrid> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
|
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
</center> |
|||
</body> |
|||
</html> |
@ -0,0 +1,96 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<h:head> |
|||
<title>SISTEMA DE INVENTARIO</title> |
|||
</h:head> |
|||
|
|||
<h:body> |
|||
<center> |
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
<div class="card"> |
|||
<h:form> |
|||
<p:growl id="messages"/> |
|||
|
|||
<p:menubar> |
|||
<p:menuitem value="Agregar" icon="pi pi-fw pi-plus" action="ProvedorCrear.xhtml" |
|||
|
|||
actionListener="#{demoBeanProvedor.prepararNuevo()}"/> |
|||
|
|||
<p:menuitem value="Departamento" icon="pi pi-fw pi-building" action="Departamento.xhtml"/> |
|||
<p:menuitem value="Marca" icon="pi pi-fw pi-tag" action="Marca.xhtml"/> |
|||
<p:menuitem value="Producto" icon="pi pi-fw pi-shopping-bag" action="Producto.xhtml"/> |
|||
<p:menuitem value="Proveedor" icon="pi pi-fw pi-truck" disabled="true" action="Provedor.xhtml"/> |
|||
<p:menuitem value="Registro" icon="pi pi-fw pi-book" disabled="true" action="Registro.xhtml"/> |
|||
<p:menuitem value="Tipo" icon="pi pi-fw pi-table" action="Tipo.xhtml"/> |
|||
<p:menuitem value="Usuario" icon="pi pi-fw pi-user" action="Usuario.xhtml"/> |
|||
<p:menuitem value="Inicio" icon="pi pi-fw pi-home" action="Menu.xhtml"/> |
|||
<p:divider layout="vertical"/> |
|||
</p:menubar> |
|||
</h:form> |
|||
</div> |
|||
</ui:define> |
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
<ui:define name="content"> |
|||
<h3>Proveedores</h3> |
|||
|
|||
<h:form> |
|||
<p:dataTable value="#{demoBeanProvedor.provedores}" var="item" styleClass="dataTable"> |
|||
<p:column headerText="Id"> |
|||
<h:outputText value="#{item.id}" /> |
|||
</p:column> |
|||
<p:column headerText="Nombre"> |
|||
<h:outputText value="#{item.nombre}" /> |
|||
</p:column> |
|||
<p:column headerText="Dirección"> |
|||
<h:outputText value="#{item.direccion}" /> |
|||
</p:column> |
|||
<p:column headerText="Correo"> |
|||
<h:outputText value="#{item.correo}" /> |
|||
</p:column> |
|||
<p:column headerText="Teléfono"> |
|||
<h:outputText value="#{item.telefono}" /> |
|||
</p:column> |
|||
<p:column headerText="Estado"> |
|||
<h:outputText value="#{item.status == 1 ? 'Activo' : 'Inactivo'}" /> |
|||
</p:column> |
|||
<p:column headerText="Opciones"> |
|||
<p:commandButton action="ProvedorCrear.xhtml" icon="pi pi-fw pi-pencil" |
|||
actionListener="#{demoBeanProvedor.prepararEditar(item)}" |
|||
update="dataTable" |
|||
value="Editar" |
|||
style="padding: 2px 8px; font-size: 11px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
ajax="false" /> |
|||
<p:commandButton action="ProvedorEliminar.xhtml" icon="pi pi-fw pi-trash" |
|||
actionListener="#{demoBeanProvedor.prepararEliminar(item)}" |
|||
update="dataTable" |
|||
value="Eliminar" |
|||
style="padding: 2px 8px; font-size: 11px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
ajax="false" /> |
|||
</p:column> |
|||
</p:dataTable> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
</center> |
|||
</h:body> |
|||
|
|||
</html> |
@ -0,0 +1,123 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<h:head> |
|||
<title>Crear Proveedor</title> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|||
</h:head> |
|||
|
|||
<h:body> |
|||
<center> |
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
<!-- Contenido opcional para la parte izquierda --> |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
<!-- Contenido opcional para la parte derecha --> |
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
<h:form id="proveedorForm"> |
|||
|
|||
<!-- Título dinámico basado en el bean --> |
|||
<h1><h:outputText value="#{demoBeanProvedor.titulo}" /></h1> |
|||
|
|||
<!-- PanelGrid para organizar los campos del proveedor --> |
|||
<h:panelGrid columns="4" id="proveedorGrid"> |
|||
|
|||
<!-- Campo Nombre --> |
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" |
|||
value="#{demoBeanProvedor.provedor.nombre}" |
|||
required="true" |
|||
requiredMessage="El campo nombre es obligatorio" |
|||
validatorMessage="El campo nombre no debe incluir números y debe tener entre 3 y 15 letras"> |
|||
<f:validateRegex pattern="[a-zA-Z ]+" /> |
|||
<f:validateLength minimum="3" maximum="15" /> |
|||
</p:inputText> |
|||
<p:message for="nombre" /> |
|||
|
|||
<!-- Campo Dirección --> |
|||
<p:outputLabel value="Dirección:" for="direccion" /> |
|||
<p:inputText id="direccion" |
|||
value="#{demoBeanProvedor.provedor.direccion}" |
|||
required="true" |
|||
requiredMessage="El campo dirección es obligatorio" |
|||
validatorMessage="La dirección no es válida"> |
|||
<f:validateLength minimum="8" maximum="30" /> |
|||
<f:validateRegex pattern="[a-zA-Z0-9,.# ]*" /> |
|||
</p:inputText> |
|||
<p:message for="direccion" /> |
|||
|
|||
<!-- Campo Correo --> |
|||
<p:outputLabel value="Correo:" for="correo" /> |
|||
<p:inputText id="correo" |
|||
value="#{demoBeanProvedor.provedor.correo}" |
|||
required="true" |
|||
requiredMessage="El campo correo es obligatorio" |
|||
validatorMessage="El correo no es válido"> |
|||
<f:validateRegex pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}" /> |
|||
<f:validateLength maximum="30" /> |
|||
</p:inputText> |
|||
<p:message for="correo" /> |
|||
|
|||
<!-- Campo Teléfono --> |
|||
<p:outputLabel value="Teléfono:" for="telefono" /> |
|||
<p:inputText id="telefono" |
|||
value="#{demoBeanProvedor.provedor.telefono}" |
|||
required="true" |
|||
requiredMessage="El campo teléfono es obligatorio" |
|||
validatorMessage="El campo teléfono no es válido"> |
|||
<f:validateLength minimum="10" /> |
|||
<f:validateRegex pattern="\d{10}" /> |
|||
</p:inputText> |
|||
<p:message for="telefono" /> |
|||
|
|||
</h:panelGrid> |
|||
|
|||
<!-- Botones --> |
|||
<p:commandButton action="#{demoBeanProvedor.agregarProveedor()}" |
|||
value="Agregar" |
|||
update="@form" |
|||
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
ajax="true" /> |
|||
|
|||
<p:commandButton action="Provedor.xhtml" icon="pi pi-fw pi-pencil" |
|||
actionListener="#{demoBeanProvedor.editarProvedor()}" |
|||
value="Editar" |
|||
update="@form" |
|||
rendered="#{!demoBeanProvedor.nuevo}" |
|||
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
|
|||
ajax="true" /> |
|||
|
|||
<p:commandButton value="Cancelar" |
|||
immediate="true" |
|||
action="Provedor.xhtml" icon="pi pi-fw pi-times" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
ajax="false" /> |
|||
|
|||
</h:form> |
|||
</f:view> |
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
</center> |
|||
</h:body> |
|||
</html> |
@ -0,0 +1,82 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<h:head> |
|||
<title>Eliminar Provedor</title> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|||
|
|||
</h:head> |
|||
<body> |
|||
<center> |
|||
|
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
<!-- Contenido para la parte izquierda --> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
|
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
<h1><h:outputText value="Eliminando "/></h1> |
|||
<p:panelGrid columns="2"> |
|||
<h:outputText value="Id:"/> |
|||
<h:outputText value="#{demoBeanProvedor.provedor.id}" title="Id"/> |
|||
<h:outputText value="Nombre:"/> |
|||
<h:outputText value="#{demoBeanProvedor.provedor.nombre}" title="Nombre"/> |
|||
<h:outputText value="Direccion:"/> |
|||
<h:outputText value="#{demoBeanProvedor.provedor.direccion}" title="Direccion"/> |
|||
<h:outputText value="Correo:"/> |
|||
<h:outputText value="#{demoBeanProvedor.provedor.correo}" title="Correo"/> |
|||
<h:outputText value="Telefono:"/> |
|||
<h:outputText value="#{demoBeanProvedor.provedor.telefono}" title="Telefono"/> |
|||
<h:outputText value="Status:"/> |
|||
<h:outputText value="#{demoBeanProvedor.provedor.status}" title="Status"/> |
|||
</p:panelGrid> |
|||
|
|||
<p:commandButton action="Provedor.xhtml" |
|||
actionListener="#{demoBeanProvedor.eliminarProvedor()}" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
|
|||
value="Eliminar" |
|||
ajax="false" |
|||
/> |
|||
<p:commandButton action="Provedor.xhtml" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
|
|||
value="Cancelar" |
|||
immediate="true" |
|||
ajax="false"/> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
|
|||
</ui:composition> |
|||
</center> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,145 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui" |
|||
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"> |
|||
|
|||
<body> |
|||
<center> |
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
<div class="card"> |
|||
<h:form> |
|||
<p:growl id="messages"/> |
|||
|
|||
<p:menubar> |
|||
<p:menuitem value="Agregar" icon="pi pi-fw pi-plus" |
|||
action="TipoCrear.xhtml" |
|||
actionListener="#{demoBeanTipo.preparar()}"/> |
|||
|
|||
|
|||
<p:menuitem value="Departamento" icon="pi pi-fw pi-building " action="Departamento.xhtml"/> |
|||
<p:menuitem value="Marca" icon="pi pi-fw pi-tag" action="Marca.xhtml"/> |
|||
<p:menuitem value="Producto" icon="pi pi-fw pi-shopping-bag" action="Producto.xhtml"/> |
|||
<p:menuitem value="Proveedor" icon="pi pi-fw pi-truck" action="Provedor.xhtml"/> |
|||
<!-- comment <p:menuitem value="Registro" icon="pi pi-fw pi-book " disabled="true" action="Registro.xhtml"/> --> |
|||
<p:menuitem value="Tipo" icon="pi pi-fw pi-table" disabled="true" action="Tipo.xhtml"/> |
|||
<p:menuitem value="Usuario" icon="pi pi-fw pi-user" action="Usuario.xhtml"/> |
|||
<p:menuitem value="Inicio" icon="pi pi-fw pi-home" action="Menu.xhtml"/> |
|||
<p:divider layout="vertical"/> |
|||
</p:menubar> |
|||
</h:form> |
|||
</div> |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<h:form style="text-align: left; margin-top: 20px;"> |
|||
<div style="margin-bottom: 10px;"> |
|||
|
|||
|
|||
|
|||
<!-- comment |
|||
<p:commandButton action=" " disabled="true" style="padding: 2px 4px; font-size: 4px; font-weight: bold; color: #dddddd; background-color: #dddddd; border: 0px solid #dddddd; border-radius: 4px; cursor: pointer; box-shadow: 0 0px 0px rgba(0, 0, 0, 0); transition: transform 0.3s ease;"/> |
|||
|
|||
<h:commandButton action="Departamento.xhtml" value="Departamento" style="padding: 12px 24px; font-size: 15px; font-weight: bold; color: #001f3f; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 3px;" /> |
|||
<h:commandButton action="Marca.xhtml" value="Marca" style="padding: 12px 24px; font-size: 15px; font-weight: bold; color: #001f3f; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 3px;" /> |
|||
<h:commandButton action="Producto.xhtml" value="Producto" style="padding: 12px 24px; font-size: 15px; font-weight: bold; color: #001f3f; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 3px;" /> |
|||
<h:commandButton action="Provedor.xhtml" value="Proveedor" style="padding: 12px 24px; font-size: 15px; font-weight: bold; color: #001f3f; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 3px;" /> |
|||
<h:commandButton action="Registro.xhtml" value="Registro" style="padding: 12px 24px; font-size: 15px; font-weight: bold; color: #001f3f; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 3px;" /> |
|||
<h:commandButton action="Tipo.xhtml" value="Tipo" disabled="true" style="padding: 12px 24px; font-size: 15px; font-weight: bold; color: #001f3f; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 3px;" /> |
|||
<h:commandButton action="Usuario.xhtml" value="Usuario" style="padding: 12px 24px; font-size: 15px; font-weight: bold; color: #001f3f; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" /> |
|||
<p:commandButton action=" " disabled="true" style="padding: 2px 4px; font-size: 4px; font-weight: bold; color: #dddddd; background-color: #dddddd; border: 0px solid #dddddd; border-radius: 4px; cursor: pointer; box-shadow: 0 0px 0px rgba(0, 0, 0, 0); transition: transform 0.3s ease;"/> |
|||
<p:commandButton action="Menu.xhtml" |
|||
actionListener="Menu.xhtml" |
|||
value=" Inicio " |
|||
ajax="false"/> |
|||
--> |
|||
</div> |
|||
</h:form> |
|||
<f:view> |
|||
|
|||
<img src="C:\\Users\chore\Pictures\waifus\cloe version 1.jpg" /> |
|||
|
|||
|
|||
<h:form> |
|||
|
|||
<h3><h:outputText value="Tipos "/></h3> |
|||
|
|||
|
|||
<p:dataTable value="#{demoBeanTipo.tipos}" var="item" |
|||
widgetVar="tipos" |
|||
emptyMessage="No coincide con ningun registro" |
|||
filteredValue="#{demoBeanTipo.filteredCustomers3}" |
|||
globalFilterFunction="#{demoBeanTipo.globalFilterFunction}"> |
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end" style="position: absolute; right: 40px; top: 190px; "> |
|||
<p:inputText id="globalFilter" onkeyup="PF('tipos').filter()" style="width:300px" |
|||
placeholder="Buscar" /> |
|||
</div> |
|||
</f:facet> |
|||
|
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1 ? 'activo':'inactivo'}"/> |
|||
</p:column> |
|||
|
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
<p:commandButton action="TipoCrear.xhtml" icon="pi pi-fw pi-pencil" |
|||
actionListener="#{demoBeanTipo.prepararEditar(item)}" |
|||
value="Editar" |
|||
style="padding: 2px 8px; font-size: 11px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
ajax="false"/> |
|||
<p:commandButton action="TipoEliminar.xhtml" icon="pi pi-fw pi-trash" |
|||
actionListener="#{demoBeanTipo.prepararEliminar(item)}" |
|||
value="Eliminar" |
|||
style=" padding: 2px 8px; font-size: 11px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
ajax="false"/> |
|||
|
|||
|
|||
</p:column> |
|||
</p:dataTable> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</center> |
|||
</body> |
|||
</html> |
@ -0,0 +1,83 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
<center> |
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content" > |
|||
<f:view> |
|||
|
|||
|
|||
<h:form style= "position: static;" > |
|||
<h1><h:outputText value="#{demoBeanTipo.titulo}"/></h1> |
|||
<h:panelGrid columns="3"> |
|||
|
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
|
|||
<p:inputText id="nombre" |
|||
value="#{demoBeanTipo.tipo.nombre}" |
|||
|
|||
title="Nombre" |
|||
required="true" |
|||
requiredMessage="El campo nombre es obligatorio" |
|||
validatorMessage="El campo nombre no debe incluir números, debe incluir mínimo 3 letras y máximo 15 letras"> |
|||
<f:validateRegex pattern="[a-zA-Z ]+" /> |
|||
<f:validateLength minimum="3" maximum="15" /> |
|||
</p:inputText> |
|||
<p:message for="nombre" /> |
|||
</h:panelGrid> |
|||
|
|||
<p:commandButton action="#{demoBeanTipo.agregarTipo()}" |
|||
icon="pi pi-fw pi-check" |
|||
rendered="#{demoBeanTipo.nuevo}" |
|||
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
value="Agregar" |
|||
ajax="false" |
|||
update="tipoGrid"/> |
|||
|
|||
<p:commandButton action="Tipo.xhtml" icon="pi pi-fw pi-pencil" |
|||
actionListener="#{demoBeanTipo.editarTipo()}" |
|||
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
rendered="#{!demoBeanTipo.nuevo}" |
|||
value="Editar" |
|||
ajax="false"/> |
|||
|
|||
<p:commandButton action="Tipo.xhtml" icon="pi pi-fw pi-times" |
|||
value="Cancelar" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
immediate="true" |
|||
ajax="false"/> |
|||
|
|||
|
|||
|
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
</center> |
|||
</body> |
|||
</html> |
|||
|
@ -0,0 +1,57 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
<center> |
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
<h1><h:outputText value="Eliminar"/></h1> |
|||
<p:panelGrid columns="2"> |
|||
|
|||
<h:outputText value="Nombre:"/> |
|||
<h:outputText value="#{demoBeanTipo.tipo.nombre}" title="Nombre"/> |
|||
|
|||
<p:commandButton action="Tipo.xhtml" icon="pi pi-fw pi-trash" |
|||
actionListener="#{demoBeanTipo.eliminarTipo()}" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
value="Eliminar" |
|||
ajax="false"/> |
|||
<p:commandButton action="Tipo.xhtml" icon="pi pi-fw pi-times" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
value="Cancelar" |
|||
immediate="true" |
|||
ajax="false"/> |
|||
</p:panelGrid> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
</ui:composition> |
|||
</center> |
|||
</body> |
|||
</html> |
@ -0,0 +1,167 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
<center> |
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top" > |
|||
Sistema de inventario |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
<div class="card"> |
|||
<h:form> |
|||
<p:growl id="messages"/> |
|||
|
|||
<p:menubar> |
|||
<p:menuitem value="Agregar" icon="pi pi-fw pi-plus" |
|||
action="UsuarioCrear.xhtml" |
|||
actionListener="#{demoBeanUsuario.preparar()}"/> |
|||
|
|||
<p:menuitem value="Departamento" icon="pi pi-fw pi-building " action="Departamento.xhtml"/> |
|||
<p:menuitem value="Marca" icon="pi pi-fw pi-tag" action="Marca.xhtml"/> |
|||
<p:menuitem value="Producto" icon="pi pi-fw pi-shopping-bag" action="Producto.xhtml"/> |
|||
<p:menuitem value="Proveedor" icon="pi pi-fw pi-truck" action="Provedor.xhtml"/> |
|||
<!-- comment <p:menuitem value="Registro" icon="pi pi-fw pi-book " disabled="true" action="Registro.xhtml"/> --> |
|||
<p:menuitem value="Tipo" icon="pi pi-fw pi-table" action="Tipo.xhtml"/> |
|||
<p:menuitem value="Usuario" icon="pi pi-fw pi-user" disabled="true" action="Usuario.xhtml"/> |
|||
<p:menuitem value="Inicio" icon="pi pi-fw pi-home" action="Menu.xhtml"/> |
|||
<p:divider layout="vertical"/> |
|||
</p:menubar> |
|||
</h:form> |
|||
</div> |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<h:form style="text-align: center; margin-top: 20px;"> |
|||
|
|||
</h:form> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
|
|||
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/White_chicken_egg_square.jpg/250px-White_chicken_egg_square.jpg" style="position: absolute; left: 200px; " width="50" height="50"/> |
|||
|
|||
<h3><h:outputText value="Usuarios"/></h3> |
|||
|
|||
<p:dataTable value="#{demoBeanUsuario.usuarios}" var="item" |
|||
widgetVar="usuarios" |
|||
emptyMessage="No coincide con ningun registro" |
|||
filteredValue="#{demoBeanUsuario.filteredCustomers3}" |
|||
globalFilterFunction="#{demoBeanUsuario.globalFilterFunction}"> |
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end" style="position: absolute; right: 40px; top: 190px; "> |
|||
<p:inputText id="globalFilter" onkeyup="PF('usuarios').filter()" style="width:300px" |
|||
placeholder="Buscar" /> |
|||
</div> |
|||
</f:facet> |
|||
<p:column style="width: 10px;"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column > |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}"/> |
|||
</p:column> |
|||
<p:column style="width: 20px;"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Sexo"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.sexo}"/> |
|||
</p:column> |
|||
<p:column style="width: 50px;"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Telefono"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.telefono}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Correo"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.correo}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Direccion"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.direccion}"/> |
|||
</p:column> |
|||
<p:column style="width: 50px;"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Estado"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.estadoIdestado}"/> |
|||
</p:column> |
|||
<p:column style="width: 15px;"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Rol"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.rolIdrol}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Password"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.npila}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Username"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.username}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1 ? 'activo':'inactivo'}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
<p:commandButton action="UsuarioCrear.xhtml" icon="pi pi-fw pi-pencil" |
|||
actionListener="#{demoBeanUsuario.prepararEditar(item)}" |
|||
style="padding: 2px 8px; font-size: 11px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
value="Editar" |
|||
ajax="false"/> |
|||
<p:commandButton action="UsuarioEliminar.xhtml" icon="pi pi-fw pi-trash" |
|||
actionListener="#{demoBeanUsuario.prepararEliminar(item)}" |
|||
value="Eliminar" |
|||
style=" padding: 2px 8px; font-size: 11px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
ajax="false"/> |
|||
|
|||
|
|||
</p:column> |
|||
</p:dataTable> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</center> |
|||
</body> |
|||
</html> |
@ -0,0 +1,167 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
<center> |
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
<p:growl id="growl" showDetail="true" for="MensajeUsuario"/> |
|||
|
|||
<h1><h:outputText value="#{demoBeanUsuario.titulo}"/></h1> |
|||
<h:panelGrid columns="3"> |
|||
|
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{demoBeanUsuario.TUsuario.nombre}" |
|||
title="Nombre" |
|||
required="true" |
|||
requiredMessage="El campo nombre es obligatorio" |
|||
validatorMessage="El campo nombre no debe incluir números, debe incluir mínimo 3 letras y máximo 15 letras"> |
|||
<f:validateRegex pattern="[a-zA-Z ]+" /> |
|||
<f:validateLength minimum="3" maximum="15" /> |
|||
</p:inputText> |
|||
<p:message for="nombre" /> |
|||
|
|||
<p:outputLabel value="Sexo" for="sexo" /> |
|||
<p:inputText id="sexo" value="#{demoBeanUsuario.TUsuario.sexo}" |
|||
title="Sexo" |
|||
required="true" |
|||
requiredMessage="El campo nombre es obligatorio" |
|||
validatorMessage="M o F"> |
|||
<f:validateRegex pattern="[a-zA-Z ]+" /> |
|||
<f:validateLength minimum="3" maximum="15" /> |
|||
</p:inputText> |
|||
<p:message for="sexo" /> |
|||
|
|||
<p:outputLabel value="Telefono:" for="telefono" /> |
|||
<p:inputText id="telefono" value="#{demoBeanUsuario.TUsuario.telefono}" |
|||
title="Telefono" |
|||
required="true" |
|||
requiredMessage="El campo teléfono es obligatorio" |
|||
validatorMessage="El teléfono no es válido"> |
|||
<f:validateRequired /> |
|||
<f:validateRegex pattern="\d{10}" /> |
|||
</p:inputText> |
|||
<p:message for="telefono" /> |
|||
|
|||
<p:outputLabel value="Correo:" for="correo" /> |
|||
<p:inputText id="correo" value="#{demoBeanUsuario.TUsuario.correo}" |
|||
title="Correo" |
|||
required="true" |
|||
requiredMessage="El campo correo es obligatorio" |
|||
validatorMessage="El correo no es válido"> |
|||
|
|||
<f:validateRegex pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}" /> |
|||
<f:validateLength maximum="100" /> |
|||
</p:inputText> |
|||
<p:message for="correo" /> |
|||
|
|||
<p:outputLabel value="Direccion:" for="direccion" /> |
|||
<p:inputText id="direccion" value="#{demoBeanUsuario.TUsuario.direccion}" |
|||
title="Direccion" |
|||
required="true" |
|||
requiredMessage="El campo dirección es obligatorio " |
|||
validatorMessage="La dirección no es válida"> |
|||
<f:validateLength minimum="5" maximum="30" /> |
|||
<f:validateRegex pattern="[a-zA-Z0-9,.# ]*" /> |
|||
</p:inputText> |
|||
<p:message for="direccion" /> |
|||
|
|||
<p:outputLabel value="Estado:" for="estadoId" /> |
|||
<p:inputText id="estadoId" value="#{demoBeanUsuario.TUsuario.estadoIdestado}" |
|||
title="Estado" |
|||
required="true" |
|||
requiredMessage="El campo nombre es obligatorio" |
|||
validatorMessage="M o F"> |
|||
<f:validateRegex pattern="[a-zA-Z ]+" /> |
|||
<f:validateLength minimum="3" maximum="15" /> |
|||
</p:inputText> |
|||
<p:message for="estadoId" /> |
|||
|
|||
<p:outputLabel value="Estado:" for="estadoId"/> |
|||
<p:selectOneMenu id="estadoId" value="#{demoBeanUsuario.TUsuario.paisId}" converter="selectOneMenuConverter" |
|||
required="true" requiredMessage="Este campo es requerido"> |
|||
<f:selectItems value="#{demoBeanEstado}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
<p:message for="estadoId"/> |
|||
|
|||
<p:outputLabel value="Pais:" for="paisId"/> |
|||
<p:selectOneMenu id="paisId" value="#{demoBeanUsuario.TUsuario.estadoIdestado}" converter="selectOneMenuConverter" |
|||
required="true" requiredMessage="Este campo es requerido"> |
|||
<f:selectItems value="#{demoBeanPais}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
<p:message for="paisId"/> |
|||
|
|||
<p:outputLabel value="Rol:" for="rolId"/> |
|||
<p:selectOneMenu id="rolId" value="#{demoBeanUsuario.TUsuario.rolIdrol}" converter="selectOneMenuConverter" |
|||
required="true" requiredMessage="Este campo es requerido"> |
|||
<f:selectItems value="#{demoBean}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
<p:message for="paisId"/> |
|||
|
|||
<input type="file" value="Foto" for="foto" id="foto" |
|||
required="true" |
|||
requiredMessage="El campo nombre es obligatorio"> |
|||
<button onclick="document.getElementById('myFileInput').click()">Seleccionar Archivo</button> |
|||
</input> |
|||
|
|||
</h:panelGrid> |
|||
<p:commandButton action="#{demoBeanUsuario.agregarUsuario()}" |
|||
icon="pi pi-fw pi-check" |
|||
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
|
|||
rendered="#{demoBeanUsuario.nuevo}" |
|||
value="Agregar" |
|||
update="growl" |
|||
ajax="false"/> |
|||
|
|||
<p:commandButton action="Usuario.xhtml" |
|||
actionListener="#{demoBeanUsuario.editarUsuario()}" |
|||
icon="pi pi-fw pi-pencil" |
|||
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;" |
|||
|
|||
rendered="#{!demoBeanUsuario.nuevo}" |
|||
value="Editar" |
|||
update="growl" |
|||
ajax="false"/> |
|||
|
|||
<p:commandButton action="Usuario.xhtml" icon="pi pi-fw pi-times" |
|||
value="Cancelar" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
|
|||
immediate="true" |
|||
ajax="false"/> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
</center> |
|||
</body> |
|||
</html> |
@ -0,0 +1,69 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
<center> |
|||
<ui:composition template="./template/Principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
SISTEMA DE INVENTARIO |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
<h1><h:outputText value="Eliminar"/></h1> |
|||
<p:panelGrid columns="2"> |
|||
<h:outputText value="Id:"/> |
|||
<h:outputText value="#{demoBeanUsuario.TUsuario.id}" title="Id"/> |
|||
<h:outputText value="Nombre:"/> |
|||
<h:outputText value="#{demoBeanUsuario.TUsuario.nombre}" title="Nombre"/> |
|||
<h:outputText value="Telefono:"/> |
|||
<h:outputText value="#{demoBeanUsuario.TUsuario.telefono}" title="Telefono"/> |
|||
<h:outputText value="Correo:"/> |
|||
<h:outputText value="#{demoBeanUsuario.TUsuario.correo}" title="Correo"/> |
|||
<h:outputText value="Direccion:"/> |
|||
<h:outputText value="#{demoBeanUsuario.TUsuario.direccion}" title="Direccion"/> |
|||
<h:outputText value="Status:"/> |
|||
<h:outputText value="#{demoBeanUsuario.TUsuario.status}" title="Status"/> |
|||
|
|||
<p:commandButton action="Usuario.xhtml" icon="pi pi-fw pi-trash" |
|||
actionListener="#{demoBeanUsuario.eliminaUsuario()}" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
value="Eliminar" |
|||
ajax="false"/> |
|||
<p:commandButton action="Usuario.xhtml" icon="pi pi-fw pi-times" |
|||
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;" |
|||
value="Cancelar" |
|||
immediate="true" |
|||
ajax="false"/> |
|||
</p:panelGrid> |
|||
|
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
</center> |
|||
</body> |
|||
</html> |
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd"> |
|||
<!-- |
|||
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. |
|||
|
|||
This program and the accompanying materials are made available under the |
|||
terms of the Eclipse Public License v. 2.0, which is available at |
|||
http://www.eclipse.org/legal/epl-2.0. |
|||
|
|||
This Source Code may also be made available under the following Secondary |
|||
Licenses when the conditions for such availability set forth in the |
|||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, |
|||
version 2 with the GNU Classpath Exception, which is available at |
|||
https://www.gnu.org/software/classpath/license.html. |
|||
|
|||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 |
|||
--> |
|||
<glassfish-web-app error-url=""> |
|||
<class-loader delegate="true"/> |
|||
<jsp-config> |
|||
<property name="keepgenerated" value="true"> |
|||
<description>Keep a copy of the generated servlet class' java code.</description> |
|||
</property> |
|||
</jsp-config> |
|||
</glassfish-web-app> |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue