oscar
7 months ago
commit
2ae2d26441
77 changed files with 8173 additions and 0 deletions
@ -0,0 +1,9 @@ |
|||||
|
/nbproject/private/ |
||||
|
/ProyectoInventario-war/nbproject/private/ |
||||
|
/ProyectoInventario-ejb/nbproject/private/ |
||||
|
/ProyectoInventario-ejb/build/ |
||||
|
/ProyectoInventario-war/build/ |
||||
|
/build/ |
||||
|
/ProyectoInventario-war/dist/ |
||||
|
/ProyectoInventario-ejb/dist/ |
||||
|
/dist/ |
@ -0,0 +1,190 @@ |
|||||
|
-- MySQL Script generated by MySQL Workbench |
||||
|
-- Sat Apr 27 12:23:20 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 inventarioalmacen |
||||
|
-- ----------------------------------------------------- |
||||
|
|
||||
|
-- ----------------------------------------------------- |
||||
|
-- Schema inventarioalmacen |
||||
|
-- ----------------------------------------------------- |
||||
|
CREATE SCHEMA IF NOT EXISTS `inventarioalmacen` DEFAULT CHARACTER SET utf8 ; |
||||
|
USE `inventarioalmacen` ; |
||||
|
|
||||
|
-- ----------------------------------------------------- |
||||
|
-- Table `inventarioalmacen`.`marca` |
||||
|
-- ----------------------------------------------------- |
||||
|
CREATE TABLE IF NOT EXISTS `inventarioalmacen`.`marca` ( |
||||
|
`id` INT NOT NULL AUTO_INCREMENT, |
||||
|
`nombre` VARCHAR(100) NOT NULL, |
||||
|
`estado` INT NOT NULL, |
||||
|
PRIMARY KEY (`id`)) |
||||
|
ENGINE = InnoDB; |
||||
|
|
||||
|
|
||||
|
-- ----------------------------------------------------- |
||||
|
-- Table `inventarioalmacen`.`paises` |
||||
|
-- ----------------------------------------------------- |
||||
|
CREATE TABLE IF NOT EXISTS `inventarioalmacen`.`paises` ( |
||||
|
`id` INT NOT NULL AUTO_INCREMENT, |
||||
|
`nombre` VARCHAR(100) NOT NULL, |
||||
|
`estado` INT NOT NULL, |
||||
|
PRIMARY KEY (`id`)) |
||||
|
ENGINE = InnoDB; |
||||
|
|
||||
|
|
||||
|
-- ----------------------------------------------------- |
||||
|
-- Table `inventarioalmacen`.`estados` |
||||
|
-- ----------------------------------------------------- |
||||
|
CREATE TABLE IF NOT EXISTS `inventarioalmacen`.`estados` ( |
||||
|
`id` INT NOT NULL AUTO_INCREMENT, |
||||
|
`nombre` VARCHAR(45) NOT NULL, |
||||
|
`estado` INT NOT NULL, |
||||
|
`paises_id` INT NOT NULL, |
||||
|
PRIMARY KEY (`id`), |
||||
|
INDEX `fk_estados_paises1_idx` (`paises_id` ASC) VISIBLE, |
||||
|
CONSTRAINT `fk_estados_paises1` |
||||
|
FOREIGN KEY (`paises_id`) |
||||
|
REFERENCES `inventarioalmacen`.`paises` (`id`) |
||||
|
ON DELETE NO ACTION |
||||
|
ON UPDATE NO ACTION) |
||||
|
ENGINE = InnoDB; |
||||
|
|
||||
|
|
||||
|
-- ----------------------------------------------------- |
||||
|
-- Table `inventarioalmacen`.`proveedor` |
||||
|
-- ----------------------------------------------------- |
||||
|
CREATE TABLE IF NOT EXISTS `inventarioalmacen`.`proveedor` ( |
||||
|
`id` INT NOT NULL AUTO_INCREMENT, |
||||
|
`nombre` VARCHAR(100) NOT NULL, |
||||
|
`telefono` VARCHAR(10) NOT NULL, |
||||
|
`email` VARCHAR(100) NOT NULL, |
||||
|
`estado` INT NOT NULL, |
||||
|
`domicilio` VARCHAR(100) NOT NULL, |
||||
|
`estados_id` INT NOT NULL, |
||||
|
`marca_id` INT NOT NULL, |
||||
|
PRIMARY KEY (`id`), |
||||
|
INDEX `fk_proveedor_estados1_idx` (`estados_id` ASC) VISIBLE, |
||||
|
INDEX `fk_proveedor_marca1_idx` (`marca_id` ASC) VISIBLE, |
||||
|
CONSTRAINT `fk_proveedor_estados1` |
||||
|
FOREIGN KEY (`estados_id`) |
||||
|
REFERENCES `inventarioalmacen`.`estados` (`id`) |
||||
|
ON DELETE NO ACTION |
||||
|
ON UPDATE NO ACTION, |
||||
|
CONSTRAINT `fk_proveedor_marca1` |
||||
|
FOREIGN KEY (`marca_id`) |
||||
|
REFERENCES `inventarioalmacen`.`marca` (`id`) |
||||
|
ON DELETE NO ACTION |
||||
|
ON UPDATE NO ACTION) |
||||
|
ENGINE = InnoDB; |
||||
|
|
||||
|
|
||||
|
-- ----------------------------------------------------- |
||||
|
-- Table `inventarioalmacen`.`ubicacion` |
||||
|
-- ----------------------------------------------------- |
||||
|
CREATE TABLE IF NOT EXISTS `inventarioalmacen`.`ubicacion` ( |
||||
|
`id` INT NOT NULL AUTO_INCREMENT, |
||||
|
`bloque` VARCHAR(1) NOT NULL, |
||||
|
`anaquel` INT NOT NULL, |
||||
|
`estado` INT NOT NULL, |
||||
|
PRIMARY KEY (`id`)) |
||||
|
ENGINE = InnoDB; |
||||
|
|
||||
|
|
||||
|
-- ----------------------------------------------------- |
||||
|
-- Table `inventarioalmacen`.`tipo` |
||||
|
-- ----------------------------------------------------- |
||||
|
CREATE TABLE IF NOT EXISTS `inventarioalmacen`.`tipo` ( |
||||
|
`id` INT NOT NULL AUTO_INCREMENT, |
||||
|
`tipo` VARCHAR(45) NOT NULL, |
||||
|
`estado` INT NOT NULL, |
||||
|
PRIMARY KEY (`id`)) |
||||
|
ENGINE = InnoDB; |
||||
|
|
||||
|
|
||||
|
-- ----------------------------------------------------- |
||||
|
-- Table `inventarioalmacen`.`producto` |
||||
|
-- ----------------------------------------------------- |
||||
|
CREATE TABLE IF NOT EXISTS `inventarioalmacen`.`producto` ( |
||||
|
`id` INT NOT NULL AUTO_INCREMENT, |
||||
|
`nombre` VARCHAR(100) NOT NULL, |
||||
|
`codigo` INT ZEROFILL NOT NULL, |
||||
|
`precio` FLOAT NOT NULL, |
||||
|
`piezas` INT NOT NULL, |
||||
|
`estado` INT NOT NULL, |
||||
|
`fecha` DATE NOT NULL, |
||||
|
`proveedor_idproveedor` INT NOT NULL, |
||||
|
`ubicacion_id` INT NOT NULL, |
||||
|
`tipo_id` INT NOT NULL, |
||||
|
PRIMARY KEY (`id`), |
||||
|
INDEX `fk_producto_proveedor1_idx` (`proveedor_idproveedor` ASC) VISIBLE, |
||||
|
INDEX `fk_producto_ubicacion1_idx` (`ubicacion_id` ASC) VISIBLE, |
||||
|
INDEX `fk_producto_tipo1_idx` (`tipo_id` ASC) VISIBLE, |
||||
|
CONSTRAINT `fk_producto_proveedor1` |
||||
|
FOREIGN KEY (`proveedor_idproveedor`) |
||||
|
REFERENCES `inventarioalmacen`.`proveedor` (`id`) |
||||
|
ON DELETE NO ACTION |
||||
|
ON UPDATE NO ACTION, |
||||
|
CONSTRAINT `fk_producto_ubicacion1` |
||||
|
FOREIGN KEY (`ubicacion_id`) |
||||
|
REFERENCES `inventarioalmacen`.`ubicacion` (`id`) |
||||
|
ON DELETE NO ACTION |
||||
|
ON UPDATE NO ACTION, |
||||
|
CONSTRAINT `fk_producto_tipo1` |
||||
|
FOREIGN KEY (`tipo_id`) |
||||
|
REFERENCES `inventarioalmacen`.`tipo` (`id`) |
||||
|
ON DELETE NO ACTION |
||||
|
ON UPDATE NO ACTION) |
||||
|
ENGINE = InnoDB; |
||||
|
|
||||
|
|
||||
|
-- ----------------------------------------------------- |
||||
|
-- Table `inventarioalmacen`.`roles` |
||||
|
-- ----------------------------------------------------- |
||||
|
CREATE TABLE IF NOT EXISTS `inventarioalmacen`.`roles` ( |
||||
|
`id` INT NOT NULL AUTO_INCREMENT, |
||||
|
`rol` VARCHAR(45) NOT NULL, |
||||
|
`estado` INT NOT NULL, |
||||
|
PRIMARY KEY (`id`)) |
||||
|
ENGINE = InnoDB; |
||||
|
|
||||
|
|
||||
|
-- ----------------------------------------------------- |
||||
|
-- Table `inventarioalmacen`.`usuarios` |
||||
|
-- ----------------------------------------------------- |
||||
|
CREATE TABLE IF NOT EXISTS `inventarioalmacen`.`usuarios` ( |
||||
|
`id` INT NOT NULL AUTO_INCREMENT, |
||||
|
`nombre` VARCHAR(50) NOT NULL, |
||||
|
`apellidoPaterno` VARCHAR(50) NOT NULL, |
||||
|
`email` VARCHAR(100) NOT NULL, |
||||
|
`telefono` VARCHAR(10) NOT NULL, |
||||
|
`estado` INT NOT NULL, |
||||
|
`contrasenia` VARCHAR(20) NOT NULL, |
||||
|
`domicilio` VARCHAR(100) NOT NULL, |
||||
|
`estados_id` INT NOT NULL, |
||||
|
`roles_id` INT NOT NULL, |
||||
|
PRIMARY KEY (`id`), |
||||
|
INDEX `fk_usuarios_roles1_idx` (`roles_id` ASC) VISIBLE, |
||||
|
INDEX `fk_usuarios_estados1_idx` (`estados_id` ASC) VISIBLE, |
||||
|
CONSTRAINT `fk_usuarios_roles1` |
||||
|
FOREIGN KEY (`roles_id`) |
||||
|
REFERENCES `inventarioalmacen`.`roles` (`id`) |
||||
|
ON DELETE NO ACTION |
||||
|
ON UPDATE NO ACTION, |
||||
|
CONSTRAINT `fk_usuarios_estados1` |
||||
|
FOREIGN KEY (`estados_id`) |
||||
|
REFERENCES `inventarioalmacen`.`estados` (`id`) |
||||
|
ON DELETE NO ACTION |
||||
|
ON UPDATE NO ACTION) |
||||
|
ENGINE = InnoDB; |
||||
|
|
||||
|
|
||||
|
SET SQL_MODE=@OLD_SQL_MODE; |
||||
|
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; |
||||
|
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; |
Binary file not shown.
Binary file not shown.
@ -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="ProyectoInventario-war" default="default" basedir="."> |
||||
|
<description>Builds, tests, and runs the project ProyectoInventario-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> |
Binary file not shown.
@ -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,6 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<Scene Scope="Project" version="2"> |
||||
|
<Scope Scope="Faces Configuration Only"/> |
||||
|
<Scope Scope="Project"/> |
||||
|
<Scope Scope="All Faces Configurations"/> |
||||
|
</Scene> |
@ -0,0 +1,8 @@ |
|||||
|
build.xml.data.CRC32=6ebb76c7 |
||||
|
build.xml.script.CRC32=d42f2f65 |
||||
|
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=6ebb76c7 |
||||
|
nbproject/build-impl.xml.script.CRC32=4734eaf8 |
||||
|
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=libs\\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.ProyectoInventario-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.8 |
||||
|
javac.target=1.8 |
||||
|
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=default_platform |
||||
|
project.ProyectoInventario-ejb=../ProyectoInventario-ejb |
||||
|
reference.ProyectoInventario-ejb.dist=${project.ProyectoInventario-ejb}/dist/ProyectoInventario-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=ProyectoInventario-war.war |
||||
|
web.docbase.dir=web |
||||
|
webinf.dir=web/WEB-INF |
@ -0,0 +1,39 @@ |
|||||
|
<?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>ProyectoInventario-war</name> |
||||
|
<minimum-ant-version>1.6.5</minimum-ant-version> |
||||
|
<web-module-libraries> |
||||
|
<library dirs="100"> |
||||
|
<file>${reference.ProyectoInventario-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> |
||||
|
<libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1"> |
||||
|
<definitions>..\.\lib\nblibraries.properties</definitions> |
||||
|
</libraries> |
||||
|
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1"> |
||||
|
<reference> |
||||
|
<foreign-project>ProyectoInventario-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,63 @@ |
|||||
|
/* |
||||
|
* 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 xforce.seguridad; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import javax.inject.Named; |
||||
|
import javax.enterprise.context.SessionScoped; |
||||
|
import javax.faces.application.NavigationHandler; |
||||
|
import javax.faces.context.FacesContext; |
||||
|
import javax.faces.event.PhaseEvent; |
||||
|
import javax.faces.event.PhaseId; |
||||
|
import javax.faces.event.PhaseListener; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author Samuel Gamez |
||||
|
*/ |
||||
|
@Named(value = "autorizacionListener") |
||||
|
@SessionScoped |
||||
|
public class AutorizacionListener implements PhaseListener { |
||||
|
|
||||
|
/** |
||||
|
* Creates a new instance of AutorizacionListener |
||||
|
*/ |
||||
|
public AutorizacionListener() { |
||||
|
} |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@Override |
||||
|
public void afterPhase(PhaseEvent event) { |
||||
|
try { |
||||
|
//Obtener la pagina actual para validar la sesion
|
||||
|
String paginaActual = event.getFacesContext().getViewRoot().getViewId(); |
||||
|
|
||||
|
//inicializar la sesion en caso de no haber sesion
|
||||
|
DemoBeanLogin.getSession(); |
||||
|
|
||||
|
//Revisar que no sea la pafina index y que no estes logueado
|
||||
|
//para redireccionar
|
||||
|
if (!paginaActual.contains("index.xhtml") && DemoBeanLogin.getEstatus() == false) { |
||||
|
FacesContext.getCurrentInstance().getExternalContext().redirect("faces/index.xhtml?faces-redirect=true"); |
||||
|
|
||||
|
NavigationHandler nh = event.getFacesContext().getApplication().getNavigationHandler(); |
||||
|
nh.handleNavigation(event.getFacesContext(), null, "index"); |
||||
|
} |
||||
|
} catch (IOException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void beforePhase(PhaseEvent event) { |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public PhaseId getPhaseId() { |
||||
|
return PhaseId.RESTORE_VIEW; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,93 @@ |
|||||
|
/* |
||||
|
* 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 xforce.seguridad; |
||||
|
|
||||
|
import javax.inject.Named; |
||||
|
import javax.enterprise.context.SessionScoped; |
||||
|
import java.io.Serializable; |
||||
|
import javax.ejb.EJB; |
||||
|
import javax.faces.context.FacesContext; |
||||
|
import javax.servlet.http.HttpSession; |
||||
|
import xforce.bl.LoginBL; |
||||
|
import xforce.bl.LoginBLLocal; |
||||
|
import xforce.modelo.Usuarios; |
||||
|
import xforce.msg.Mensaje; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author Samuel Gamez |
||||
|
*/ |
||||
|
@Named(value = "demoBeanLogin") |
||||
|
@SessionScoped |
||||
|
public class DemoBeanLogin implements Serializable { |
||||
|
|
||||
|
@EJB |
||||
|
private LoginBLLocal loginBL; |
||||
|
|
||||
|
//variable para manejar la sesion
|
||||
|
public static HttpSession httpSession; |
||||
|
|
||||
|
/** |
||||
|
* Creates a new instance of DemoBeanLogin |
||||
|
*/ |
||||
|
public DemoBeanLogin() { |
||||
|
} |
||||
|
|
||||
|
private Usuarios usuarios = new Usuarios(); |
||||
|
|
||||
|
public Usuarios getUsuarios() { |
||||
|
return usuarios; |
||||
|
} |
||||
|
|
||||
|
public void setUsuarios(Usuarios usuarios) { |
||||
|
this.usuarios = usuarios; |
||||
|
} |
||||
|
|
||||
|
public static void getSession() { |
||||
|
httpSession = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false); |
||||
|
} |
||||
|
|
||||
|
public String logout() { |
||||
|
//quitar atributo
|
||||
|
//invalidar la session
|
||||
|
httpSession.removeAttribute("pinchilink"); |
||||
|
httpSession.invalidate(); |
||||
|
return "index.xhtml"; |
||||
|
} |
||||
|
|
||||
|
public String login() { |
||||
|
//BL de autenticacion de usuario
|
||||
|
//poner atributo
|
||||
|
|
||||
|
Mensaje mensaje = loginBL.login(usuarios); |
||||
|
|
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
usuarios = new Usuarios(); |
||||
|
httpSession.setAttribute("pinchilink", "true"); |
||||
|
return "productoLista.xhtml"; |
||||
|
case ELEMENTO_DUPLICADO: |
||||
|
return null;//"productoLista?faces-redirect=true"; // Redirecciona a la lista de productos
|
||||
|
case CAMPOS_INCOMPLETOS: |
||||
|
return null; |
||||
|
case DATOS_INCORRECTOS: |
||||
|
return null; |
||||
|
default: |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static boolean getEstatus() { |
||||
|
if (httpSession != null |
||||
|
&& httpSession.getId() != null |
||||
|
&& !httpSession.getId().isEmpty() |
||||
|
&& httpSession.getAttribute("pinchilink") != null) { |
||||
|
return true; |
||||
|
} else { |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,97 @@ |
|||||
|
/* |
||||
|
* 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 xforce.vista; |
||||
|
|
||||
|
import javax.inject.Named; |
||||
|
import javax.enterprise.context.SessionScoped; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
import javax.ejb.EJB; |
||||
|
import org.primefaces.PrimeFaces; |
||||
|
import xforce.bl.EstadosBLLocal; |
||||
|
import xforce.modelo.Estados; |
||||
|
import xforce.msg.Mensaje; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author Samuel Gamez |
||||
|
*/ |
||||
|
@Named(value = "demoBeanEstados") |
||||
|
@SessionScoped |
||||
|
public class DemoBeanEstados implements Serializable { |
||||
|
|
||||
|
@EJB |
||||
|
private EstadosBLLocal estadosBL; |
||||
|
|
||||
|
/** |
||||
|
* Creates a new instance of DemoBeanEstados |
||||
|
*/ |
||||
|
public DemoBeanEstados() { |
||||
|
} |
||||
|
|
||||
|
private Estados estados = new Estados(); |
||||
|
|
||||
|
private String titulo; |
||||
|
|
||||
|
private boolean nuevo; |
||||
|
|
||||
|
public List<Estados> getEstados() { |
||||
|
return estadosBL.buscarValidos(true); |
||||
|
} |
||||
|
|
||||
|
public Estados getEstado() { |
||||
|
return estados; |
||||
|
} |
||||
|
|
||||
|
public void setEstado(Estados estados) { |
||||
|
this.estados = estados; |
||||
|
} |
||||
|
|
||||
|
public String getTitulo() { |
||||
|
return titulo; |
||||
|
} |
||||
|
|
||||
|
public void setTitulo(String titulo) { |
||||
|
this.titulo = titulo; |
||||
|
} |
||||
|
|
||||
|
public String agregarEstados() { |
||||
|
|
||||
|
Mensaje mensaje = estadosBL.agregar(estados); |
||||
|
|
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
estados = new Estados(); |
||||
|
PrimeFaces.current().ajax().update("marcaTable:messages"); |
||||
|
PrimeFaces.current().ajax().update("userTable:messages"); |
||||
|
PrimeFaces.current().ajax().update("productoTable:messages"); |
||||
|
return null;//"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 void eliminarEstados(Estados estados) { |
||||
|
nuevo = false; |
||||
|
this.estados = estados; |
||||
|
estadosBL.eliminar(estados); |
||||
|
PrimeFaces.current().ajax().update("marcaTable:messages"); |
||||
|
PrimeFaces.current().ajax().update("userTable:messages"); |
||||
|
PrimeFaces.current().ajax().update("productoTable:messages"); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void prepararNuevo() { |
||||
|
nuevo = true; |
||||
|
estados = new Estados(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,184 @@ |
|||||
|
/* |
||||
|
* 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 xforce.vista; |
||||
|
|
||||
|
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.PrimeFaces; |
||||
|
import org.primefaces.util.LangUtils; |
||||
|
import xforce.bl.MarcaBLLocal; |
||||
|
import xforce.modelo.Marca; |
||||
|
import xforce.msg.Mensaje; |
||||
|
import static xforce.msg.Mensaje.CAMPOS_INCOMPLETOS; |
||||
|
import static xforce.msg.Mensaje.DATOS_INCORRECTOS; |
||||
|
import static xforce.msg.Mensaje.ELEMENTO_DUPLICADO; |
||||
|
import static xforce.msg.Mensaje.SIN_ERROR; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author Samuel Gamez |
||||
|
*/ |
||||
|
@Named(value = "demoBeanMarca") |
||||
|
@SessionScoped |
||||
|
public class DemoBeanMarca implements Serializable { |
||||
|
|
||||
|
@EJB |
||||
|
private MarcaBLLocal marcaBL; |
||||
|
|
||||
|
/** |
||||
|
* Creates a new instance of DemoBeanMarca |
||||
|
*/ |
||||
|
|
||||
|
private Marca marca = new Marca(); |
||||
|
private String titulo; |
||||
|
private boolean nuevo; |
||||
|
private List<Marca> marcaFilter; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
public DemoBeanMarca() { |
||||
|
} |
||||
|
|
||||
|
public String agregar() { |
||||
|
Mensaje mensaje = marcaBL.agregar(marca); |
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
marca = new Marca(); |
||||
|
PrimeFaces.current().executeScript("PF('mar').hide()"); |
||||
|
PrimeFaces.current().ajax().update("marcaTable:messages"); |
||||
|
return "marcaLista.xhtml"; // 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 String editarMarca(){ |
||||
|
Mensaje mensaje = marcaBL.editar(marca); |
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
marca = new Marca(); |
||||
|
PrimeFaces.current().executeScript("PF('mar').hide()"); |
||||
|
PrimeFaces.current().ajax().update("marcaTable:messages"); |
||||
|
return "marcaLista.xhtml"; // 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 String buscar() {
|
||||
|
// Marca marca = new Marca();
|
||||
|
// marca.setId(1);
|
||||
|
// marcaBL.buscarId(marca);
|
||||
|
// return "index.xhtml";
|
||||
|
// }
|
||||
|
//
|
||||
|
// public String buscarNombre() {
|
||||
|
// Marca marca = new Marca();
|
||||
|
// marca.setNombre("patito");
|
||||
|
// marcaBL.buscarNombre(marca);
|
||||
|
// return "index.xhtml";
|
||||
|
// }
|
||||
|
|
||||
|
public String buscarValidos() { |
||||
|
System.out.println(marcaBL.buscarValidos(true)); |
||||
|
return "index.xhtml"; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
public List<Marca> getMarcas(){ |
||||
|
return marcaBL.buscarValidos(true); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public Marca getMarca() { |
||||
|
return marca; |
||||
|
} |
||||
|
|
||||
|
public void setMarca(Marca marca) { |
||||
|
this.marca = marca; |
||||
|
} |
||||
|
|
||||
|
public boolean isNuevo() { |
||||
|
return nuevo; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public void rellenarEditar(Marca marca){ |
||||
|
nuevo = false; |
||||
|
titulo="Editando marca"; |
||||
|
this.marca=marca; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String getTitulo() { |
||||
|
return titulo; |
||||
|
} |
||||
|
public void prepararNuevo(){ |
||||
|
nuevo = true; |
||||
|
titulo="Nueva marca"; |
||||
|
marca = new Marca(); |
||||
|
|
||||
|
} |
||||
|
public void prepararEliminar(Marca marca){ |
||||
|
titulo = "Eliminar Marca"; |
||||
|
this.marca = marca; |
||||
|
} |
||||
|
public String eliminarMarca(){ |
||||
|
Mensaje mensaje = marcaBL.eliminar(marca); |
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
PrimeFaces.current().executeScript("PF('dialogD').hide()"); |
||||
|
PrimeFaces.current().ajax().update("marcaTable:messages"); |
||||
|
return "marcaLista.xhtml"; // Redirecciona a la lista de productos
|
||||
|
case ERROR_PRODUCTOS_ASOCIADOS: |
||||
|
return null; |
||||
|
|
||||
|
default: |
||||
|
return null; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public List<Marca> getMarcaFilter() { |
||||
|
return marcaFilter; |
||||
|
} |
||||
|
|
||||
|
public void setMarcaFilter(List<Marca> marcaFilter) { |
||||
|
this.marcaFilter = marcaFilter; |
||||
|
} |
||||
|
|
||||
|
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
||||
|
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
||||
|
if (LangUtils.isBlank(filterText)) { |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
Marca m = (Marca) value; |
||||
|
|
||||
|
return m.getNombre().toLowerCase().contains(filterText); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -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 xforce.vista; |
||||
|
|
||||
|
import javax.inject.Named; |
||||
|
import javax.enterprise.context.SessionScoped; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
import javax.ejb.EJB; |
||||
|
import org.primefaces.PrimeFaces; |
||||
|
import xforce.bl.PaisesBLLocal; |
||||
|
import xforce.modelo.Paises; |
||||
|
import xforce.modelo.Producto; |
||||
|
import xforce.modelo.Tipo; |
||||
|
import xforce.msg.Mensaje; |
||||
|
import static xforce.msg.Mensaje.CAMPOS_INCOMPLETOS; |
||||
|
import static xforce.msg.Mensaje.DATOS_INCORRECTOS; |
||||
|
import static xforce.msg.Mensaje.ELEMENTO_DUPLICADO; |
||||
|
import static xforce.msg.Mensaje.SIN_ERROR; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author Samuel Gamez |
||||
|
*/ |
||||
|
@Named(value = "demoBeanPaises") |
||||
|
@SessionScoped |
||||
|
public class DemoBeanPaises implements Serializable { |
||||
|
|
||||
|
@EJB |
||||
|
private PaisesBLLocal paisesBL; |
||||
|
|
||||
|
/** |
||||
|
* Creates a new instance of DemoBeaPaises |
||||
|
*/ |
||||
|
public DemoBeanPaises() { |
||||
|
} |
||||
|
|
||||
|
private Paises paises = new Paises(); |
||||
|
|
||||
|
private String titulo; |
||||
|
|
||||
|
private boolean nuevo; |
||||
|
|
||||
|
public List<Paises> getPaises() { |
||||
|
return paisesBL.buscarValidos(true); |
||||
|
} |
||||
|
|
||||
|
public Paises getPais() { |
||||
|
return paises; |
||||
|
} |
||||
|
|
||||
|
public void setPais(Paises paises) { |
||||
|
this.paises = paises; |
||||
|
} |
||||
|
|
||||
|
public String getTitulo() { |
||||
|
return titulo; |
||||
|
} |
||||
|
|
||||
|
public void setTitulo(String titulo) { |
||||
|
this.titulo = titulo; |
||||
|
} |
||||
|
|
||||
|
public String agregarPais() { |
||||
|
|
||||
|
Mensaje mensaje = paisesBL.agregar(paises); |
||||
|
|
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
paises = new Paises(); |
||||
|
PrimeFaces.current().ajax().update("marcaTable:messages"); |
||||
|
PrimeFaces.current().ajax().update("userTable:messages"); |
||||
|
PrimeFaces.current().ajax().update("productoTable:messages"); |
||||
|
return null;//"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 String editarProducto() { |
||||
|
|
||||
|
Mensaje mensaje = paisesBL.editar(paises); |
||||
|
|
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
paises = new Paises(); |
||||
|
PrimeFaces.current().ajax().update("marcaTable:messages"); |
||||
|
PrimeFaces.current().ajax().update("userTable:messages"); |
||||
|
PrimeFaces.current().ajax().update("productoTable:messages"); |
||||
|
return "productoLista.xhtml"; // 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 void eliminarPais(Paises paises) { |
||||
|
nuevo = false; |
||||
|
this.paises = paises; |
||||
|
paisesBL.eliminar(paises); |
||||
|
PrimeFaces.current().ajax().update("marcaTable:messages"); |
||||
|
PrimeFaces.current().ajax().update("userTable:messages"); |
||||
|
PrimeFaces.current().ajax().update("productoTable:messages"); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void prepararNuevo() { |
||||
|
nuevo = true; |
||||
|
paises = new Paises(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,178 @@ |
|||||
|
/* |
||||
|
* 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 xforce.vista; |
||||
|
|
||||
|
import javax.inject.Named; |
||||
|
import javax.enterprise.context.SessionScoped; |
||||
|
import java.io.Serializable; |
||||
|
import java.time.Instant; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
import java.util.Locale; |
||||
|
import javax.ejb.EJB; |
||||
|
import org.primefaces.PrimeFaces; |
||||
|
import org.primefaces.model.SortMeta; |
||||
|
import org.primefaces.util.LangUtils; |
||||
|
import xforce.bl.ProductoBLLocal; |
||||
|
import xforce.modelo.Producto; |
||||
|
import xforce.modelo.Tipo; |
||||
|
import xforce.msg.Mensaje; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author Samuel Gamez |
||||
|
*/ |
||||
|
@Named(value = "demoBeanProducto") |
||||
|
@SessionScoped |
||||
|
public class DemoBeanProducto implements Serializable { |
||||
|
|
||||
|
@EJB |
||||
|
private ProductoBLLocal productoBL; |
||||
|
|
||||
|
private Producto producto = new Producto(); |
||||
|
|
||||
|
private String titulo; |
||||
|
|
||||
|
private boolean nuevo; |
||||
|
|
||||
|
/////////////////////////////////////////
|
||||
|
private List<Producto> productoFilter;///
|
||||
|
////////////////////////////////////////
|
||||
|
|
||||
|
private List<SortMeta> sortBy; |
||||
|
|
||||
|
public List<SortMeta> getSortBy() { |
||||
|
return sortBy; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Creates a new instance of DemoBeanProducto |
||||
|
*/ |
||||
|
public DemoBeanProducto() { |
||||
|
} |
||||
|
|
||||
|
public String agregarProducto() { |
||||
|
|
||||
|
//producto.setFecha(Date.from(Instant.now()));
|
||||
|
|
||||
|
Mensaje mensaje = productoBL.agregar(producto); |
||||
|
|
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
producto = new Producto(); |
||||
|
PrimeFaces.current().executeScript("PF('dialogProducto').hide()"); |
||||
|
PrimeFaces.current().ajax().update("productoTable:messages"); |
||||
|
return "productoLista.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 String editarProducto() { |
||||
|
|
||||
|
Mensaje mensaje = productoBL.editar(producto); |
||||
|
|
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
producto = new Producto(); |
||||
|
PrimeFaces.current().executeScript("PF('dialogProducto').hide()"); |
||||
|
PrimeFaces.current().ajax().update("productoTable:messages"); |
||||
|
return "productoLista.xhtml"; // 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 void eliminarProducto() { |
||||
|
|
||||
|
productoBL.eliminar(producto); |
||||
|
|
||||
|
PrimeFaces.current().executeScript("PF('deleteProducto').hide()"); |
||||
|
PrimeFaces.current().ajax().update("productoTable:messages"); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void prepararEditar(Producto producto) { |
||||
|
nuevo = false; |
||||
|
titulo = "Editando Producto"; |
||||
|
this.producto = producto; |
||||
|
} |
||||
|
|
||||
|
public void prepararNuevo() { |
||||
|
nuevo = true; |
||||
|
titulo = "Nuevo Producto"; |
||||
|
producto = new Producto(); |
||||
|
} |
||||
|
|
||||
|
public void prepararEliminar(Producto producto) { |
||||
|
this.producto = producto; |
||||
|
} |
||||
|
|
||||
|
public List<Producto> getProductos() { |
||||
|
return productoBL.buscarValidos(true); |
||||
|
} |
||||
|
|
||||
|
//////////////////////////////////////////////////////////////////////
|
||||
|
public List<Producto> getProductoFilter() { //
|
||||
|
return productoFilter; //
|
||||
|
} //
|
||||
|
//
|
||||
|
|
||||
|
public void setProductoFilter(List<Producto> productoFilter) { //
|
||||
|
this.productoFilter = productoFilter; //
|
||||
|
} //
|
||||
|
//////////////////////////////////////////////////////////////////////
|
||||
|
|
||||
|
public Producto getProducto() { |
||||
|
return producto; |
||||
|
} |
||||
|
|
||||
|
public void setProducto(Producto producto) { |
||||
|
this.producto = producto; |
||||
|
} |
||||
|
|
||||
|
public String getTitulo() { |
||||
|
return titulo; |
||||
|
} |
||||
|
|
||||
|
public boolean isNuevo() { |
||||
|
return nuevo; |
||||
|
} |
||||
|
|
||||
|
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
||||
|
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
||||
|
if (LangUtils.isBlank(filterText)) { |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
Producto p = (Producto) value; |
||||
|
|
||||
|
return p.getNombre().toLowerCase().contains(filterText) |
||||
|
|| String.valueOf(p.getCodigo()).contains(filterText) |
||||
|
|| String.valueOf(p.getPrecio()).contains(filterText) |
||||
|
|| String.valueOf(p.getPiezas()).contains(filterText) |
||||
|
|| String.valueOf(p.getFecha()).contains(filterText) |
||||
|
|| p.getProveedorIdproveedor().getMarcaId().getNombre().toLowerCase().contains(filterText) |
||||
|
|| p.getProveedorIdproveedor().getNombre().toLowerCase().contains(filterText) |
||||
|
|| p.getTipoId().getTipo().toLowerCase().contains(filterText) |
||||
|
|| p.getUbicacionId().getLugar().toLowerCase().contains(filterText); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,212 @@ |
|||||
|
/* |
||||
|
* 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 xforce.vista; |
||||
|
|
||||
|
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.PrimeFaces; |
||||
|
import org.primefaces.util.LangUtils; |
||||
|
import xforce.bl.ProveedorBLLocal; |
||||
|
import xforce.modelo.Proveedor; |
||||
|
import xforce.modelo.Ubicacion; |
||||
|
import xforce.msg.Mensaje; |
||||
|
import static xforce.msg.Mensaje.CAMPOS_INCOMPLETOS; |
||||
|
import static xforce.msg.Mensaje.DATOS_INCORRECTOS; |
||||
|
import static xforce.msg.Mensaje.ELEMENTO_DUPLICADO; |
||||
|
import static xforce.msg.Mensaje.SIN_ERROR; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author oscar |
||||
|
*/ |
||||
|
@Named(value = "demoBeanProveedor") |
||||
|
@SessionScoped |
||||
|
public class DemoBeanProveedor implements Serializable { |
||||
|
|
||||
|
@EJB |
||||
|
private ProveedorBLLocal proveedorBL; |
||||
|
|
||||
|
private Proveedor proveedor = new Proveedor(); |
||||
|
private String titulo; |
||||
|
private boolean nuevo; |
||||
|
private List<Proveedor> proveedorFilter; |
||||
|
|
||||
|
/** |
||||
|
* Creates a new instance of DemoBeanProveedor |
||||
|
*/ |
||||
|
public DemoBeanProveedor() { |
||||
|
} |
||||
|
|
||||
|
public String agregar() { |
||||
|
|
||||
|
Mensaje mensaje = proveedorBL.agregar(proveedor); |
||||
|
|
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
proveedor = new Proveedor(); |
||||
|
PrimeFaces.current().executeScript("PF('dialogproveedor').hide()"); |
||||
|
PrimeFaces.current().ajax().update("proveedorTabla:messages"); |
||||
|
return "proveedorLista.xhtml"; // 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<Proveedor> getProveedorFilter() { |
||||
|
return proveedorFilter; |
||||
|
} |
||||
|
|
||||
|
public void setProveedorFilter(List<Proveedor> proveedorFilter) { |
||||
|
this.proveedorFilter = proveedorFilter; |
||||
|
} |
||||
|
|
||||
|
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
||||
|
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
||||
|
if (LangUtils.isBlank(filterText)) { |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
Proveedor p = (Proveedor) value; |
||||
|
|
||||
|
return p.getNombre().toLowerCase().contains(filterText) |
||||
|
|| p.getTelefono().contains(filterText) |
||||
|
|| p.getEmail().contains(filterText); |
||||
|
} |
||||
|
|
||||
|
public void agregarProveedor() { |
||||
|
proveedorBL.agregar(proveedor); |
||||
|
} |
||||
|
|
||||
|
public String eliminar() { |
||||
|
Proveedor p = new Proveedor(); |
||||
|
p.setId(1); |
||||
|
proveedorBL.eliminar(p); |
||||
|
return "index.xhtml"; |
||||
|
} |
||||
|
|
||||
|
public String buscar() { |
||||
|
Proveedor p = new Proveedor(); |
||||
|
p.setId(1); |
||||
|
proveedorBL.buscarId(p); |
||||
|
return "index.xhtml"; |
||||
|
} |
||||
|
|
||||
|
public String buscarNombre() { |
||||
|
Proveedor p = new Proveedor(); |
||||
|
p.setNombre("DHL"); |
||||
|
proveedorBL.buscarNombre(p); |
||||
|
return "index.xhtml"; |
||||
|
} |
||||
|
|
||||
|
public String editar() { |
||||
|
|
||||
|
Proveedor p = new Proveedor(); |
||||
|
p.setId(1); |
||||
|
p.setNombre("comex"); |
||||
|
p.setEmail("comex@gmail.com"); |
||||
|
p.setTelefono("3433445577"); |
||||
|
p.setEstado(2); |
||||
|
|
||||
|
proveedorBL.editar(p); |
||||
|
|
||||
|
return "index.xhtml"; |
||||
|
} |
||||
|
|
||||
|
public String buscarValidos() { |
||||
|
System.out.println(proveedorBL.buscarValidos(true)); |
||||
|
return "index.xhtml"; |
||||
|
} |
||||
|
|
||||
|
public List<Proveedor> getProveedores() { |
||||
|
return proveedorBL.buscarValidos(true); |
||||
|
} |
||||
|
|
||||
|
public Proveedor getProveedor() { |
||||
|
return proveedor; |
||||
|
} |
||||
|
|
||||
|
public void setProveedor(Proveedor proveedor) { |
||||
|
this.proveedor = proveedor; |
||||
|
} |
||||
|
|
||||
|
public void prepararEditar(Proveedor proveedor) { |
||||
|
nuevo = false; |
||||
|
titulo = "Editando Proveedor"; |
||||
|
this.proveedor = proveedor; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String getTitulo() { |
||||
|
return titulo; |
||||
|
} |
||||
|
|
||||
|
public boolean isNuevo() { |
||||
|
return nuevo; |
||||
|
} |
||||
|
|
||||
|
public void prepararnuevo() { |
||||
|
nuevo = true; |
||||
|
titulo = "Agregando proveedor"; |
||||
|
proveedor = new Proveedor(); |
||||
|
} |
||||
|
|
||||
|
public String editarP() { |
||||
|
|
||||
|
Mensaje mensaje = proveedorBL.editar(proveedor); |
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
proveedor = new Proveedor(); |
||||
|
PrimeFaces.current().executeScript("PF('dialogproveedor').hide()"); |
||||
|
PrimeFaces.current().ajax().update("proveedorTabla:messages"); |
||||
|
return "proveedorLista.xhtml"; // 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 void prepararEliminar(Proveedor proveedor) { |
||||
|
titulo = "Eliminar proveedor"; |
||||
|
this.proveedor = proveedor; |
||||
|
} |
||||
|
|
||||
|
public String eliminarProveedor() { |
||||
|
Mensaje mensaje = proveedorBL.eliminar(proveedor); |
||||
|
|
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
PrimeFaces.current().executeScript("PF('deleteProveedor').hide()"); |
||||
|
PrimeFaces.current().ajax().update("proveedorTabla:messages"); |
||||
|
return "proveedorLista.xhtml"; // Redirecciona a la lista de productos
|
||||
|
case ELEMENTO_DUPLICADO: |
||||
|
return null; |
||||
|
case CAMPOS_INCOMPLETOS: |
||||
|
return null; |
||||
|
case DATOS_INCORRECTOS: |
||||
|
return null; |
||||
|
case ERROR_PRODUCTOS_ASOCIADOS: |
||||
|
return null; |
||||
|
default: |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,116 @@ |
|||||
|
/* |
||||
|
* 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 xforce.vista; |
||||
|
|
||||
|
import javax.inject.Named; |
||||
|
import javax.enterprise.context.SessionScoped; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
import javax.ejb.EJB; |
||||
|
import org.primefaces.PrimeFaces; |
||||
|
import xforce.bl.RolesBLLocal; |
||||
|
import xforce.modelo.Roles; |
||||
|
import xforce.msg.Mensaje; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author hugoa |
||||
|
*/ |
||||
|
@Named(value = "demoBeanRoles") |
||||
|
@SessionScoped |
||||
|
public class DemoBeanRoles implements Serializable { |
||||
|
|
||||
|
@EJB |
||||
|
private RolesBLLocal rolesBL; |
||||
|
/** |
||||
|
* Creates a new instance of DemoBeanRoles |
||||
|
*/ |
||||
|
|
||||
|
public DemoBeanRoles() { |
||||
|
} |
||||
|
|
||||
|
private Roles roles = new Roles(); |
||||
|
private boolean nuevo; |
||||
|
private String titulo; |
||||
|
|
||||
|
public String agregarRol(){ |
||||
|
Mensaje mensaje = rolesBL.agregar(roles); |
||||
|
|
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
roles = new Roles(); |
||||
|
PrimeFaces.current().ajax().update("marcaTable:messages"); |
||||
|
PrimeFaces.current().ajax().update("userTable:messages"); |
||||
|
return null; |
||||
|
case ELEMENTO_DUPLICADO: |
||||
|
return null; |
||||
|
case CAMPOS_INCOMPLETOS: |
||||
|
return null; |
||||
|
case DATOS_INCORRECTOS: |
||||
|
return null; |
||||
|
default: |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public void prepararNuevo() { |
||||
|
nuevo = true; |
||||
|
titulo = "Roles"; |
||||
|
roles = new Roles(); |
||||
|
} |
||||
|
|
||||
|
public boolean isNuevo() { |
||||
|
return nuevo; |
||||
|
} |
||||
|
|
||||
|
public void eliminarRol(Roles roles) { |
||||
|
nuevo=false; |
||||
|
this.roles = roles; |
||||
|
rolesBL.eliminar(roles); |
||||
|
PrimeFaces.current().ajax().update("marcaTable:messages"); |
||||
|
PrimeFaces.current().ajax().update("userTable:messages"); |
||||
|
|
||||
|
} |
||||
|
public String getTitulo() { |
||||
|
return titulo; |
||||
|
} |
||||
|
public List<Roles> getRoles() { |
||||
|
return rolesBL.buscarValidos(true); |
||||
|
} |
||||
|
|
||||
|
public Roles getRol() { |
||||
|
return roles; |
||||
|
} |
||||
|
|
||||
|
public void setRol(Roles rol) { |
||||
|
this.roles = rol; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,89 @@ |
|||||
|
/* |
||||
|
* 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 xforce.vista; |
||||
|
|
||||
|
import javax.inject.Named; |
||||
|
import javax.enterprise.context.SessionScoped; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
import javax.ejb.EJB; |
||||
|
import org.primefaces.PrimeFaces; |
||||
|
import xforce.bl.TipoBLLocal; |
||||
|
import xforce.modelo.Tipo; |
||||
|
import xforce.msg.Mensaje; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author oscar |
||||
|
*/ |
||||
|
@Named(value = "demoBeanTipo") |
||||
|
@SessionScoped |
||||
|
public class DemoBeanTipo implements Serializable { |
||||
|
|
||||
|
@EJB |
||||
|
private TipoBLLocal tipoBl; |
||||
|
private Tipo tipo = new Tipo(); |
||||
|
private String titulo; |
||||
|
private boolean nuevo; |
||||
|
private List<Tipo> proveedorFilter; |
||||
|
|
||||
|
/** |
||||
|
* Creates a new instance of DemoBeanTipo |
||||
|
*/ |
||||
|
public DemoBeanTipo() { |
||||
|
} |
||||
|
|
||||
|
public String agregar() { |
||||
|
|
||||
|
Mensaje mensaje = tipoBl.agregar(tipo); |
||||
|
|
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
tipo = new Tipo(); |
||||
|
PrimeFaces.current().ajax().update("ubicacionTabla:messages"); |
||||
|
|
||||
|
return null; // 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 void eliminarTipo(Tipo tipo) { |
||||
|
nuevo=false; |
||||
|
this.tipo = tipo; |
||||
|
tipoBl.eliminar(tipo); |
||||
|
PrimeFaces.current().ajax().update("tipT:messages"); |
||||
|
PrimeFaces.current().ajax().update("ubicacionTabla:messages"); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
public void prepararNuevo() { |
||||
|
nuevo = true; |
||||
|
|
||||
|
tipo = new Tipo(); |
||||
|
} |
||||
|
|
||||
|
public boolean isNuevo() { |
||||
|
return nuevo; |
||||
|
} |
||||
|
public List<Tipo> getTipos() { |
||||
|
return tipoBl.buscarValidos(true); |
||||
|
} |
||||
|
|
||||
|
public Tipo getTipo() { |
||||
|
return tipo; |
||||
|
} |
||||
|
|
||||
|
public void setTipo(Tipo tip) { |
||||
|
this.tipo = tip; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,213 @@ |
|||||
|
/* |
||||
|
* 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 xforce.vista; |
||||
|
|
||||
|
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.PrimeFaces; |
||||
|
import org.primefaces.util.LangUtils; |
||||
|
import xforce.bl.UbicacionBLLocal; |
||||
|
import xforce.modelo.Marca; |
||||
|
import xforce.modelo.Ubicacion; |
||||
|
import xforce.msg.Mensaje; |
||||
|
import static xforce.msg.Mensaje.CAMPOS_INCOMPLETOS; |
||||
|
import static xforce.msg.Mensaje.DATOS_INCORRECTOS; |
||||
|
import static xforce.msg.Mensaje.ELEMENTO_DUPLICADO; |
||||
|
import static xforce.msg.Mensaje.SIN_ERROR; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author oscar |
||||
|
*/ |
||||
|
@Named(value = "demoBeanUbicacion") |
||||
|
@SessionScoped |
||||
|
public class DemoBeanUbicacion implements Serializable { |
||||
|
|
||||
|
@EJB |
||||
|
private UbicacionBLLocal ubicacionBL; |
||||
|
private Ubicacion ubicacion = new Ubicacion(); |
||||
|
private String titulo; |
||||
|
private boolean nuevo; |
||||
|
private List<Ubicacion> ubicacionFilter; |
||||
|
|
||||
|
/** |
||||
|
* Creates a new instance of DemoBeanUbicacion |
||||
|
*/ |
||||
|
public DemoBeanUbicacion() { |
||||
|
} |
||||
|
|
||||
|
public String agregar() { |
||||
|
|
||||
|
Mensaje mensaje = ubicacionBL.agregar(ubicacion); |
||||
|
|
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
ubicacion = new Ubicacion(); |
||||
|
PrimeFaces.current().executeScript("PF('mar').hide()"); |
||||
|
PrimeFaces.current().ajax().update("ubicacionTabla:messages"); |
||||
|
return "ubicacionLista.xhtml"; // 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 String editarU() { |
||||
|
|
||||
|
Mensaje mensaje = ubicacionBL.editar(ubicacion); |
||||
|
switch (mensaje) { |
||||
|
|
||||
|
case SIN_ERROR: |
||||
|
PrimeFaces.current().executeScript("PF('mar').hide()"); |
||||
|
PrimeFaces.current().ajax().update("ubicacionTabla:messages"); |
||||
|
ubicacion = new Ubicacion(); |
||||
|
return "ubicacionLista.xhtml"; // 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<Ubicacion> getUbicacionFilter() { |
||||
|
return ubicacionFilter; |
||||
|
} |
||||
|
|
||||
|
public void setUbicacionFilter(List<Ubicacion> ubicacionFilter) { |
||||
|
this.ubicacionFilter = ubicacionFilter; |
||||
|
} |
||||
|
|
||||
|
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
||||
|
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
||||
|
if (LangUtils.isBlank(filterText)) { |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
Ubicacion p = (Ubicacion) value; |
||||
|
|
||||
|
return p.getBloque().toLowerCase().contains(filterText) |
||||
|
|| String.valueOf(p.getAnaquel()).contains(filterText); |
||||
|
} |
||||
|
|
||||
|
public void agregarUbicacion() { |
||||
|
ubicacionBL.agregar(ubicacion); |
||||
|
} |
||||
|
|
||||
|
public String eliminar() { |
||||
|
|
||||
|
Ubicacion ubi = new Ubicacion(); |
||||
|
ubi.setId(1); |
||||
|
ubicacionBL.eliminar(ubi); |
||||
|
|
||||
|
return "index.xhtml"; |
||||
|
} |
||||
|
|
||||
|
public String buscar() { |
||||
|
Ubicacion p = new Ubicacion(); |
||||
|
p.setId(2); |
||||
|
ubicacionBL.buscarId(p); |
||||
|
return "index.xhtml"; |
||||
|
} |
||||
|
|
||||
|
public String buscarNombre() { |
||||
|
Ubicacion p = new Ubicacion(); |
||||
|
p.setBloque(""); |
||||
|
ubicacionBL.buscaUbicacion(p); |
||||
|
return "index.xhtml"; |
||||
|
} |
||||
|
|
||||
|
public String editar() { |
||||
|
|
||||
|
Ubicacion p = new Ubicacion(); |
||||
|
p.setId(1); |
||||
|
p.setBloque(""); |
||||
|
p.setAnaquel(1); |
||||
|
p.setEstado(2); |
||||
|
|
||||
|
ubicacionBL.editar(p); |
||||
|
|
||||
|
return "index.xhtml"; |
||||
|
} |
||||
|
|
||||
|
public String buscarValidos() { |
||||
|
System.out.println(ubicacionBL.buscarValidos(true)); |
||||
|
return "index.xhtml"; |
||||
|
} |
||||
|
|
||||
|
public List<Ubicacion> getUbicacion() { |
||||
|
return ubicacionBL.buscarValidos(true); |
||||
|
} |
||||
|
|
||||
|
public Ubicacion getUbi() { |
||||
|
return ubicacion; |
||||
|
} |
||||
|
|
||||
|
public void setUbicacion(Ubicacion ubicacion) { |
||||
|
this.ubicacion = ubicacion; |
||||
|
} |
||||
|
|
||||
|
public void prepararEditar(Ubicacion ubicacion) { |
||||
|
nuevo = false; |
||||
|
titulo = "Editando ubicacion"; |
||||
|
this.ubicacion = ubicacion; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String getTitulo() { |
||||
|
return titulo; |
||||
|
} |
||||
|
|
||||
|
public boolean isNuevo() { |
||||
|
return nuevo; |
||||
|
} |
||||
|
|
||||
|
public void prepararnuevo() { |
||||
|
nuevo = true; |
||||
|
titulo = "Agregando ubicacion"; |
||||
|
ubicacion = new Ubicacion(); |
||||
|
} |
||||
|
|
||||
|
public void prepararEliminar(Ubicacion ubicacion) { |
||||
|
|
||||
|
titulo="Eliminar ubicacion"; |
||||
|
|
||||
|
this.ubicacion = ubicacion; |
||||
|
} |
||||
|
|
||||
|
public String eliminarUbicacion() { |
||||
|
Mensaje mensaje = ubicacionBL.eliminar(ubicacion); |
||||
|
|
||||
|
switch (mensaje) { |
||||
|
|
||||
|
case SIN_ERROR: |
||||
|
PrimeFaces.current().executeScript("PF('deleteUbicacion').hide()"); |
||||
|
PrimeFaces.current().ajax().update("ubicacionTabla:messages"); |
||||
|
return "ubicacionLista.xhtml"; // Redirecciona a la lista de productos
|
||||
|
case ELEMENTO_DUPLICADO: |
||||
|
return null; |
||||
|
case CAMPOS_INCOMPLETOS: |
||||
|
return null; |
||||
|
case DATOS_INCORRECTOS: |
||||
|
return null; |
||||
|
default: |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,182 @@ |
|||||
|
/* |
||||
|
* 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 xforce.vista; |
||||
|
|
||||
|
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.PrimeFaces; |
||||
|
import org.primefaces.util.LangUtils; |
||||
|
import xforce.bl.UsuariosBLLocal; |
||||
|
import xforce.modelo.Estados; |
||||
|
import xforce.modelo.Usuarios; |
||||
|
import xforce.msg.Mensaje; |
||||
|
import static xforce.msg.Mensaje.CAMPOS_INCOMPLETOS; |
||||
|
import static xforce.msg.Mensaje.DATOS_INCORRECTOS; |
||||
|
import static xforce.msg.Mensaje.ELEMENTO_DUPLICADO; |
||||
|
import static xforce.msg.Mensaje.SIN_ERROR; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author hugoa |
||||
|
*/ |
||||
|
@Named(value = "demoBeanUsuarios") |
||||
|
@SessionScoped |
||||
|
public class DemoBeanUsuarios implements Serializable { |
||||
|
|
||||
|
@EJB |
||||
|
private UsuariosBLLocal usuariosBL; |
||||
|
|
||||
|
/** |
||||
|
* Creates a new instance of DemoBeanUsuarios |
||||
|
*/ |
||||
|
private Usuarios usuario = new Usuarios(); |
||||
|
private String titulo; |
||||
|
private boolean nuevo; |
||||
|
private List<Usuarios> usuariosFilter; |
||||
|
|
||||
|
public DemoBeanUsuarios() { |
||||
|
} |
||||
|
|
||||
|
public String agregar() { |
||||
|
|
||||
|
Estados estao = new Estados(); |
||||
|
estao.setId(3); |
||||
|
|
||||
|
usuario.setEstadosId(estao); |
||||
|
|
||||
|
Mensaje mensaje = usuariosBL.agregar(usuario); |
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
|
||||
|
usuario = new Usuarios(); |
||||
|
PrimeFaces.current().executeScript("PF('user').hide()"); |
||||
|
PrimeFaces.current().ajax().update("userTable:messages"); |
||||
|
return "usuariosLista.xhtml"; // 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 void eliminarUsuario() { |
||||
|
usuariosBL.eliminar(usuario); |
||||
|
PrimeFaces.current().executeScript("PF('userD').hide()"); |
||||
|
PrimeFaces.current().ajax().update("userTable:messages"); |
||||
|
} |
||||
|
|
||||
|
public void prepararEliminar(Usuarios usuario) { |
||||
|
titulo = "Eliminar usuario"; |
||||
|
this.usuario = usuario; |
||||
|
} |
||||
|
|
||||
|
public String buscarValidos() { |
||||
|
System.out.println(usuariosBL.buscarValidos(true)); |
||||
|
|
||||
|
return "index.xhtml"; |
||||
|
} |
||||
|
|
||||
|
public List<Usuarios> getUsuarios() { |
||||
|
return usuariosBL.buscarValidos(true); |
||||
|
} |
||||
|
|
||||
|
public String editarUsuario() { |
||||
|
Mensaje mensaje = usuariosBL.editar(usuario); |
||||
|
switch (mensaje) { |
||||
|
case SIN_ERROR: |
||||
|
usuario = new Usuarios(); |
||||
|
PrimeFaces.current().executeScript("PF('user').hide()"); |
||||
|
PrimeFaces.current().ajax().update("userTable:messages"); |
||||
|
return "usuariosLista.xhtml"; // 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 void prepararNuevo() { |
||||
|
nuevo = true; |
||||
|
titulo = "Nuevo usuario"; |
||||
|
usuario = new Usuarios(); |
||||
|
} |
||||
|
|
||||
|
public boolean isNuevo() { |
||||
|
return nuevo; |
||||
|
} |
||||
|
|
||||
|
public void rellenarEditar(Usuarios usuario) { |
||||
|
nuevo = false; |
||||
|
titulo = "Editando usuario"; |
||||
|
this.usuario = usuario; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String getTitulo() { |
||||
|
return titulo; |
||||
|
} |
||||
|
|
||||
|
public Usuarios getUsuario() { |
||||
|
return usuario; |
||||
|
} |
||||
|
|
||||
|
public void setUsuario(Usuarios usuario) { |
||||
|
this.usuario = usuario; |
||||
|
} |
||||
|
|
||||
|
public List<Usuarios> getUsuariosFilter() { |
||||
|
return usuariosFilter; |
||||
|
} |
||||
|
|
||||
|
public void setUsuariosFilter(List<Usuarios> usuariosFilter) { |
||||
|
this.usuariosFilter = usuariosFilter; |
||||
|
} |
||||
|
|
||||
|
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
||||
|
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
||||
|
if (LangUtils.isBlank(filterText)) { |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
Usuarios u = (Usuarios) value; |
||||
|
|
||||
|
return u.getNombre().toLowerCase().contains(filterText) |
||||
|
|| u.getApellidoPaterno().toLowerCase().contains(filterText) |
||||
|
|| u.getEmail().toLowerCase().contains(filterText) |
||||
|
|| u.getTelefono().toLowerCase().contains(filterText) |
||||
|
|| u.getRolesId().getRol().toLowerCase().contains(filterText) |
||||
|
|| u.getEstadosId().getNombre().toLowerCase().contains(filterText); |
||||
|
} |
||||
|
|
||||
|
// public String buscar() {
|
||||
|
// Usuarios usuarios = new Usuarios();
|
||||
|
//
|
||||
|
// usuarios.setId(4);
|
||||
|
//
|
||||
|
// usuariosBL.buscarId(usuarios);
|
||||
|
//
|
||||
|
// return "index.xhtml";
|
||||
|
// }
|
||||
|
//
|
||||
|
// public String buscarNombre(){
|
||||
|
// Usuarios usuario = new Usuarios();
|
||||
|
// usuario.setNombre("samuel");
|
||||
|
// usuariosBL.buscarNombre(usuario);
|
||||
|
// return "index.xhtml";
|
||||
|
// }
|
||||
|
} |
@ -0,0 +1,86 @@ |
|||||
|
/* |
||||
|
* 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 xforce.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 Samuel Gamez |
||||
|
*/ |
||||
|
@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,46 @@ |
|||||
|
/* |
||||
|
* 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 xforce.vista; |
||||
|
|
||||
|
import javax.inject.Named; |
||||
|
import javax.enterprise.context.SessionScoped; |
||||
|
import java.io.Serializable; |
||||
|
import org.primefaces.PrimeFaces; |
||||
|
import org.primefaces.model.DialogFrameworkOptions; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author Samuel Gamez |
||||
|
*/ |
||||
|
@Named(value = "ventanas") |
||||
|
@SessionScoped |
||||
|
public class ventanas implements Serializable { |
||||
|
|
||||
|
/** |
||||
|
* Creates a new instance of ventanas |
||||
|
*/ |
||||
|
public ventanas() { |
||||
|
} |
||||
|
|
||||
|
////////////////////////////////////////////////////////////////////////////
|
||||
|
public void viewProductsCustomized() { |
||||
|
DialogFrameworkOptions options = DialogFrameworkOptions.builder() |
||||
|
.modal(true) |
||||
|
.width("640") |
||||
|
.height("340") |
||||
|
.contentHeight("100%") |
||||
|
.contentWidth("100%") |
||||
|
.headerElement("customheader") |
||||
|
.build(); |
||||
|
|
||||
|
System.out.println("si"); |
||||
|
PrimeFaces.current().dialog().openDynamic("paises1", options, null); |
||||
|
} |
||||
|
|
||||
|
public void close() { |
||||
|
PrimeFaces.current().dialog().closeDynamic(this); |
||||
|
} |
||||
|
|
||||
|
} |
After Width: | Height: | Size: 453 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 69 KiB |
@ -0,0 +1,33 @@ |
|||||
|
<?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. |
||||
|
|
||||
|
--> |
||||
|
<faces-config version="2.2" |
||||
|
xmlns="http://xmlns.jcp.org/xml/ns/javaee" |
||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"> |
||||
|
|
||||
|
<lifecycle> |
||||
|
<phase-listener> |
||||
|
xforce.seguridad.AutorizacionListener |
||||
|
</phase-listener> |
||||
|
</lifecycle> |
||||
|
|
||||
|
</faces-config> |
@ -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> |
@ -0,0 +1,28 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"> |
||||
|
<context-param> |
||||
|
<param-name>javax.faces.PROJECT_STAGE</param-name> |
||||
|
<param-value>Development</param-value> |
||||
|
</context-param> |
||||
|
<servlet> |
||||
|
<servlet-name>Faces Servlet</servlet-name> |
||||
|
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class> |
||||
|
<load-on-startup>1</load-on-startup> |
||||
|
</servlet> |
||||
|
<servlet-mapping> |
||||
|
<servlet-name>Faces Servlet</servlet-name> |
||||
|
<url-pattern>/faces/*</url-pattern> |
||||
|
</servlet-mapping> |
||||
|
<session-config> |
||||
|
<session-timeout> |
||||
|
30 |
||||
|
</session-timeout> |
||||
|
</session-config> |
||||
|
<welcome-file-list> |
||||
|
<welcome-file>faces/productoLista.xhtml</welcome-file> |
||||
|
</welcome-file-list> |
||||
|
<context-param> |
||||
|
<param-name>javax.faces.CONFIG_FILES</param-name> |
||||
|
<param-value>/WEB-INF/faces-config.xml</param-value> |
||||
|
</context-param> |
||||
|
</web-app> |
@ -0,0 +1,140 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!-- |
||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license |
||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/XHtml.xhtml to edit this template |
||||
|
--> |
||||
|
<!DOCTYPE html> |
||||
|
<html xmlns="http://www.w3.org/1999/xhtml" |
||||
|
xmlns:p="http://primefaces.org/ui" |
||||
|
xmlns:h="http://xmlns.jcp.org/jsf/html" |
||||
|
xmlns:f="http://xmlns.jcp.org/jsf/core"> |
||||
|
|
||||
|
<body> |
||||
|
<f:view> |
||||
|
|
||||
|
<header style="display: flex; justify-content: center; font-size: 30px;"><strong>Estados</strong></header> |
||||
|
<p:divider/> |
||||
|
<main style="display: flex; justify-content: space-between; gap: 10px;"> |
||||
|
|
||||
|
<h:form id="formEstados"> |
||||
|
|
||||
|
<p:growl id="growl" showDetail="true" for="mensajePaises"/> |
||||
|
|
||||
|
<p:dataTable id="tableEstados" |
||||
|
value="#{demoBeanEstados.estados}" |
||||
|
var="item" |
||||
|
style="width: 600px" |
||||
|
paginator="true" |
||||
|
rows="5" |
||||
|
rowSelectMode="add" |
||||
|
paginatorPosition="bottom" > |
||||
|
|
||||
|
<p:column style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Nombre"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.nombre}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Estado"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.estado == 2 ? 'Activo':'Inactivo'}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Pais"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.paisesId.nombre}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<center> |
||||
|
<h:outputText value="Opciones"/> |
||||
|
</center> |
||||
|
</f:facet> |
||||
|
<p:commandButton action="#{demoBeanEstados.eliminarEstados(item)}" |
||||
|
ajax="true" |
||||
|
icon="pi pi-trash" |
||||
|
styleClass="ui-button-warning" |
||||
|
style="margin-top: 5px; width: 50px;" |
||||
|
update="formPais" /> |
||||
|
|
||||
|
</p:column> |
||||
|
|
||||
|
</p:dataTable> |
||||
|
|
||||
|
</h:form> |
||||
|
|
||||
|
<h:form style="margin-left: 20px; margin-top: 20px;"> |
||||
|
|
||||
|
<header style="display: flex; justify-content: center;">Nuevo Estado</header> |
||||
|
<p:divider/> |
||||
|
|
||||
|
<h:panelGrid columns="2"> |
||||
|
<p:outputLabel value="Nombre:" for="nombre" /> |
||||
|
<p:inputText id="nombre" value="#{demoBeanEstados.estado.nombre}" |
||||
|
title="Nombre" |
||||
|
required="true" |
||||
|
validatorMessage="Verifique el nombre" |
||||
|
requiredMessage="Este campo no puede estar vacio"> |
||||
|
|
||||
|
<f:validateRegex pattern="\b[A-ZÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,}(?:\s+[A-Za-zÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,})*\b" |
||||
|
for="nombre" /> |
||||
|
|
||||
|
</p:inputText> |
||||
|
|
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertNombre" for="nombre"/> |
||||
|
|
||||
|
<p:outputLabel value="Pais:" for="paisesId" /> |
||||
|
<p:selectOneMenu id="paisesId" |
||||
|
value="#{demoBeanEstados.estado.paisesId}" |
||||
|
converter="selectOneMenuConverter" |
||||
|
required="true" |
||||
|
requiredMessage="Se necesita un pais" |
||||
|
|
||||
|
filter="true" |
||||
|
filterMatchMode="startsWith" > |
||||
|
<!-- Arriba esta lo del filtro, jsjsjsjs --> |
||||
|
|
||||
|
<!-- TODO: update below reference to list of available items--> |
||||
|
<f:selectItems value="#{demoBeanPaises.paises}" |
||||
|
var="item" |
||||
|
itemLabel="#{item.nombre}" |
||||
|
itemValue="#{item}"/> |
||||
|
</p:selectOneMenu> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertPais" for="paisesId"/> |
||||
|
|
||||
|
</h:panelGrid> |
||||
|
|
||||
|
<footer style="display: flex; margin-top: 280px; justify-content: flex-end;"> |
||||
|
<p:commandButton action="#{demoBeanEstados.agregarEstados()}" |
||||
|
ajax="true" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;" |
||||
|
icon="pi pi-check" |
||||
|
update="formEstados:tableEstados, nombre, paisesId, |
||||
|
alertNombre, alertPais, formEstados:growl" /> |
||||
|
|
||||
|
<p:commandButton oncomplete="PF('estado').close()" |
||||
|
immediate="true" |
||||
|
ajax="false" |
||||
|
style="margin-left: 5px; width: 50px; " |
||||
|
icon="pi pi-times" |
||||
|
styleClass="ui-button-danger"/> |
||||
|
</footer> |
||||
|
|
||||
|
</h:form> |
||||
|
</main> |
||||
|
|
||||
|
</f:view> |
||||
|
|
||||
|
|
||||
|
</body> |
||||
|
</html> |
||||
|
|
@ -0,0 +1,15 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<!-- |
||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license |
||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/Html.html to edit this template |
||||
|
--> |
||||
|
<html> |
||||
|
<head> |
||||
|
<title>TODO supply a title</title> |
||||
|
<meta charset="UTF-8"> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||
|
</head> |
||||
|
<body> |
||||
|
<div>TODO write content</div> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,25 @@ |
|||||
|
<?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:h="http://xmlns.jcp.org/jsf/html" |
||||
|
xmlns:p="http://primefaces.org/ui" |
||||
|
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<h:head> |
||||
|
<h:body> |
||||
|
<ui:composition template="./template/login.xhtml"> |
||||
|
<ui:define name="contet"> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
|
||||
|
</ui:composition> |
||||
|
|
||||
|
</h:body> |
||||
|
</h:head> |
||||
|
</html> |
@ -0,0 +1,64 @@ |
|||||
|
<?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"> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
<ui:define name="left"> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
<ui:define name="right"> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
<ui:define name="content"> |
||||
|
<f:view> |
||||
|
|
||||
|
|
||||
|
<h:form> |
||||
|
|
||||
|
<p:messages id="messages" showDetail="true" closable="true"> |
||||
|
<p:autoUpdate/> |
||||
|
</p:messages> |
||||
|
|
||||
|
<h1><h:outputText value="#{demoBeanMarca.titulo}"/></h1> |
||||
|
<h:panelGrid columns="3" cellpadding="7"> |
||||
|
|
||||
|
<p:outputLabel value="Nombre:" for="nombre" /> |
||||
|
<p:inputText id="nombre" value="#{demoBeanMarca.marca.nombre}" title="Nombre" required="true"> |
||||
|
|
||||
|
</p:inputText> |
||||
|
<p:message for="nombre" display="tooltip"/> |
||||
|
|
||||
|
</h:panelGrid> |
||||
|
<p:commandButton action="#{demoBeanMarca.agregar()}" update="messages" rendered="#{demoBeanMarca.nuevo}" styleClass="ui-button-success" style="width: 50px;" icon="pi pi-save" ajax="false"/> |
||||
|
<p:commandButton action="#{demoBeanMarca.editarMarca()}" update="messages" rendered="#{!demoBeanMarca.nuevo}" icon="pi pi-save" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;" |
||||
|
ajax="false"/> |
||||
|
|
||||
|
<p:commandButton action="marcaLista.xhtml" immediate="true" style="margin-left: 5px; width: 50px; " icon="pi pi-times" styleClass="ui-button-danger" |
||||
|
ajax="false"/> |
||||
|
|
||||
|
</h:form> |
||||
|
|
||||
|
</f:view> |
||||
|
|
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
</ui:composition> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,60 @@ |
|||||
|
<?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"> |
||||
|
|
||||
|
</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="messages" showDetail="true"/> |
||||
|
<h1><h:outputText value="Eliminar"/></h1> |
||||
|
<p:panelGrid columns="2"> |
||||
|
<h:outputText value="Id:"/> |
||||
|
<h:outputText value="#{demoBeanMarca.marca.id}" title="Id"/> |
||||
|
<h:outputText value="Nombre:"/> |
||||
|
<h:outputText value="#{demoBeanMarca.marca.nombre}" title="Nombre"/> |
||||
|
<h:outputText value="Estado:"/> |
||||
|
<h:outputText value="#{demoBeanMarca.marca.estado == 2 ? 'Activo':'Inactivo'}" title="Estado"/> |
||||
|
</p:panelGrid> |
||||
|
<p:commandButton action="#{demoBeanMarca.eliminarMarca()}" ajax="false" |
||||
|
icon="pi pi-trash" |
||||
|
styleClass="ui-button-warning" |
||||
|
style=" width: 50px; " |
||||
|
|
||||
|
/> |
||||
|
<p:commandButton action="marcaLista.xhtml" immediate="true" |
||||
|
icon="pi pi-times" |
||||
|
styleClass="ui-button-danger" |
||||
|
ajax="false" |
||||
|
style="margin-left: 5px; width: 50px;" |
||||
|
/> |
||||
|
</h:form> |
||||
|
</f:view> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
</ui:composition> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,231 @@ |
|||||
|
<?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:p="http://primefaces.org/ui" |
||||
|
xmlns:h="http://xmlns.jcp.org/jsf/html" |
||||
|
xmlns:f="http://xmlns.jcp.org/jsf/core"> |
||||
|
|
||||
|
<body> |
||||
|
|
||||
|
<ui:composition template="./template/listas.xhtml"> |
||||
|
|
||||
|
<ui:define name="top"> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
<ui:define name="content"> |
||||
|
<f:view> |
||||
|
|
||||
|
<div> |
||||
|
<h:form> |
||||
|
<p:menubar > |
||||
|
|
||||
|
<p:menuitem value="Productos" action="productoLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Marcas" action="marcaLista.xhtml" disabled="true" ajax="false"/> |
||||
|
<p:menuitem value="Proveedores" action="proveedorLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Ubicaciones" action="ubicacionLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Usuarios" action="usuariosLista.xhtml" ajax="false"/> |
||||
|
<p:submenu label="Opciones" icon="pi pi-fw pi-list"> |
||||
|
<p:menuitem value="Roles" |
||||
|
icon="pi pi-fw pi-users" |
||||
|
oncomplete="PF('rol').show()" |
||||
|
update=":rolD" |
||||
|
actionListener="#{demoBeanRoles.prepararNuevo()}"/> |
||||
|
|
||||
|
<p:menuitem value="Paises" |
||||
|
icon="pi pi-globe" |
||||
|
oncomplete="PF('pais').show()" |
||||
|
update="paisDialog" |
||||
|
actionListener="#{demoBeanPaises.prepararNuevo()}"/> |
||||
|
|
||||
|
<p:menuitem value="Estados" |
||||
|
icon="pi pi-map" |
||||
|
oncomplete="PF('estado').show()" |
||||
|
update="estadosDialog" |
||||
|
actionListener="#{demoBeanEstados.prepararNuevo()}"/> |
||||
|
|
||||
|
<p:menuitem value="Tipos" icon="pi pi-tags"/> |
||||
|
<!-- <p:divider />--> |
||||
|
</p:submenu> |
||||
|
</p:menubar> |
||||
|
</h:form> |
||||
|
|
||||
|
<p:dialog id="rolD" widgetVar="rol" responsive="true" showEffect="fade" modal="true" resizable="false"> |
||||
|
<ui:include src="roles.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
<p:dialog id="paisDialog" widgetVar="pais" responsive="true" showEffect="fade" modal="true" resizable="false"> |
||||
|
<ui:include src="paises.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
<p:dialog id="estadosDialog" widgetVar="estado" responsive="true" showEffect="fade" modal="true" resizable="false"> |
||||
|
<ui:include src="estados.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
<!-- agregar id para el formulario --> |
||||
|
<h:form id="marcaTable"> |
||||
|
<p:growl id="messages" showDetail="true" /> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<!-- agregar accionador de dialogo("oncomplete") y actualizar el mismo dialogo ("update") --> |
||||
|
|
||||
|
<!-- agregar id a la tabla para actualizarla --> |
||||
|
<p:dataTable id="table" value="#{demoBeanMarca.marcas}" var="item" filteredValue="#{demoBeanMarca.marcaFilter}" |
||||
|
globalFilterFunction="#{demoBeanMarca.globalFilterFunction}" |
||||
|
widgetVar="filter" |
||||
|
paginator="true" rows="10" rowSelectMode="add" paginatorPosition="bottom" |
||||
|
resizableColumns="true" |
||||
|
showGridlines="true"> |
||||
|
|
||||
|
<f:facet name="header" > |
||||
|
|
||||
|
<div style="display: flex; align-items: center;"> |
||||
|
|
||||
|
<div style="flex: 1;"> |
||||
|
<p:commandButton style="margin-top: 5px;" actionListener="#{demoBeanMarca.prepararNuevo()}" oncomplete="PF('mar').show()" |
||||
|
value="Nuevo" update=":dialogForm" |
||||
|
icon="pi pi-plus" ajax="true"/> |
||||
|
</div> |
||||
|
|
||||
|
<div style="flex: 1; text-align: center;"> |
||||
|
<header style="display: flex; justify-content: center; font-size: 30px;"><strong>Marcas</strong></header> |
||||
|
</div> |
||||
|
|
||||
|
<div style="flex: 1; text-align: right;"> |
||||
|
<div class="ui-input-icon-left mr-2" > |
||||
|
<i class="pi pi-fw pi-search" /> |
||||
|
<p:inputText id="globalFilter" onkeyup="PF('filter').filter()" |
||||
|
placeholder="Buscar marca" |
||||
|
|
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</f:facet> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:column responsivePriority="1" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Nombre"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.nombre}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column responsivePriority="2" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Estado"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.estado == 2 ? 'Activo':'Inactivo'}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column responsivePriority="3" style="text-align: center;" > |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Opciones"/> |
||||
|
</f:facet> |
||||
|
|
||||
|
<div style="text-align: center;"> |
||||
|
<p:commandButton actionListener="#{demoBeanMarca.rellenarEditar(item)}" oncomplete="PF('mar').show()" update=":dialogForm" icon="pi pi-fw pi-pencil" styleClass="ui-button-secondary" ajax="true"/> |
||||
|
<p:commandButton actionListener="#{demoBeanMarca.prepararEliminar(item)}" icon="pi pi-trash" style="margin-left: 5px" styleClass="ui-button-danger" |
||||
|
oncomplete="PF('dialogD').show()" update=":dialogDel" |
||||
|
ajax="true"/> |
||||
|
</div> |
||||
|
</p:column> |
||||
|
|
||||
|
</p:dataTable> |
||||
|
</h:form> |
||||
|
|
||||
|
|
||||
|
<!-- agregar dialog modal --> |
||||
|
<p:dialog id="dialogForm" header="#{demoBeanMarca.titulo}" widgetVar="mar" responsive="true" showEffect="fade" modal="true" resizable="false"> |
||||
|
<p:growl id="growl" showDetail="true" for="mensajeMarca"/> |
||||
|
<h:form> |
||||
|
|
||||
|
|
||||
|
<h:panelGrid columns="2" cellpadding="7"> |
||||
|
<p:outputLabel value="Nombre:" for="nombre" /> |
||||
|
<p:inputText id="nombre" value="#{demoBeanMarca.marca.nombre}" title="Nombre" required="true" validatorMessage="nombre no valido" |
||||
|
requiredMessage="Este campo no puede estar vacio"> |
||||
|
|
||||
|
<f:validateRegex pattern="\b[A-ZÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,}(?:\s+[A-ZÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,})*\b" |
||||
|
for="nombre" /> |
||||
|
</p:inputText> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="name" for="nombre"/> |
||||
|
</h:panelGrid> |
||||
|
|
||||
|
<!-- botones en ajax true (excepto el cancelar) y updates referenciando a ids del dialog |
||||
|
(sobretodo a los id de los inputTxt) y tabla para actualizarla. continua en el bean --> |
||||
|
<footer style="display: flex; margin-top: 20px; justify-content: flex-end;"> |
||||
|
<p:commandButton action="#{demoBeanMarca.agregar()}" update="growl,marcaTable:table, nombre, name" rendered="#{demoBeanMarca.nuevo}" |
||||
|
styleClass="ui-button-success" style="width: 50px;" |
||||
|
icon="pi pi-save" ajax="true" |
||||
|
/> |
||||
|
|
||||
|
<p:commandButton action="#{demoBeanMarca.editarMarca()}" update="growl,marcaTable:table, nombre, name" rendered="#{!demoBeanMarca.nuevo}" |
||||
|
icon="pi pi-save" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;" |
||||
|
ajax="true"/> |
||||
|
|
||||
|
<p:commandButton action="marcaLista.xhtml" immediate="true" style="margin-left: 5px; width: 50px; " icon="pi pi-times" styleClass="ui-button-danger" |
||||
|
ajax="false"/> |
||||
|
</footer> |
||||
|
</h:form> |
||||
|
</p:dialog> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:dialog id="dialogDel" widgetVar="dialogD" header="#{demoBeanMarca.titulo}" responsive="true" showEffect="fade" modal="true" resizable="false"> |
||||
|
|
||||
|
<h:form> |
||||
|
<p:growl id="messages" showDetail="true" for="mensajeMarca"/> |
||||
|
|
||||
|
<h:panelGrid columns="2" cellpadding="7"> |
||||
|
|
||||
|
<h:outputText value="Nombre:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanMarca.marca.nombre}" title="Nombre"/> |
||||
|
<h:outputText value="Estatus:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanMarca.marca.estado == 2 ? 'Activo':'Inactivo'}" title="Estatus"/> |
||||
|
</h:panelGrid> |
||||
|
|
||||
|
<footer style="display: flex; margin-top: 20px; justify-content: flex-end;"> |
||||
|
<p:commandButton action="#{demoBeanMarca.eliminarMarca()}" ajax="true" |
||||
|
update="marcaTable:table, messages" |
||||
|
icon="pi pi-trash" |
||||
|
styleClass="ui-button-warning" |
||||
|
style=" width: 50px; " |
||||
|
|
||||
|
/> |
||||
|
<p:commandButton action="marcaLista.xhtml" immediate="true" |
||||
|
icon="pi pi-times" |
||||
|
styleClass="ui-button-danger" |
||||
|
ajax="false" |
||||
|
style="margin-left: 5px; width: 50px;" |
||||
|
/> |
||||
|
</footer> |
||||
|
</h:form> |
||||
|
|
||||
|
</p:dialog> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</f:view> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
</ui:composition> |
||||
|
|
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,106 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!-- |
||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license |
||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/XHtml.xhtml to edit this template |
||||
|
--> |
||||
|
<!DOCTYPE html> |
||||
|
<html xmlns="http://www.w3.org/1999/xhtml" |
||||
|
xmlns:p="http://primefaces.org/ui" |
||||
|
xmlns:h="http://xmlns.jcp.org/jsf/html" |
||||
|
xmlns:f="http://xmlns.jcp.org/jsf/core"> |
||||
|
|
||||
|
<body> |
||||
|
<f:view> |
||||
|
|
||||
|
<header style="display: flex; justify-content: center; font-size: 30px;"><strong>Paises</strong></header> |
||||
|
<p:divider/> |
||||
|
<main style="display: flex; justify-content: space-between; gap: 10px;"> |
||||
|
|
||||
|
<h:form id="formPais"> |
||||
|
|
||||
|
<p:growl id="growl" showDetail="true" for="mensajePaises"/> |
||||
|
|
||||
|
<p:dataTable id="tablePais" |
||||
|
value="#{demoBeanPaises.paises}" |
||||
|
var="item" |
||||
|
style="width: 600px" |
||||
|
paginator="true" |
||||
|
rows="4" |
||||
|
rowSelectMode="add" |
||||
|
paginatorPosition="bottom" > |
||||
|
|
||||
|
<p:column style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Nombre"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.nombre}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Estado"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.estado == 2 ? 'Activo':'Inactivo'}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<center> |
||||
|
<h:outputText value="Opciones"/> |
||||
|
</center> |
||||
|
</f:facet> |
||||
|
<p:commandButton action="#{demoBeanPaises.eliminarPais(item)}" |
||||
|
ajax="true" |
||||
|
icon="pi pi-trash" |
||||
|
styleClass="ui-button-warning" |
||||
|
style="margin-top: 5px; width: 50px;" |
||||
|
update="formPais" /> |
||||
|
|
||||
|
</p:column> |
||||
|
|
||||
|
</p:dataTable> |
||||
|
|
||||
|
</h:form> |
||||
|
|
||||
|
<h:form style="margin-left: 20px; margin-top: 20px;"> |
||||
|
|
||||
|
<header style="display: flex; justify-content: center;">Nuevo Pais</header> |
||||
|
<p:divider/> |
||||
|
|
||||
|
<h:panelGrid columns="2"> |
||||
|
<p:outputLabel value="Nombre:" for="nombre" /> |
||||
|
<p:inputText id="nombre" |
||||
|
value="#{demoBeanPaises.pais.nombre}" |
||||
|
title="Nombre" |
||||
|
required="true" |
||||
|
requiredMessage="The Nombre field is required."/> |
||||
|
|
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertNombre" for="nombre"/> |
||||
|
|
||||
|
</h:panelGrid> |
||||
|
|
||||
|
<footer style="display: flex; margin-top: 280px; justify-content: flex-end;"> |
||||
|
<p:commandButton action="#{demoBeanPaises.agregarPais()}" |
||||
|
ajax="true" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;" |
||||
|
icon="pi pi-check" |
||||
|
update="formPais:tablePais, nombre, alertNombre, formPais:growl" /> |
||||
|
|
||||
|
<p:commandButton oncomplete="PF('pais').close()" |
||||
|
immediate="true" |
||||
|
ajax="false" |
||||
|
style="margin-left: 5px; width: 50px; " |
||||
|
icon="pi pi-times" |
||||
|
styleClass="ui-button-danger"/> |
||||
|
</footer> |
||||
|
|
||||
|
</h:form> |
||||
|
</main> |
||||
|
|
||||
|
</f:view> |
||||
|
|
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,150 @@ |
|||||
|
<?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="#{demoBeanProducto.titulo}"/></h1> |
||||
|
<h:panelGrid columns="3" cellpadding="7"> |
||||
|
|
||||
|
<p:outputLabel value="Nombre:" for="nombre" /> |
||||
|
<p:inputText id="nombre" |
||||
|
value="#{demoBeanProducto.producto.nombre}" |
||||
|
title="Nombre" |
||||
|
required="true" |
||||
|
validatorMessage="El nombre no es valido" |
||||
|
requiredMessage="Este campo no puede estar vacio"> |
||||
|
|
||||
|
<f:validateRegex pattern="\b[A-Za-zÁáÉéÍíÓóÚúÜüÑñ]{3,}(?:\s+[A-Za-zÁáÉéÍíÓóÚúÜüÑñ]{3,})*\b" |
||||
|
for="nombre" /> |
||||
|
|
||||
|
</p:inputText> |
||||
|
<p:message for="nombre" /> |
||||
|
|
||||
|
<p:outputLabel value="Codigo:" for="codigo" /> |
||||
|
<p:inputText id="codigo" |
||||
|
value="#{demoBeanProducto.producto.codigo}" |
||||
|
title="Codigo" |
||||
|
required="true" |
||||
|
converterMessage="Solo se aceptan digitos" |
||||
|
requiredMessage="Este campo no puede estar vacio"/> |
||||
|
<p:message for="codigo" /> |
||||
|
|
||||
|
<p:outputLabel value="Precio:" for="precio" /> |
||||
|
<p:inputText id="precio" |
||||
|
value="#{demoBeanProducto.producto.precio}" |
||||
|
title="Precio" |
||||
|
required="true" |
||||
|
converterMessage="Solo se aceptan digitos" |
||||
|
requiredMessage="Este campo no puede estar vacio"/> |
||||
|
<p:message for="precio" /> |
||||
|
|
||||
|
<p:outputLabel value="Piezas:" for="piezas" /> |
||||
|
<p:inputText id="piezas" |
||||
|
value="#{demoBeanProducto.producto.piezas}" |
||||
|
title="Piezas" |
||||
|
required="true" |
||||
|
converterMessage="Solo se aceptan digitos" |
||||
|
requiredMessage="Este campo no puede estar vacio"/> |
||||
|
<p:message for="piezas" /> |
||||
|
|
||||
|
<p:outputLabel value="Marca:" |
||||
|
for="marcaId"/> |
||||
|
|
||||
|
<p:selectOneMenu id="marcaId" |
||||
|
value="#{demoBeanProducto.producto.marcaIdmarca}" |
||||
|
converter="selectOneMenuConverter" |
||||
|
required="true" |
||||
|
requiredMessage="Se necesita una marca" > |
||||
|
<!-- TODO: update below reference to list of available items--> |
||||
|
<f:selectItems value="#{demoBeanMarca.marcas}" |
||||
|
var="item" |
||||
|
itemLabel="#{item.nombre}" |
||||
|
itemValue="#{item}"/> |
||||
|
</p:selectOneMenu> |
||||
|
<p:message for="marcaId" /> |
||||
|
|
||||
|
<p:outputLabel value="Proveedor:" |
||||
|
for="proveedorIdproveedor" /> |
||||
|
|
||||
|
<p:selectOneMenu id="proveedorIdproveedor" |
||||
|
value="#{demoBeanProducto.producto.proveedorIdproveedor}" |
||||
|
converter="selectOneMenuConverter" |
||||
|
required="true" |
||||
|
requiredMessage="Se necesita un proveedor" > |
||||
|
<!-- TODO: update below reference to list of available items--> |
||||
|
<f:selectItems value="#{demoBeanProveedor.proveedores}" |
||||
|
var="item" |
||||
|
itemLabel="#{item.nombre}" |
||||
|
itemValue="#{item}"/> |
||||
|
</p:selectOneMenu> |
||||
|
<p:message for="proveedorIdproveedor" /> |
||||
|
|
||||
|
<p:outputLabel value="Ubicacion" |
||||
|
for="ubicacionId" /> |
||||
|
|
||||
|
<p:selectOneMenu id="ubicacionId" |
||||
|
value="#{demoBeanProducto.producto.ubicacionId}" |
||||
|
converter="selectOneMenuConverter" |
||||
|
required="true" |
||||
|
requiredMessage="Se necesita una ubicacion"> |
||||
|
<!-- TODO: update below reference to list of available items--> |
||||
|
<f:selectItems value="#{demoBeanUbicacion.ubicacion}" |
||||
|
var="item" |
||||
|
itemLabel="#{item.bloque}#{item.anaquel}" |
||||
|
itemValue="#{item}"/> |
||||
|
</p:selectOneMenu> |
||||
|
<p:message for="ubicacionId" /> |
||||
|
</h:panelGrid> |
||||
|
|
||||
|
<p:commandButton action="#{demoBeanProducto.agregarProducto()}" |
||||
|
update="messages" |
||||
|
rendered="#{demoBeanProducto.nuevo}" |
||||
|
ajax="false" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;" |
||||
|
icon="pi pi-check"/> |
||||
|
|
||||
|
<p:commandButton action="#{demoBeanProducto.editarProducto()}" |
||||
|
update="messages" |
||||
|
rendered="#{!demoBeanProducto.nuevo}" |
||||
|
ajax="false" |
||||
|
icon="pi pi-save" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;"/> |
||||
|
|
||||
|
<p:commandButton action="productoLista.xhtml" |
||||
|
immediate="true" |
||||
|
ajax="false" |
||||
|
style="margin-left: 5px; width: 50px; " |
||||
|
icon="pi pi-times" |
||||
|
styleClass="ui-button-danger"/> |
||||
|
</h:form> |
||||
|
</f:view> |
||||
|
</ui:define> |
||||
|
</ui:composition> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,72 @@ |
|||||
|
<?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="Eliminar producto"/></h1> |
||||
|
<p:panelGrid columns="2"> |
||||
|
<h:outputText value="Nombre:"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.nombre}" title="Nombre"/> |
||||
|
<h:outputText value="Codigo:"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.codigo}" title="Codigo"/> |
||||
|
<h:outputText value="Precio:"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.precio}" title="Precio"/> |
||||
|
<h:outputText value="Piezas:"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.piezas}" title="Piezas"/> |
||||
|
<h:outputText value="Estado:"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.estado == 2 ? 'Activo':'Inactivo'}" title="Estado"/> |
||||
|
<h:outputText value="Marca:"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.marcaIdmarca.nombre}" title="MarcaIdmarca"/> |
||||
|
<h:outputText value="Proveedor:"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.proveedorIdproveedor.nombre}" title="ProveedorIdproveedor"/> |
||||
|
<h:outputText value="Ubicacion:"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.ubicacionId.bloque}#{demoBeanProducto.producto.ubicacionId.anaquel}" title="UbicacionId"/> |
||||
|
</p:panelGrid> |
||||
|
|
||||
|
<p:commandButton action="productoLista.xhtml" |
||||
|
actionListener="#{demoBeanProducto.eliminarProducto()}" |
||||
|
ajax="false" |
||||
|
icon="pi pi-trash" |
||||
|
styleClass="ui-button-warning" |
||||
|
style="margin-top: 5px; width: 50px;"/> |
||||
|
|
||||
|
<p:commandButton action="productoLista.xhtml" |
||||
|
immediate="true" |
||||
|
ajax="false" |
||||
|
style="margin-top: 5px; margin-left: 5px; width: 50px; " |
||||
|
icon="pi pi-times" |
||||
|
styleClass="ui-button-danger"/> |
||||
|
|
||||
|
</h:form> |
||||
|
</f:view> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
</ui:composition> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,447 @@ |
|||||
|
<?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> |
||||
|
</h:head> |
||||
|
|
||||
|
|
||||
|
<body> |
||||
|
|
||||
|
<ui:composition template="./template/listas.xhtml"> |
||||
|
|
||||
|
|
||||
|
<ui:define name="top"> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
<ui:define name="content"> |
||||
|
<f:view> |
||||
|
|
||||
|
<div> |
||||
|
<h:form> |
||||
|
<p:menubar > |
||||
|
|
||||
|
<p:menuitem value="Productos" action="productoLista.xhtml" disabled="true" ajax="false"/> |
||||
|
<p:menuitem value="Marcas" action="marcaLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Proveedores" action="proveedorLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Ubicaciones" action="ubicacionLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Usuarios" action="usuariosLista.xhtml" ajax="false"/> |
||||
|
|
||||
|
<p:submenu label="Opciones" icon="pi pi-fw pi-list"> |
||||
|
<p:menuitem value="Roles" |
||||
|
icon="pi pi-fw pi-users" |
||||
|
oncomplete="PF('rol').show()" |
||||
|
update=":rolD" |
||||
|
actionListener="#{demoBeanRoles.prepararNuevo()}"/> |
||||
|
|
||||
|
<p:menuitem value="Paises" |
||||
|
icon="pi pi-globe" |
||||
|
oncomplete="PF('pais').show()" |
||||
|
update="paisDialog" |
||||
|
actionListener="#{demoBeanPaises.prepararNuevo()}"/> |
||||
|
|
||||
|
<p:menuitem value="Estados" |
||||
|
icon="pi pi-map" |
||||
|
oncomplete="PF('estado').show()" |
||||
|
update="estadosDialog" |
||||
|
actionListener="#{demoBeanEstados.prepararNuevo()}"/> |
||||
|
|
||||
|
<p:menuitem value="Tipos" |
||||
|
icon="pi pi-tags" |
||||
|
oncomplete="PF('tipo').show()" |
||||
|
update="tip" |
||||
|
actionListener="#{demoBeanTipo.prepararNuevo()}"/> |
||||
|
<!-- <p:divider />--> |
||||
|
</p:submenu> |
||||
|
|
||||
|
</p:menubar> |
||||
|
|
||||
|
</h:form> |
||||
|
|
||||
|
<p:dialog id="rolD" widgetVar="rol" responsive="true" |
||||
|
showEffect="fade" modal="true" resizable="false" style="height: auto"> |
||||
|
<ui:include src="roles.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
<p:dialog id="paisDialog" widgetVar="pais" responsive="true" |
||||
|
showEffect="fade" modal="true" resizable="false" style="height: auto"> |
||||
|
<ui:include src="paises.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
<p:dialog id="estadosDialog" widgetVar="estado" responsive="true" |
||||
|
showEffect="fade" modal="true" resizable="false" style="height: auto"> |
||||
|
<ui:include src="estados.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
<p:dialog id="tip" widgetVar="tipo" responsive="true" |
||||
|
showEffect="fade" modal="true" resizable="false" style="height: auto"> |
||||
|
<ui:include src="tipos.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<h:form id="productoTable"> |
||||
|
<p:growl id="messages" showDetail="true"/> |
||||
|
|
||||
|
<!-- Por aqui checa en el datatable y el facet --> |
||||
|
<!-- Es lo del buscador ese pedo, y se vincula al demo bean --> |
||||
|
|
||||
|
<div class="card"> |
||||
|
|
||||
|
<p:dataTable id="table" |
||||
|
value="#{demoBeanProducto.productos}" |
||||
|
var="item" |
||||
|
filteredValue="#{demoBeanProducto.productoFilter}" |
||||
|
globalFilterFunction="#{demoBeanProducto.globalFilterFunction}" |
||||
|
widgetVar="filtro" |
||||
|
|
||||
|
paginator="true" |
||||
|
rows="10" |
||||
|
rowSelectMode="add" |
||||
|
paginatorPosition="bottom" |
||||
|
resizableColumns="true" |
||||
|
showGridlines="true" > |
||||
|
|
||||
|
<f:facet name="header"> |
||||
|
<div style="display: flex; align-items: center;"> |
||||
|
<div style="flex: 1;"> <!-- Div para el botón a la izquierda --> |
||||
|
<p:commandButton actionListener="#{demoBeanProducto.prepararNuevo()}" |
||||
|
style="margin-top: 5px;" |
||||
|
value="Nuevo" |
||||
|
icon="pi pi-plus" |
||||
|
ajax="true" |
||||
|
oncomplete="PF('dialogProducto').show()" |
||||
|
update=":dialogForm"/> |
||||
|
</div> |
||||
|
|
||||
|
<div style="flex: 1; text-align: center;"> <!-- Div para el texto centrado --> |
||||
|
<header style="display: flex; justify-content: center; font-size: 30px;"><strong>Productos</strong></header> |
||||
|
</div> |
||||
|
|
||||
|
<div style="flex: 1; text-align: right;"> <!-- Div para el div a la derecha --> |
||||
|
<div class="ui-input-icon-left mr-2"> |
||||
|
<i class="pi pi-fw pi-search" /> |
||||
|
<p:inputText id="globalFilter" |
||||
|
onkeyup="PF('filtro').filter()" |
||||
|
placeholder="Buscador de productos" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</f:facet> |
||||
|
|
||||
|
<p:column responsivePriority="1" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Nombre"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.nombre}"/> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="2" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Codigo"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.codigo}"/> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="3" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Precio"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.precio}"/> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="3" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Piezas"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.piezas}"/> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="4" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Estado"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.estado == 2 ? 'Activo':'Inactivo'}"/> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="4" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Fecha"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.fecha}"> |
||||
|
<f:convertDateTime pattern="dd/MM/yyyy" /> |
||||
|
</h:outputText> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="5" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Marca"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.proveedorIdproveedor.marcaId.nombre}"/> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="5" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Proveedor"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.proveedorIdproveedor.nombre}"/> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="6" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Tipo"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.tipoId.tipo}"/> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="6" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Ubicacion"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.ubicacionId.lugar}"/> |
||||
|
</p:column> |
||||
|
<p:column style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Opciones"/> |
||||
|
</f:facet> |
||||
|
<div style="text-align: center;"> |
||||
|
|
||||
|
<p:commandButton styleClass="ui-button-secondary" |
||||
|
actionListener="#{demoBeanProducto.prepararEditar(item)}" |
||||
|
icon="pi pi-fw pi-pencil" |
||||
|
ajax="true" |
||||
|
oncomplete="PF('dialogProducto').show()" |
||||
|
update=":dialogForm" |
||||
|
/> |
||||
|
|
||||
|
<p:commandButton styleClass="ui-button-danger" |
||||
|
actionListener="#{demoBeanProducto.prepararEliminar(item)}" |
||||
|
icon="pi pi-trash" |
||||
|
ajax="true" |
||||
|
oncomplete="PF('deleteProducto').show()" |
||||
|
update=":dialogDel" |
||||
|
style="margin-left: 1px" |
||||
|
/> |
||||
|
</div> |
||||
|
</p:column> |
||||
|
</p:dataTable> |
||||
|
</div> |
||||
|
</h:form> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<!-- agregar dialog modal --> |
||||
|
<p:dialog id="dialogForm" |
||||
|
header="#{demoBeanProducto.titulo}" |
||||
|
widgetVar="dialogProducto" |
||||
|
responsive="true" |
||||
|
showEffect="fade" |
||||
|
modal="true" |
||||
|
resizable="false" |
||||
|
width="auto" |
||||
|
height="auto"> |
||||
|
|
||||
|
<h:form> |
||||
|
|
||||
|
<p:growl id="growl" showDetail="true" for="mensajeProducto"/> |
||||
|
|
||||
|
<h:panelGrid columns="6" cellpadding="7"> |
||||
|
|
||||
|
<p:outputLabel value="Nombre:" for="nombre" /> |
||||
|
<p:inputText id="nombre" |
||||
|
value="#{demoBeanProducto.producto.nombre}" |
||||
|
title="Nombre" |
||||
|
required="true" |
||||
|
validatorMessage="Verifique el nombre" |
||||
|
requiredMessage="Este campo no puede estar vacio" > |
||||
|
|
||||
|
<f:validateRegex pattern="\b[A-ZÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,}(?:\s+[A-Za-zÁÉÍÓÚÜÑ][a-záéíóúüñ]{0,})*\b" |
||||
|
for="nombre" /> |
||||
|
|
||||
|
</p:inputText> |
||||
|
|
||||
|
<p:outputLabel value="Codigo:" for="codigo" /> |
||||
|
<p:inputText id="codigo" |
||||
|
value="#{demoBeanProducto.producto.codigo}" |
||||
|
title="Codigo" |
||||
|
required="true" |
||||
|
converterMessage="Solo se aceptan numeros" |
||||
|
requiredMessage="Este campo no puede estar vacio"/> |
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Precio:" for="precio" /> |
||||
|
<p:inputText id="precio" |
||||
|
value="#{demoBeanProducto.producto.precio}" |
||||
|
title="Precio" |
||||
|
required="true" |
||||
|
converterMessage="Solo se aceptan numeros" |
||||
|
requiredMessage="Este campo no puede estar vacio"/> |
||||
|
|
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertNombre" for="nombre" /> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertCodigo" for="codigo" /> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertPrecio" for="precio" /> |
||||
|
|
||||
|
<p:outputLabel value="Piezas:" for="piezas" /> |
||||
|
<p:inputText id="piezas" |
||||
|
value="#{demoBeanProducto.producto.piezas}" |
||||
|
title="Piezas" |
||||
|
required="true" |
||||
|
converterMessage="Solo se aceptan numeros" |
||||
|
requiredMessage="Este campo no puede estar vacio"/> |
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Proveedor:" |
||||
|
for="proveedorId" /> |
||||
|
|
||||
|
<p:selectOneMenu id="proveedorId" |
||||
|
value="#{demoBeanProducto.producto.proveedorIdproveedor}" |
||||
|
converter="selectOneMenuConverter" |
||||
|
required="true" |
||||
|
requiredMessage="Se necesita un proveedor" > |
||||
|
<!-- TODO: update below reference to list of available items--> |
||||
|
<f:selectItems value="#{demoBeanProveedor.proveedores}" |
||||
|
var="item" |
||||
|
itemLabel="#{item.nombre}" |
||||
|
itemValue="#{item}"/> |
||||
|
</p:selectOneMenu> |
||||
|
|
||||
|
<p:outputLabel value="Ubicacion" |
||||
|
for="ubicacionId" /> |
||||
|
|
||||
|
<p:selectOneMenu id="ubicacionId" |
||||
|
value="#{demoBeanProducto.producto.ubicacionId}" |
||||
|
converter="selectOneMenuConverter" |
||||
|
required="true" |
||||
|
requiredMessage="Se necesita una ubicacion"> |
||||
|
<!-- TODO: update below reference to list of available items--> |
||||
|
<f:selectItems value="#{demoBeanUbicacion.ubicacion}" |
||||
|
var="item" |
||||
|
itemLabel="#{item.bloque}#{item.anaquel}" |
||||
|
itemValue="#{item}"/> |
||||
|
</p:selectOneMenu> |
||||
|
|
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertPiezas" for="piezas" /> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertProveedorId" for="proveedorId" /> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertUbicacionId" for="ubicacionId" /> |
||||
|
|
||||
|
<p:outputLabel value="Tipo:" |
||||
|
for="tipoId" /> |
||||
|
|
||||
|
<p:selectOneMenu id="tipoId" |
||||
|
value="#{demoBeanProducto.producto.tipoId}" |
||||
|
converter="selectOneMenuConverter" |
||||
|
required="true" |
||||
|
requiredMessage="Se necesita un tipo"> |
||||
|
TODO: update below reference to list of available items |
||||
|
<f:selectItems value="#{demoBeanTipo.tipos}" |
||||
|
var="item" |
||||
|
itemLabel="#{item.tipo}" |
||||
|
itemValue="#{item}"/> |
||||
|
</p:selectOneMenu> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
|
||||
|
<p:message id="alertTipo" for="tipoId" /> |
||||
|
|
||||
|
</h:panelGrid> |
||||
|
|
||||
|
<p:commandButton action="#{demoBeanProducto.agregarProducto()}" |
||||
|
update="growl, productoTable:table, |
||||
|
nombre, codigo, precio, piezas, proveedorId, ubicacionId, |
||||
|
alertNombre, alertCodigo, alertPrecio, alertPiezas, alertProveedorId, alertUbicacionId, alertTipo" |
||||
|
rendered="#{demoBeanProducto.nuevo}" |
||||
|
ajax="true" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;" |
||||
|
icon="pi pi-save"/> |
||||
|
|
||||
|
<p:commandButton action="#{demoBeanProducto.editarProducto()}" |
||||
|
update="growl, productoTable:table, |
||||
|
nombre, codigo, precio, piezas, proveedorId, ubicacionId, |
||||
|
alertNombre, alertCodigo, alertPrecio, alertPiezas, alertProveedorId, alertUbicacionId, alertTipo" |
||||
|
rendered="#{!demoBeanProducto.nuevo}" |
||||
|
ajax="true" |
||||
|
icon="pi pi-save" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;"/> |
||||
|
|
||||
|
<p:commandButton action="productoLista.xhtml" |
||||
|
immediate="true" |
||||
|
ajax="false" |
||||
|
style="margin-left: 5px; width: 50px; " |
||||
|
icon="pi pi-times" |
||||
|
styleClass="ui-button-danger"/> |
||||
|
</h:form> |
||||
|
|
||||
|
|
||||
|
</p:dialog> |
||||
|
|
||||
|
<p:dialog id="dialogDel" |
||||
|
header="Eliminar producto" |
||||
|
widgetVar="deleteProducto" |
||||
|
responsive="true" |
||||
|
showEffect="fade" |
||||
|
modal="true" |
||||
|
resizable="false" > |
||||
|
|
||||
|
<h:form> |
||||
|
|
||||
|
<h:panelGrid columns="6" cellpadding="7"> |
||||
|
<h:outputText value="Nombre:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.nombre}" title="Nombre"/> |
||||
|
<h:outputText value="Codigo:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.codigo}" title="Codigo"/> |
||||
|
<h:outputText value="Precio:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.precio}" title="Precio"/> |
||||
|
<h:outputText value="Piezas:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.piezas}" title="Piezas"/> |
||||
|
<h:outputText value="Estado:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.estado == 2 ? 'Activo':'Inactivo'}" title="Estado"/> |
||||
|
<h:outputText value="Fecha:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.fecha}" title="Fecha"> |
||||
|
<f:convertDateTime pattern="MM/dd/yyyy" /> |
||||
|
</h:outputText> |
||||
|
<h:outputText value="Proveedor:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.proveedorIdproveedor.nombre}" title="ProveedorIdproveedor"/> |
||||
|
<h:outputText value="Marca:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.proveedorIdproveedor.marcaId.nombre}" title="ProveedorIdproveedor"/> |
||||
|
<h:outputText value="Tipo:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.tipoId.tipo}" title="TipoId"/> |
||||
|
<h:outputText value="Ubicacion:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanProducto.producto.ubicacionId.bloque}#{demoBeanProducto.producto.ubicacionId.anaquel}" title="UbicacionId"/> |
||||
|
</h:panelGrid> |
||||
|
|
||||
|
<footer style="display: flex; margin-top: 20px; justify-content: flex-end;"> |
||||
|
<p:commandButton action="#{demoBeanProducto.eliminarProducto()}" |
||||
|
ajax="true" |
||||
|
icon="pi pi-trash" |
||||
|
styleClass="ui-button-warning" |
||||
|
style="margin-top: 5px; width: 50px;" |
||||
|
update="productoTable:table"/> |
||||
|
|
||||
|
<p:commandButton action="productoLista.xhtml" |
||||
|
immediate="true" |
||||
|
ajax="false" |
||||
|
style="margin-top: 5px; margin-left: 5px; width: 50px; " |
||||
|
icon="pi pi-times" |
||||
|
styleClass="ui-button-danger"/> |
||||
|
</footer> |
||||
|
|
||||
|
</h:form> |
||||
|
|
||||
|
</p:dialog> |
||||
|
|
||||
|
</f:view> |
||||
|
|
||||
|
</ui:define> |
||||
|
</ui:composition> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,94 @@ |
|||||
|
<?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="#{demoBeanProveedor.titulo}"/></h1> |
||||
|
<h:panelGrid columns="2" cellpadding="7"> |
||||
|
<p:outputLabel value="Nombre:" for="nombre" /> |
||||
|
|
||||
|
<p:inputText id="nombre" |
||||
|
value="#{demoBeanProveedor.proveedor.nombre}" |
||||
|
title="Nombre" |
||||
|
required="true" |
||||
|
validatorMessage="El nombre no es valido" |
||||
|
requiredMessage="Este campo no puede estar vacio"> |
||||
|
|
||||
|
<f:validateRegex pattern="\b[A-ZÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,}(?:\s+[A-ZÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,})*\b" |
||||
|
for="nombre"/> |
||||
|
|
||||
|
</p:inputText> |
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Telefono:" for="telefono" /> |
||||
|
<p:inputText id="telefono" |
||||
|
value="#{demoBeanProveedor.proveedor.telefono}" |
||||
|
title="Telefono" |
||||
|
required="true" validatorMessage="El numero de telefono no es valido" |
||||
|
requiredMessage="Este campo no puede estar vacio"> |
||||
|
|
||||
|
<f:validateRegex pattern="^\d{10}$" |
||||
|
for="telefono"/> |
||||
|
|
||||
|
</p:inputText> |
||||
|
|
||||
|
<p:outputLabel value="Email:" for="email" /> |
||||
|
<p:inputText id="email" |
||||
|
value="#{demoBeanProveedor.proveedor.email}" |
||||
|
title="Email"required="true" validatorMessage="El email no es valido" |
||||
|
requiredMessage="Este campo no puede estar vacio"> |
||||
|
|
||||
|
<f:validateRegex pattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$" |
||||
|
|
||||
|
for="email"/> |
||||
|
|
||||
|
</p:inputText> |
||||
|
|
||||
|
|
||||
|
<p:commandButton action="#{demoBeanProveedor.agregar()}" |
||||
|
rendered="#{demoBeanProveedor.nuevo}" |
||||
|
styleClass="ui-button-success" style="width: 50px;" icon="pi pi-check" |
||||
|
update="messages" ajax="false"/> |
||||
|
|
||||
|
<p:commandButton action="proveedorLista.xhtml" |
||||
|
actionListener="#{demoBeanProveedor.editarP()}" |
||||
|
rendered="#{!demoBeanProveedor.nuevo}" |
||||
|
styleClass="ui-button-secondary" |
||||
|
icon="pi pi-pencil" |
||||
|
value="Editar" ajax="false"/> |
||||
|
|
||||
|
<p:commandButton action="proveedorLista.xhtml" style="margin-left: 5px; width: 50px; " icon="pi pi-times" styleClass="ui-button-danger" ajax="false" immediate="true"/> |
||||
|
|
||||
|
</h:form> |
||||
|
</f:view> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
</ui:composition> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,61 @@ |
|||||
|
<?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="Eliminar"/></h1> |
||||
|
<p:panelGrid columns="2"> |
||||
|
<h:outputText value="Id:"/> |
||||
|
<h:outputText value="#{demoBeanProveedor.proveedor.id}" title="Id"/> |
||||
|
<h:outputText value="Nombre:"/> |
||||
|
<h:outputText value="#{demoBeanProveedor.proveedor.nombre}" title="Nombre"/> |
||||
|
<h:outputText value="Telefono:"/> |
||||
|
<h:outputText value="#{demoBeanProveedor.proveedor.telefono}" title="Telefono"/> |
||||
|
<h:outputText value="Email:"/> |
||||
|
<h:outputText value="#{demoBeanProveedor.proveedor.email}" title="Email"/> |
||||
|
<h:outputText value="Estado:"/> |
||||
|
<h:outputText value="#{demoBeanProveedor.proveedor.estado}" title="Estado"/> |
||||
|
</p:panelGrid> |
||||
|
|
||||
|
<p:commandButton action="proveedorLista.xhtml" actionListener="#{demoBeanProveedor.eliminarProveedor()}" |
||||
|
icon="pi pi-trash" |
||||
|
styleClass="ui-button-warning" |
||||
|
style=" width: 50px; " ajax="false"/> |
||||
|
|
||||
|
<p:commandButton action="proveedorLista.xhtml" icon="pi pi-times" |
||||
|
styleClass="ui-button-danger" |
||||
|
ajax="false" |
||||
|
style="margin-left: 5px; width: 50px;" immediate="true"/> |
||||
|
</h:form> |
||||
|
</f:view> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
</ui:composition> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,444 @@ |
|||||
|
<?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:p="http://primefaces.org/ui" |
||||
|
xmlns:h="http://xmlns.jcp.org/jsf/html" |
||||
|
xmlns:f="http://xmlns.jcp.org/jsf/core"> |
||||
|
|
||||
|
|
||||
|
<body> |
||||
|
|
||||
|
<ui:composition template="./template/listas.xhtml"> |
||||
|
|
||||
|
<ui:define name="top"> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<ui:define name="content"> |
||||
|
|
||||
|
<f:view> |
||||
|
<div> |
||||
|
<h:form> |
||||
|
|
||||
|
<p:menubar> |
||||
|
<p:menuitem value="Productos" action="productoLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Marcas" action="marcaLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Proveedores" action="proveedorLista.xhtml" disabled="true" ajax="false"/> |
||||
|
<p:menuitem value="Ubicaciones" action="ubicacionLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Usuarios" action="usuariosLista.xhtml" ajax="false"/> |
||||
|
|
||||
|
<p:submenu label="Opciones" icon="pi pi-fw pi-list"> |
||||
|
<p:menuitem value="Roles" |
||||
|
icon="pi pi-fw pi-users" |
||||
|
oncomplete="PF('rol').show()" |
||||
|
update=":rolD" |
||||
|
actionListener="#{demoBeanRoles.prepararNuevo()}"/> |
||||
|
|
||||
|
|
||||
|
<p:menuitem value="Paises" |
||||
|
icon="pi pi-globe" |
||||
|
oncomplete="PF('pais').show()" |
||||
|
update="paisDialog" |
||||
|
actionListener="#{demoBeanPaises.prepararNuevo()}"/> |
||||
|
|
||||
|
<p:menuitem value="Estados" |
||||
|
icon="pi pi-map" |
||||
|
oncomplete="PF('estado').show()" |
||||
|
update="estadosDialog" |
||||
|
actionListener="#{demoBeanEstados.prepararNuevo()}"/> |
||||
|
|
||||
|
<p:menuitem value="Tipos" |
||||
|
icon="pi pi-tags" |
||||
|
oncomplete="PF('tipo').show()" |
||||
|
update=":tip" |
||||
|
actionListener="#{demoBeanTipo.prepararNuevo()}"/> |
||||
|
<!-- <p:divider />--> |
||||
|
</p:submenu> |
||||
|
|
||||
|
|
||||
|
</p:menubar> |
||||
|
</h:form> |
||||
|
|
||||
|
<p:dialog id="rolD" widgetVar="rol" |
||||
|
header="#{demoBeanRoles.titulo}" |
||||
|
responsive="true" |
||||
|
showEffect="fade" modal="true" resizable="false"> |
||||
|
<ui:include src="roles.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
|
||||
|
<p:dialog id="tip" widgetVar="tipo" responsive="true" showEffect="fade" modal="true" resizable="false"> |
||||
|
<ui:include src="tipos.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
<p:dialog id="paisDialog" widgetVar="pais" responsive="true" |
||||
|
showEffect="fade" modal="true" resizable="false" style="height: auto"> |
||||
|
<ui:include src="paises.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
<p:dialog id="estadosDialog" widgetVar="estado" responsive="true" |
||||
|
showEffect="fade" modal="true" resizable="false" style="height: auto"> |
||||
|
<ui:include src="estados.xhtml"/> |
||||
|
</p:dialog> |
||||
|
</div> |
||||
|
|
||||
|
<h:form id="proveedorTabla"> |
||||
|
<p:growl id="messages" showDetail="true" for="mensajeProveedor"/> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<div class="card"> |
||||
|
|
||||
|
<p:dataTable id="table" |
||||
|
value="#{demoBeanProveedor.proveedores}" |
||||
|
var="item" |
||||
|
filteredValue="#{demoBeanProveedor.proveedorFilter}" |
||||
|
globalFilterFunction="#{demoBeanProveedor.globalFilterFunction}" |
||||
|
widgetVar="filtro" |
||||
|
resizableColumns="true" |
||||
|
showGridlines="true" |
||||
|
paginator="true" |
||||
|
paginatorPosition="bottom" |
||||
|
rows="10" |
||||
|
rowSelectMode="add"> |
||||
|
|
||||
|
<f:facet name="header"> |
||||
|
<div style="display: flex; justify-content: space-between; align-items: center;"> |
||||
|
<div style="flex: 1;"> |
||||
|
<p:commandButton actionListener="#{demoBeanProveedor.prepararnuevo()}" |
||||
|
icon="pi pi-plus" |
||||
|
oncomplete="PF('dialogproveedor').show()" |
||||
|
update=":dialogForm" |
||||
|
style="margin-top: 5px" |
||||
|
value="Nuevo" |
||||
|
ajax="true"/> |
||||
|
</div> |
||||
|
|
||||
|
<div style="flex: 1; text-align: center;"> <!-- Div para el texto centrado --> |
||||
|
<header style="display: flex; justify-content: center; font-size: 30px;"><strong>Proveedores</strong></header> |
||||
|
</div> |
||||
|
<div style="flex: 1; text-align: right;"> |
||||
|
<div class="ui-input-icon-left mr-2" > |
||||
|
<i class="pi pi-fw pi-search" /> |
||||
|
<p:inputText id="globalFilter" onkeyup="PF('filtro').filter()" |
||||
|
style="width:300px" |
||||
|
placeholder="Buscador de proveedores" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</f:facet> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<h1><h:outputText value=""/></h1> |
||||
|
|
||||
|
|
||||
|
<p:column responsivePriority="1" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Nombre"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.nombre}"/> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="1" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Telefono"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.telefono}"/> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="1" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Email"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.email}"/> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="1" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Estado"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.estado}"/> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="1" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Domicilio"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.domicilio}"/> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="1" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Estado"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.estadosId.nombre}"/> |
||||
|
</p:column> |
||||
|
<p:column responsivePriority="1" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Marca"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.marcaId.nombre}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:column> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Opciones"/> |
||||
|
</f:facet> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<div style="text-align: center"> |
||||
|
<p:commandButton action="#{demoBeanProveedor.prepararEditar(item)}" |
||||
|
styleClass="ui-button-secondary" |
||||
|
oncomplete="PF('dialogproveedor').show()" |
||||
|
update=":dialogForm" |
||||
|
icon="pi pi-pencil" |
||||
|
ajax="true"/> |
||||
|
|
||||
|
<p:commandButton actionListener="#{demoBeanProveedor.prepararEliminar(item)}" |
||||
|
icon="pi pi-trash" |
||||
|
oncomplete="PF('deleteProveedor').show()" |
||||
|
update=":dialogForm1" |
||||
|
style="margin-left: 5px" |
||||
|
styleClass="ui-button-danger" |
||||
|
ajax="true"/> |
||||
|
</div> |
||||
|
</p:column> |
||||
|
</p:dataTable> |
||||
|
</div> |
||||
|
|
||||
|
</h:form> |
||||
|
|
||||
|
<!-- agregar dialog modal --> |
||||
|
<p:dialog id="dialogForm" |
||||
|
header="#{demoBeanProveedor.titulo}" |
||||
|
widgetVar="dialogproveedor" |
||||
|
responsive="true" |
||||
|
showEffect="fade" |
||||
|
modal="true" |
||||
|
resizable="false"> |
||||
|
|
||||
|
<h:form> |
||||
|
|
||||
|
<p:growl id="messages" showDetail="true" for="mensajeProveedor"/> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<h:panelGrid columns="3" cellpadding="7"> |
||||
|
|
||||
|
<p:outputLabel value="Nombre" for="nombre" /> |
||||
|
<p:inputText id="nombre" |
||||
|
value="#{demoBeanProveedor.proveedor.nombre}" |
||||
|
title="Nombre" |
||||
|
required="true" |
||||
|
validatorMessage="Nombre no valido" |
||||
|
requiredMessage="Este campo no puede estar vacio" > |
||||
|
|
||||
|
<f:validateRegex pattern="\b[A-ZÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,}(?:\s+[A-ZÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,})*\b" |
||||
|
for="nombre" /> |
||||
|
</p:inputText> |
||||
|
|
||||
|
|
||||
|
<p:message id="n" for="nombre"/> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Telefono" for="telefono" /> |
||||
|
<p:inputText id="telefono" |
||||
|
value="#{demoBeanProveedor.proveedor.telefono}" |
||||
|
title="Telefono" |
||||
|
required="true" |
||||
|
validatorMessage="Numero de telefono no valido" |
||||
|
requiredMessage="Este campo no puede estar vacio" > |
||||
|
|
||||
|
<f:validateRegex pattern="^\d{10}$" |
||||
|
for="telefono" /> |
||||
|
</p:inputText> |
||||
|
<p:message id="t" for="telefono"/> |
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Email" for="email" /> |
||||
|
<p:inputText id="email" |
||||
|
value="#{demoBeanProveedor.proveedor.email}" |
||||
|
title="Email" |
||||
|
required="true" |
||||
|
validatorMessage="Email no valido" |
||||
|
requiredMessage="Este campo no puede estar vacio" > |
||||
|
|
||||
|
<f:validateRegex pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$" |
||||
|
for="email" /> |
||||
|
</p:inputText> |
||||
|
|
||||
|
<p:message id="e" for="email"/> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Domicilio:" for="domicilio" /> |
||||
|
<p:inputText id="domicilio" value="#{demoBeanProveedor.proveedor.domicilio}" |
||||
|
title="Domicilio" |
||||
|
required="true" |
||||
|
validatorMessage="domicilio no valido" |
||||
|
requiredMessage="Este campo no puede estar vacio" |
||||
|
style="width: 223px"> |
||||
|
<f:validateRegex pattern="^[A-Z].*#\d+.*" |
||||
|
for="domicilio" /><!-- validar Domicilio --> |
||||
|
</p:inputText> |
||||
|
|
||||
|
<p:message id="d" for="domicilio"/> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Estados:" for="estadosId" /> |
||||
|
<p:selectOneMenu id="estadosId" |
||||
|
value="#{demoBeanProveedor.proveedor.estadosId}" |
||||
|
converter="selectOneMenuConverter" |
||||
|
required="true" |
||||
|
requiredMessage="Estado requerido" |
||||
|
filter="true" |
||||
|
filterMatchMode="startsWith" > |
||||
|
|
||||
|
<!-- TODO: update below reference to list of available items--> |
||||
|
<f:selectItems value="#{demoBeanEstados.estados}" |
||||
|
var="item" |
||||
|
itemLabel="#{item.nombre}" |
||||
|
itemValue="#{item}"/> |
||||
|
</p:selectOneMenu> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:message id="eid" for="estadosId"/> |
||||
|
<p:outputLabel value="Marca:" for="marcaId" /> |
||||
|
<p:selectOneMenu id="marcaId" |
||||
|
value="#{demoBeanProveedor.proveedor.marcaId}" |
||||
|
converter="selectOneMenuConverter" |
||||
|
required="true" |
||||
|
requiredMessage="The MarcaId field is required." |
||||
|
filter="true" |
||||
|
filterMatchMode="startsWith" > |
||||
|
<!-- Arriba esta lo del filtro, jsjsjsjs --> |
||||
|
|
||||
|
<!-- TODO: update below reference to list of available items--> |
||||
|
<f:selectItems value="#{demoBeanMarca.marcas}" |
||||
|
var="item" |
||||
|
itemLabel="#{item.nombre}" |
||||
|
itemValue="#{item}"/> |
||||
|
|
||||
|
|
||||
|
</p:selectOneMenu> |
||||
|
|
||||
|
<p:message id="m" for="marcaId"/> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</h:panelGrid> |
||||
|
|
||||
|
<!-- botones en ajax true (excepto el cancelar) y updates referenciando a ids del dialog |
||||
|
(sobretodo a los id de los inputTxt) y tabla para actualizarla. continua en el bean --> |
||||
|
<p:commandButton action="#{demoBeanProveedor.agregar()}" |
||||
|
update="messages, proveedorTabla:table,email,e, nombre,n, telefono, t, " |
||||
|
rendered="#{demoBeanProveedor.nuevo}" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;" |
||||
|
icon="pi pi-save" ajax="true" |
||||
|
/> |
||||
|
|
||||
|
<p:commandButton action="#{demoBeanProveedor.editarP()}" |
||||
|
update="messages, proveedorTabla:table,email,e, nombre,n, telefono, t, " |
||||
|
rendered="#{!demoBeanProveedor.nuevo}" |
||||
|
icon="pi pi-save" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;" |
||||
|
ajax="true"/> |
||||
|
|
||||
|
<p:commandButton action="proveedorLista.xhtml" immediate="true" |
||||
|
style="margin-left: 5px; width: 50px; " |
||||
|
icon="pi pi-times" styleClass="ui-button-danger" |
||||
|
ajax="false"/> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</h:form> |
||||
|
|
||||
|
|
||||
|
</p:dialog> |
||||
|
|
||||
|
<p:dialog id="dialogForm1" |
||||
|
header="#{demoBeanProveedor.titulo} " |
||||
|
widgetVar="deleteProveedor" |
||||
|
responsive="true" |
||||
|
showEffect="fade" |
||||
|
modal="true" |
||||
|
resizable="true" |
||||
|
width="auto" |
||||
|
height="200"> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<h:form> |
||||
|
<p:growl id="messages" showDetail="true" for="mensajeProveedor"/> |
||||
|
<h1><h:outputText value=""/></h1> |
||||
|
<p:panelGrid columns="2"> |
||||
|
|
||||
|
<h:outputText value="Nombre:"/> |
||||
|
<h:outputText value="#{demoBeanProveedor.proveedor.nombre}" title="Nombre"/> |
||||
|
<h:outputText value="Telefono:"/> |
||||
|
<h:outputText value="#{demoBeanProveedor.proveedor.telefono}" title="Telefono"/> |
||||
|
<h:outputText value="Email:"/> |
||||
|
<h:outputText value="#{demoBeanProveedor.proveedor.email}" title="Email"/> |
||||
|
<h:outputText value="Estado:"/> |
||||
|
<h:outputText value="#{demoBeanProveedor.proveedor.estado}" title="Estado"/> |
||||
|
<h:outputText value="Local:"/> |
||||
|
<h:outputText value="#{demoBeanProveedor.proveedor.estadosId.nombre}" title="Email"/> |
||||
|
<h:outputText value="marca:"/> |
||||
|
<h:outputText value="#{demoBeanProveedor.proveedor.marcaId.nombre}" title="Estado"/> |
||||
|
|
||||
|
</p:panelGrid> |
||||
|
|
||||
|
<p:commandButton action="#{demoBeanProveedor.eliminarProveedor()}" |
||||
|
update="proveedorTabla:table, messages" |
||||
|
icon="pi pi-trash" |
||||
|
styleClass="ui-button-warning" |
||||
|
style=" width: 50px; " ajax="true"/> |
||||
|
|
||||
|
<p:commandButton action="proveedorLista.xhtml" icon="pi pi-times" |
||||
|
styleClass="ui-button-danger" |
||||
|
ajax="false" |
||||
|
style="margin-left: 5px; width: 50px;" immediate="true"/> |
||||
|
</h:form> |
||||
|
|
||||
|
</p:dialog> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</f:view> |
||||
|
|
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
</ui:composition> |
||||
|
|
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,82 @@ |
|||||
|
|
||||
|
#top { |
||||
|
position: relative; |
||||
|
background-color: #036fab; |
||||
|
color: white; |
||||
|
padding: 5px; |
||||
|
margin: 0px 0px 10px 0px; |
||||
|
} |
||||
|
|
||||
|
#bottom { |
||||
|
position: relative; |
||||
|
background-color: #c2dfef; |
||||
|
padding: 5px; |
||||
|
margin: 10px 0px 0px 0px; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
#left { |
||||
|
float: left; |
||||
|
background-color: #000000; |
||||
|
padding: 5px; |
||||
|
width: 150px; |
||||
|
} |
||||
|
|
||||
|
#right { |
||||
|
float: right; |
||||
|
background-color: #000000; |
||||
|
padding: 5px; |
||||
|
width: 150px; |
||||
|
} |
||||
|
.abajo{ |
||||
|
position: absolute; |
||||
|
bottom: 0; |
||||
|
} |
||||
|
.center_content { |
||||
|
position: relative; |
||||
|
background-color: #dddddd; |
||||
|
padding: 5px; |
||||
|
} |
||||
|
.titulo { |
||||
|
|
||||
|
font-family: Arial Black; |
||||
|
font-weight: bold; |
||||
|
|
||||
|
font-size: 30px; |
||||
|
color: pink; |
||||
|
|
||||
|
} |
||||
|
.negrita{ |
||||
|
font-family: Arial Black; |
||||
|
} |
||||
|
.centro{ |
||||
|
text-aling: center; |
||||
|
} |
||||
|
.izq{ |
||||
|
text-align: left; |
||||
|
} |
||||
|
.left_content { |
||||
|
background-color: #dddddd; |
||||
|
padding: 5px; |
||||
|
margin-left: 170px; |
||||
|
} |
||||
|
|
||||
|
.right_content { |
||||
|
background-color: #dddddd; |
||||
|
padding: 5px; |
||||
|
margin: 0px 170px 0px 170px; |
||||
|
} |
||||
|
|
||||
|
#top a:link, #top a:visited { |
||||
|
color: white; |
||||
|
font-weight : bold; |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
|
||||
|
#top a:link:hover, #top a:visited:hover { |
||||
|
color: black; |
||||
|
font-weight : bold; |
||||
|
text-decoration : underline; |
||||
|
} |
||||
|
|
||||
|
|
@ -0,0 +1,31 @@ |
|||||
|
body { |
||||
|
background-color: #ffffff; |
||||
|
font-size: 12px; |
||||
|
font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; |
||||
|
color: #000000; |
||||
|
margin: 10px; |
||||
|
} |
||||
|
|
||||
|
h1 { |
||||
|
font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; |
||||
|
border-bottom: 1px solid #AFAFAF; |
||||
|
font-size: 25px; |
||||
|
font-weight: bold; |
||||
|
margin: 0px; |
||||
|
padding: 0px; |
||||
|
color: #000000; |
||||
|
text-aling: center; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
a:link, a:visited { |
||||
|
color: #045491; |
||||
|
font-weight : bold; |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
|
||||
|
a:link:hover, a:visited:hover { |
||||
|
color: #000000; |
||||
|
font-weight : bold; |
||||
|
text-decoration : underline; |
||||
|
} |
@ -0,0 +1,93 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!-- |
||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license |
||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/XHtml.xhtml to edit this template |
||||
|
--> |
||||
|
<!DOCTYPE html> |
||||
|
<html xmlns="http://www.w3.org/1999/xhtml" |
||||
|
xmlns:p="http://primefaces.org/ui" |
||||
|
xmlns:h="http://xmlns.jcp.org/jsf/html" |
||||
|
xmlns:f="http://xmlns.jcp.org/jsf/core"> |
||||
|
|
||||
|
<body> |
||||
|
<f:view> |
||||
|
|
||||
|
<header style="display: flex; justify-content: center; font-size: 30px;"><strong>Roles</strong></header> |
||||
|
<p:divider/> |
||||
|
<main style="display: flex; justify-content: space-between; gap: 10px;"> |
||||
|
|
||||
|
<h:form id="rolForm"> |
||||
|
<p:growl id="messages" showDetail="true" for="mensajeRoles"/> |
||||
|
|
||||
|
<p:dataTable id="table" value="#{demoBeanRoles.roles}" var="item" style="width: 600px" |
||||
|
paginator="true" rows="5" rowSelectMode="add" paginatorPosition="bottom"> |
||||
|
<p:column style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Id"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.id}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Rol"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.rol}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Estado"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.estado == 2 ? 'Activo':'Inactivo'}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Opciones"/> |
||||
|
</f:facet> |
||||
|
<p:commandButton action="#{demoBeanRoles.eliminarRol(item)}" icon="pi pi-trash" style="margin-left: 5px" styleClass="ui-button-warning" |
||||
|
update="table" |
||||
|
ajax="true"/> |
||||
|
</p:column> |
||||
|
</p:dataTable> |
||||
|
</h:form> |
||||
|
|
||||
|
<h:form style="margin-top: 20px;"> |
||||
|
<header style="display: flex; justify-content: center;">Nuevo Rol</header> |
||||
|
<p:divider/> |
||||
|
<h:panelGrid columns="2" cellpadding="7"> |
||||
|
<p:outputLabel value="Rol:" for="rol" /> |
||||
|
<p:inputText id="rol" value="#{demoBeanRoles.rol.rol}" title="Rol" required="true" |
||||
|
requiredMessage="Este campo no puede estar vacio" |
||||
|
validatorMessage="entrada no valida" |
||||
|
> |
||||
|
<f:validateRegex pattern="^\b[A-ZÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,}\b$" |
||||
|
for="apellidoPaterno" /> |
||||
|
</p:inputText> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="rols" for="rol"/> |
||||
|
|
||||
|
|
||||
|
</h:panelGrid> |
||||
|
|
||||
|
<footer style="display: flex; margin-top: 280px; justify-content: flex-end;"> <!-- alinear a derecha --> |
||||
|
<p:commandButton action="#{demoBeanRoles.agregarRol()}" update="rolForm:table,rol,rols,rolForm:messages" rendered="#{demoBeanRoles.nuevo}" |
||||
|
styleClass="ui-button-success" style="width: 50px;" |
||||
|
icon="pi pi-save" ajax="true" |
||||
|
/> |
||||
|
|
||||
|
<p:commandButton oncomplete="PF('rol').close()" immediate="true" style="margin-left: 5px; width: 50px; " icon="pi pi-times" styleClass="ui-button-danger" |
||||
|
ajax="false"/> |
||||
|
</footer> |
||||
|
|
||||
|
</h:form> |
||||
|
</main> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</f:view> |
||||
|
|
||||
|
|
||||
|
</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"> |
||||
|
|
||||
|
<h:head> |
||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
||||
|
<h:outputStylesheet name="./css/default.css"/> |
||||
|
<h:outputStylesheet name="./css/cssLayout.css"/> |
||||
|
|
||||
|
<title>Gestor de inventario</title> |
||||
|
|
||||
|
</h:head> |
||||
|
|
||||
|
<h:body> |
||||
|
|
||||
|
<div class="titulo" id="top"> |
||||
|
<center> |
||||
|
<h class="centro">Almacen</h> |
||||
|
<h:form> |
||||
|
|
||||
|
|
||||
|
<p:commandButton action="#{demoBeanLogin.logout()}" |
||||
|
immediate="true" |
||||
|
ajax="false" |
||||
|
style="margin-left: 5px; width: 50px; " |
||||
|
icon="pi pi-times" |
||||
|
styleClass="ui-button-danger"/> |
||||
|
</h:form> |
||||
|
</center> |
||||
|
</div> |
||||
|
|
||||
|
<div id="content" class="center_content"> |
||||
|
<ui:insert name="content">Content</ui:insert> |
||||
|
</div> |
||||
|
|
||||
|
<div id="bottom"> |
||||
|
<center> |
||||
|
<h5>Derechos reservados XFORCE</h5> |
||||
|
|
||||
|
<!-- <ui:insert name="bottom">Bottom</ui:insert>--> |
||||
|
<h5>2024</h5> |
||||
|
</center> |
||||
|
</div> |
||||
|
|
||||
|
</h:body> |
||||
|
|
||||
|
</html> |
@ -0,0 +1,73 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!-- |
||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license |
||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/XHtml.xhtml to edit this template |
||||
|
--> |
||||
|
<!DOCTYPE html> |
||||
|
<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"> |
||||
|
<head> |
||||
|
<title>Ingreso</title> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> |
||||
|
<h:outputStylesheet name="./css/default.css"/> |
||||
|
<h:outputStylesheet name="./css/cssLayout.css"/> |
||||
|
|
||||
|
</head> |
||||
|
<center> |
||||
|
|
||||
|
<h:body style="text-align: center; background-color:#ffffff "> |
||||
|
|
||||
|
<div class="titulo" id="top"> |
||||
|
<center> |
||||
|
<h class="centro">Almacen</h> |
||||
|
|
||||
|
</center> |
||||
|
</div> |
||||
|
<h:form> |
||||
|
|
||||
|
<p:panel header="Inicio de sesion" style="width:300px"> |
||||
|
|
||||
|
<h:panelGrid style="margin-bottom: 100px"> |
||||
|
|
||||
|
|
||||
|
<img src="../Images/Usuario.png" alt="" width="105" height="110"/> |
||||
|
|
||||
|
|
||||
|
</h:panelGrid> |
||||
|
<h:panelGrid columns="1" cellpadding="5"> |
||||
|
|
||||
|
<p:inputText id="usuario" |
||||
|
value="#{demoBeanLogin.usuarios.nombre}" |
||||
|
title='nombre' |
||||
|
|
||||
|
required="true" |
||||
|
requiredMessage="Este campo no puede estar vacio" |
||||
|
placeholder="Ingrese el usuario"> |
||||
|
</p:inputText> |
||||
|
|
||||
|
|
||||
|
<p:password id="contrasenia" |
||||
|
value="#{demoBeanLogin.usuarios.contrasenia}" |
||||
|
title="contraseña" |
||||
|
redisplay="true" |
||||
|
required="true" |
||||
|
|
||||
|
requiredMessage="Este campo no puede estar vacio" |
||||
|
placeholder="Ingrese la contraseña"> |
||||
|
|
||||
|
</p:password> |
||||
|
|
||||
|
<p:commandButton icon="pi pi-check" style="width: 60px" action="#{demoBeanLogin.login()}" ajax="false"/> |
||||
|
</h:panelGrid> |
||||
|
|
||||
|
|
||||
|
</p:panel> |
||||
|
|
||||
|
</h:form> |
||||
|
|
||||
|
</h:body> |
||||
|
</center> |
||||
|
</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"> |
||||
|
|
||||
|
<h:head> |
||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
||||
|
<h:outputStylesheet name="./css/default.css"/> |
||||
|
<h:outputStylesheet name="./css/cssLayout.css"/> |
||||
|
|
||||
|
<!-- <script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script> |
||||
|
<link href="https://cdn.datatables.net/v/dt/dt-2.0.2/datatables.min.css" rel="stylesheet"/> |
||||
|
<script src="https://cdn.datatables.net/v/dt/dt-2.0.2/datatables.min.js"></script>--> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<title>Gestor de inventario</title> |
||||
|
<style> |
||||
|
|
||||
|
</style> |
||||
|
</h:head> |
||||
|
|
||||
|
<h:body> |
||||
|
|
||||
|
<div class="titulo" id="top"> |
||||
|
<center> |
||||
|
<h class="centro">Almacen</h> |
||||
|
</center> |
||||
|
</div> |
||||
|
|
||||
|
<div> |
||||
|
<div id="left"> |
||||
|
<ui:insert name="left">Left</ui:insert> |
||||
|
</div> |
||||
|
<div> |
||||
|
<div id="right"> |
||||
|
<ui:insert name="right">Right</ui:insert> |
||||
|
</div> |
||||
|
<div id="content" class="right_content"> |
||||
|
<ui:insert name="content">Content</ui:insert> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div id="bottom"> |
||||
|
|
||||
|
<h5>Derechos reservados XFORCE</h5> |
||||
|
|
||||
|
<!-- <ui:insert name="bottom">Bottom</ui:insert>--> |
||||
|
<h5>2024</h5> |
||||
|
</div> |
||||
|
|
||||
|
</h:body> |
||||
|
|
||||
|
</html> |
@ -0,0 +1,167 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!-- |
||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license |
||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/XHtml.xhtml to edit this template |
||||
|
--> |
||||
|
<!DOCTYPE html> |
||||
|
<html xmlns="http://www.w3.org/1999/xhtml" |
||||
|
xmlns:p="http://primefaces.org/ui" |
||||
|
xmlns:h="http://xmlns.jcp.org/jsf/html" |
||||
|
xmlns:f="http://xmlns.jcp.org/jsf/core"> |
||||
|
|
||||
|
|
||||
|
<body> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<f:view> |
||||
|
|
||||
|
<main style="display: flex; justify-content: space-between;"> |
||||
|
|
||||
|
|
||||
|
<h:form id="tipT"> |
||||
|
<p:growl id="messages" showDetail="true" for="tipoM"/> |
||||
|
|
||||
|
<p:dataTable id="table" value="#{demoBeanTipo.tipos}" var="item" style="width: 600px" |
||||
|
paginator="true" rows="5" rowSelectMode="add" paginatorPosition="bottom"> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<h1><h:outputText value="List"/></h1> |
||||
|
|
||||
|
<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="Tipo"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.tipo}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Opciones"/> |
||||
|
</f:facet> |
||||
|
<p:commandButton action="#{demoBeanTipo.eliminarTipo(item)}" |
||||
|
icon="pi pi-trash" |
||||
|
style="margin-left: 5px" |
||||
|
styleClass="ui-button-danger" |
||||
|
oncomplete="PF('tipo').show()" |
||||
|
update="table" |
||||
|
ajax="true"/> |
||||
|
</p:column> |
||||
|
</p:dataTable> |
||||
|
</h:form> |
||||
|
|
||||
|
|
||||
|
<h:form style="margin-left: 20px; margin-top: 20px;"> |
||||
|
<header style="display: flex; justify-content: center;">Nuevo tipo</header> |
||||
|
<p:divider/> |
||||
|
|
||||
|
<h:panelGrid columns="3" cellpadding="7"> |
||||
|
<p:outputLabel value="Tipo" for="tipo" /> |
||||
|
<p:inputText id="tipo" |
||||
|
value="#{demoBeanTipo.tipo.tipo}" |
||||
|
title="Tipo" |
||||
|
required="true" |
||||
|
requiredMessage="este campo no puede estar vacio" |
||||
|
validatorMessage="entrada no valida" |
||||
|
> |
||||
|
<f:validateRegex pattern="^\b[A-ZÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,}\b$" |
||||
|
for="apellidoPaterno" /> |
||||
|
</p:inputText> |
||||
|
<p:message id="tipos" for="tipo"/> |
||||
|
|
||||
|
|
||||
|
</h:panelGrid> |
||||
|
|
||||
|
<footer style="display: flex; margin-top: 340px; justify-content: flex-end;"> <!-- alinear a derecha --> |
||||
|
<p:commandButton action="#{demoBeanTipo.agregar()}" |
||||
|
update="tipT:table,tipo,tipos,tipT:messages" |
||||
|
rendered="#{demoBeanTipo.nuevo}" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;" |
||||
|
icon="pi pi-save" ajax="true" |
||||
|
/> |
||||
|
|
||||
|
<p:commandButton oncomplete="pf('tipo').close()" |
||||
|
immediate="true" |
||||
|
style="margin-left: 5px; width: 50px; " |
||||
|
icon="pi pi-times" |
||||
|
styleClass="ui-button-danger" |
||||
|
ajax="false"/> |
||||
|
</footer> |
||||
|
|
||||
|
</h:form> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</main> |
||||
|
|
||||
|
</f:view> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</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"> |
||||
|
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> |
||||
|
<p:messages id="messages" showDetail="true" closable="true"> |
||||
|
|
||||
|
</p:messages> |
||||
|
|
||||
|
<h1><h:outputText value="#{demoBeanUbicacion.titulo}"/></h1> |
||||
|
<h:panelGrid columns="2" cellpadding="7"> |
||||
|
|
||||
|
<p:outputLabel value="Bloque:" for="bloque" /> |
||||
|
<p:inputText converter="" id="bloque" |
||||
|
value="#{demoBeanUbicacion.ubi.bloque}" |
||||
|
title="Bloque" |
||||
|
required="true" |
||||
|
|
||||
|
validatorMessage="Asignación no valida" |
||||
|
requiredMessage="Asignación no valida"> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</p:inputText> |
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Anaquel:" for="anaquel" /> |
||||
|
<p:inputText id="anaquel" value="#{demoBeanUbicacion.ubi.anaquel}" title="Anaquel" /> |
||||
|
|
||||
|
</h:panelGrid> |
||||
|
<p:commandButton action="#{demoBeanUbicacion.agregar()}" |
||||
|
|
||||
|
update="messages" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;" icon="pi pi-check" |
||||
|
rendered="#{demoBeanUbicacion.nuevo}" |
||||
|
ajax="false"/> |
||||
|
|
||||
|
<p:commandButton |
||||
|
action="#{demoBeanUbicacion.editarU()}" |
||||
|
rendered="#{!demoBeanUbicacion.nuevo}" |
||||
|
update="messages" |
||||
|
icon="pi pi-save" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;" ajax="false"/> |
||||
|
|
||||
|
<p:commandButton action="ubicacionLista.xhtml" style="margin-left: 5px; width: 50px; " |
||||
|
icon="pi pi-times" |
||||
|
styleClass="ui-button-danger" |
||||
|
ajax="false" immediate="true"/> |
||||
|
</h:form> |
||||
|
</f:view> |
||||
|
|
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
</ui:composition> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,58 @@ |
|||||
|
<?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="Eliminar"/></h1> |
||||
|
<p:panelGrid columns="2"> |
||||
|
<h:outputText value="Id:"/> |
||||
|
<h:outputText value="#{demoBeanUbicacion.ubi.id}" title="Id"/> |
||||
|
<h:outputText value="Bloque:"/> |
||||
|
<h:outputText value="#{demoBeanUbicacion.ubi.bloque}" title="Bloque"/> |
||||
|
<h:outputText value="Anaquel:"/> |
||||
|
<h:outputText value="#{demoBeanUbicacion.ubi.anaquel}" title="Anaquel"/> |
||||
|
<h:outputText value="Estado:"/> |
||||
|
<h:outputText value="#{demoBeanUbicacion.ubi.estado}" title="Estado"/> |
||||
|
</p:panelGrid> |
||||
|
<p:commandButton action="ubicacionLista.xhtml" actionListener="#{demoBeanUbicacion.eliminarUbicacion()}" |
||||
|
icon="pi pi-trash" |
||||
|
style=" width: 50px; " |
||||
|
styleClass="ui-button-warning" ajax="false"/> |
||||
|
|
||||
|
<p:commandButton action="ubicacionLista.xhtml" icon="pi pi-times" |
||||
|
styleClass="ui-button-danger" |
||||
|
style="margin-left: 5px; width: 50px;" |
||||
|
immediate="true" ajax="false"/> |
||||
|
</h:form> |
||||
|
</f:view> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
</ui:composition> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,306 @@ |
|||||
|
<?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/listas.xhtml"> |
||||
|
|
||||
|
<ui:define name="top"> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
<ui:define name="content"> |
||||
|
<f:view> |
||||
|
<div> |
||||
|
<h:form> |
||||
|
<p:menubar> |
||||
|
|
||||
|
<p:menuitem value="Productos" action="productoLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Marcas" action="marcaLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Proveedores" action="proveedorLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Ubicaciones" action="ubicacionLista.xhtml" disabled="true" ajax="false"/> |
||||
|
<p:menuitem value="Usuarios" action="usuariosLista.xhtml" ajax="false"/> |
||||
|
|
||||
|
<p:submenu label="Opciones" icon="pi pi-fw pi-list"> |
||||
|
|
||||
|
<p:menuitem value="Roles" |
||||
|
icon="pi pi-fw pi-users" |
||||
|
oncomplete="PF('rol').show()" |
||||
|
update=":rolD" |
||||
|
actionListener="#{demoBeanRoles.prepararNuevo()}"/> |
||||
|
|
||||
|
|
||||
|
<p:menuitem value="Paises" |
||||
|
icon="pi pi-globe" |
||||
|
oncomplete="PF('pais').show()" |
||||
|
update="paisDialog" |
||||
|
actionListener="#{demoBeanPaises.prepararNuevo()}"/> |
||||
|
|
||||
|
<p:menuitem value="Estados" |
||||
|
icon="pi pi-map" |
||||
|
oncomplete="PF('estado').show()" |
||||
|
update="estadosDialog" |
||||
|
actionListener="#{demoBeanEstados.prepararNuevo()}"/> |
||||
|
|
||||
|
<p:menuitem value="Tipos" |
||||
|
icon="pi pi-tags" |
||||
|
oncomplete="PF('tipo').show()" |
||||
|
update=":tip" |
||||
|
actionListener="#{demoBeanTipo.prepararNuevo()}"/> |
||||
|
<!-- <p:divider />--> |
||||
|
</p:submenu> |
||||
|
|
||||
|
|
||||
|
</p:menubar> |
||||
|
</h:form> |
||||
|
|
||||
|
<p:dialog id="rolD" widgetVar="rol" header="#{demoBeanRoles.titulo}" responsive="true" showEffect="fade" modal="true" resizable="false"> |
||||
|
<ui:include src="roles.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
|
||||
|
<p:dialog id="tip" widgetVar="tipo" responsive="true" showEffect="fade" modal="true" resizable="false"> |
||||
|
<ui:include src="tipos.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
<p:dialog id="paisDialog" widgetVar="pais" responsive="true" |
||||
|
showEffect="fade" modal="true" resizable="false" style="height: auto"> |
||||
|
<ui:include src="paises.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
<p:dialog id="estadosDialog" widgetVar="estado" responsive="true" |
||||
|
showEffect="fade" modal="true" resizable="false" style="height: auto"> |
||||
|
<ui:include src="estados.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
<!--id para el formulario --> |
||||
|
<h:form id="ubicacionTabla" > |
||||
|
|
||||
|
<p:growl id="messages" showDetail="true" /> |
||||
|
|
||||
|
<!-- agregar accionador de dialogo("oncomplete") y actualizar el mismo dialogo ("update") --> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:dataTable id="table" value="#{demoBeanUbicacion.ubicacion}" |
||||
|
var="item" |
||||
|
filteredValue="#{demoBeanUbicacion.ubicacionFilter}" |
||||
|
globalFilterFunction="#{demoBeanUbicacion.globalFilterFunction}" |
||||
|
widgetVar="filter" |
||||
|
paginator="true" |
||||
|
resizableColumns="true" |
||||
|
showGridlines="true" |
||||
|
|
||||
|
paginatorPosition="bottom" |
||||
|
|
||||
|
rows="10" |
||||
|
rowSelectMode="add" > |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<f:facet name="header"> |
||||
|
|
||||
|
<div style="display: flex; justify-content: space-between; align-items: center;"> |
||||
|
<div style="flex: 1;"> |
||||
|
<p:commandButton style="margin-top: 5px;" |
||||
|
actionListener="#{demoBeanUbicacion.prepararnuevo()}" |
||||
|
oncomplete="PF('mar').show()" |
||||
|
value="Nuevo" |
||||
|
update=":dialogForm" |
||||
|
icon="pi pi-plus" |
||||
|
ajax="true"/> |
||||
|
</div> |
||||
|
<div style="flex: 1; text-align: center;"> <!-- Div para el texto centrado --> |
||||
|
<header style="display: flex; justify-content: center; font-size: 30px;"><strong>Ubicacion</strong></header> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div style="flex: 1; text-align: right;"> |
||||
|
|
||||
|
<div class="flex justify-content-end"> |
||||
|
<p:inputText id="globalFilter" |
||||
|
onkeyup="PF('filter').filter()" |
||||
|
style="width:300px" |
||||
|
placeholder="Buscador general" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</f:facet> |
||||
|
|
||||
|
<p:column responsivePriority="3"> |
||||
|
|
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Bloque"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.bloque}"/> |
||||
|
</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="Opciones"/> |
||||
|
|
||||
|
</f:facet> |
||||
|
<p:column> |
||||
|
<div style="text-align: center"> |
||||
|
<p:commandButton actionListener="#{demoBeanUbicacion.prepararEditar(item)}" |
||||
|
oncomplete="PF('mar').show()" |
||||
|
update=":dialogForm" |
||||
|
icon="pi pi-fw pi-pencil" |
||||
|
styleClass="ui-button-secondary" ajax="true" |
||||
|
/> |
||||
|
<p:commandButton actionListener="#{demoBeanUbicacion.prepararEliminar(item)}" |
||||
|
ajax="true" |
||||
|
oncomplete="PF('deleteUbicacion').show()" |
||||
|
update=":dialogForm1" |
||||
|
icon="pi pi-trash" |
||||
|
style="margin-left: 5px" |
||||
|
styleClass="ui-button-danger"/> |
||||
|
</div> |
||||
|
</p:column> |
||||
|
</p:column> |
||||
|
</p:dataTable> |
||||
|
</h:form> |
||||
|
|
||||
|
<!-- agregar dialog modal --> |
||||
|
<p:dialog id="dialogForm" |
||||
|
header="#{demoBeanUbicacion.titulo}" |
||||
|
widgetVar="mar" |
||||
|
responsive="true" |
||||
|
showEffect="fade" |
||||
|
modal="true" |
||||
|
resizable="true" |
||||
|
width="auto" |
||||
|
height="120"> |
||||
|
<h:form> |
||||
|
|
||||
|
<p:growl id="messages" showDetail="true" for="mensajeUbicacion"/> |
||||
|
|
||||
|
<h:panelGrid columns="3" cellpadding="7"> |
||||
|
<p:outputLabel value="Bloque" for="bloque" /> |
||||
|
<p:inputText id="bloque" |
||||
|
value="#{demoBeanUbicacion.ubi.bloque}" |
||||
|
title="Bloque" |
||||
|
required="true" |
||||
|
requiredMessage="El campo no debe estar vacio" |
||||
|
validatorMessage="Asignación no valida" > |
||||
|
|
||||
|
|
||||
|
<f:validateRegex pattern="^[A-Z]$" |
||||
|
for="bloque"/> |
||||
|
|
||||
|
|
||||
|
</p:inputText> |
||||
|
|
||||
|
<p:message id="block" for="bloque"/> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Anaquel:" for="anaquel" /> |
||||
|
<p:inputText id="anaquel" |
||||
|
value="#{demoBeanUbicacion.ubi.anaquel}" |
||||
|
title="Anaquel" |
||||
|
required="true" |
||||
|
requiredMessage="Asignación no valida" |
||||
|
> |
||||
|
|
||||
|
</p:inputText> |
||||
|
|
||||
|
<p:message id="y" for="bloque"/> |
||||
|
|
||||
|
|
||||
|
</h:panelGrid> |
||||
|
|
||||
|
<!-- botones en ajax true (excepto el cancelar) y updates referenciando a ids del dialog |
||||
|
(sobretodo a los id de los inputTxt) y tabla para actualizarla. continua en el bean --> |
||||
|
<p:commandButton action="#{demoBeanUbicacion.agregar()}" |
||||
|
update="messages, ubicacionTabla:table, bloque,block" |
||||
|
rendered="#{demoBeanUbicacion.nuevo}" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;" |
||||
|
icon="pi pi-save" |
||||
|
ajax="true" |
||||
|
/> |
||||
|
|
||||
|
<p:commandButton action="#{demoBeanUbicacion.editarU()}" |
||||
|
update="messages, ubicacionTabla:table, bloque,block" |
||||
|
rendered="#{!demoBeanUbicacion.nuevo}" |
||||
|
icon="pi pi-save" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;" |
||||
|
ajax="true"/> |
||||
|
|
||||
|
<p:commandButton action="ubicacionLista.xhtml" immediate="true" |
||||
|
style="margin-left: 5px; width: 50px; " |
||||
|
icon="pi pi-times" styleClass="ui-button-danger" |
||||
|
ajax="false"/> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</h:form> |
||||
|
|
||||
|
|
||||
|
</p:dialog> |
||||
|
|
||||
|
<p:dialog id="dialogForm1" |
||||
|
header="#{demoBeanUbicacion.titulo}" |
||||
|
widgetVar="deleteUbicacion" |
||||
|
responsive="true" |
||||
|
showEffect="fade" |
||||
|
modal="true" |
||||
|
resizable="true" |
||||
|
width="auto" |
||||
|
height="200"> |
||||
|
|
||||
|
<h:form> |
||||
|
<p:growl id="messages" showDetail="true" for="mensajeUbicacion"/> |
||||
|
|
||||
|
<p:panelGrid columns="2"> |
||||
|
|
||||
|
<h:outputText value="Bloque:"/> |
||||
|
<h:outputText value="#{demoBeanUbicacion.ubi.bloque}" title="Bloque"/> |
||||
|
<h:outputText value="Anaquel:"/> |
||||
|
<h:outputText value="#{demoBeanUbicacion.ubi.anaquel}" title="Anaquel"/> |
||||
|
<h:outputText value="Estado:"/> |
||||
|
<h:outputText value="#{demoBeanUbicacion.ubi.estado}" title="Estado"/> |
||||
|
</p:panelGrid> |
||||
|
<p:commandButton action="#{demoBeanUbicacion.eliminarUbicacion()}" |
||||
|
update="ubicacionTabla:table,messages" |
||||
|
icon="pi pi-trash" |
||||
|
style=" width: 50px; " |
||||
|
styleClass="ui-button-warning" ajax="true"/> |
||||
|
|
||||
|
<p:commandButton action="ubicacionLista.xhtml" icon="pi pi-times" |
||||
|
styleClass="ui-button-danger" |
||||
|
style="margin-left: 5px; width: 50px;" |
||||
|
immediate="true" ajax="false"/> |
||||
|
</h:form> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</p:dialog> |
||||
|
|
||||
|
|
||||
|
</f:view> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
</ui:composition> |
||||
|
<script> |
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,68 @@ |
|||||
|
<?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"> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
<ui:define name="left"> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
<ui:define name="right"> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
<ui:define name="content"> |
||||
|
<f:view> |
||||
|
|
||||
|
|
||||
|
<h:form> |
||||
|
<p:messages id="messages" showDetail="true" closable="true"> |
||||
|
<p:autoUpdate/> |
||||
|
</p:messages> |
||||
|
|
||||
|
<h1><h:outputText value="#{demoBeanUsuarios.titulo}"/></h1> |
||||
|
<h:panelGrid columns="3" cellpadding="7"> |
||||
|
|
||||
|
<p:outputLabel value="Nombre:" for="nombre" /> |
||||
|
<p:inputText id="nombre" value="#{demoBeanUsuarios.usuario.nombre}" title="Nombre" required="true" /> |
||||
|
<p:message for="nombre" display="tooltip"/> |
||||
|
|
||||
|
<p:outputLabel value="Apellido P:" for="apellidoPaterno" /> |
||||
|
<p:inputText id="apellidoPaterno" value="#{demoBeanUsuarios.usuario.apellidoPaterno}" title="ApellidoPaterno" required="true"/> |
||||
|
<p:message for="apellidoPaterno" display="tooltip"/> |
||||
|
|
||||
|
<p:outputLabel value="Email:" for="email" /> |
||||
|
<p:inputText id="email" value="#{demoBeanUsuarios.usuario.email}" title="Email" required="true"/> |
||||
|
<p:message for="email" display="tooltip"/> |
||||
|
|
||||
|
<p:outputLabel value="Telefono:" for="telefono" /> |
||||
|
<p:inputText id="telefono" value="#{demoBeanUsuarios.usuario.telefono}" title="Telefono" required="true"/> |
||||
|
<p:message for="telefono" display="tooltip"/> |
||||
|
|
||||
|
</h:panelGrid> |
||||
|
<p:commandButton action="#{demoBeanUsuarios.agregar()}" rendered="#{demoBeanUsuarios.nuevo}" styleClass="ui-button-success" style="width: 50px;" icon="pi pi-save" ajax="false"/> |
||||
|
<p:commandButton action="#{demoBeanUsuarios.editarUsuario()}" icon="pi pi-save" |
||||
|
styleClass="ui-button-success" |
||||
|
style="width: 50px;" rendered="#{!demoBeanUsuarios.nuevo}" ajax="false"/> |
||||
|
|
||||
|
<p:commandButton action="usuariosLista.xhtml" style="margin-left: 5px; width: 50px; " immediate="true" icon="pi pi-times" ajax="false" styleClass="ui-button-danger"/> |
||||
|
</h:form> |
||||
|
</f:view> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
</ui:composition> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,63 @@ |
|||||
|
<?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"> |
||||
|
|
||||
|
</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="#{demoBeanUsuarios.usuario.id}" title="Id"/> |
||||
|
<h:outputText value="Nombre:"/> |
||||
|
<h:outputText value="#{demoBeanUsuarios.usuario.nombre}" title="Nombre"/> |
||||
|
<h:outputText value="ApellidoPaterno:"/> |
||||
|
<h:outputText value="#{demoBeanUsuarios.usuario.apellidoPaterno}" title="ApellidoPaterno"/> |
||||
|
<h:outputText value="Email:"/> |
||||
|
<h:outputText value="#{demoBeanUsuarios.usuario.email}" title="Email"/> |
||||
|
<h:outputText value="Telefono:"/> |
||||
|
<h:outputText value="#{demoBeanUsuarios.usuario.telefono}" title="Telefono"/> |
||||
|
<h:outputText value="Estado:"/> |
||||
|
<h:outputText value="#{demoBeanUsuarios.usuario.estado == 2 ? 'Activo':'Inactivo'}" title="Estado"/> |
||||
|
</p:panelGrid> |
||||
|
<p:commandButton action="usuariosLista.xhtml" actionListener="#{demoBeanUsuarios.eliminarUsuario()}" ajax="false" |
||||
|
icon="pi pi-trash" |
||||
|
styleClass="ui-button-warning" |
||||
|
style=" width: 50px; " |
||||
|
/> |
||||
|
<p:commandButton action="usuariosLista.xhtml" immediate="true" ajax="false" |
||||
|
icon="pi pi-times" |
||||
|
styleClass="ui-button-danger" |
||||
|
style="margin-left: 5px; width: 50px;" |
||||
|
/> |
||||
|
</h:form> |
||||
|
</f:view> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
</ui:composition> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,374 @@ |
|||||
|
<?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/listas.xhtml"> |
||||
|
|
||||
|
<ui:define name="top"> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
<ui:define name="content"> |
||||
|
<f:view> |
||||
|
|
||||
|
<div> |
||||
|
<h:form> |
||||
|
<p:menubar > |
||||
|
|
||||
|
<p:menuitem value="Productos" action="productoLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Marcas" action="marcaLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Proveedores" action="proveedorLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Ubicaciones" action="ubicacionLista.xhtml" ajax="false"/> |
||||
|
<p:menuitem value="Usuarios" action="usuariosLista.xhtml" disabled="true" ajax="false"/> |
||||
|
<p:submenu label="Opciones" icon="pi pi-fw pi-list"> |
||||
|
<p:menuitem value="Roles" |
||||
|
icon="pi pi-fw pi-users" |
||||
|
oncomplete="PF('rol').show()" |
||||
|
update=":rolD" |
||||
|
actionListener="#{demoBeanRoles.prepararNuevo()}"/> |
||||
|
|
||||
|
<p:menuitem value="Paises" |
||||
|
icon="pi pi-globe" |
||||
|
oncomplete="PF('pais').show()" |
||||
|
update="paisDialog" |
||||
|
actionListener="#{demoBeanPaises.prepararNuevo()}"/> |
||||
|
|
||||
|
<p:menuitem value="Estados" |
||||
|
icon="pi pi-map" |
||||
|
oncomplete="PF('estado').show()" |
||||
|
update="estadosDialog" |
||||
|
actionListener="#{demoBeanEstados.prepararNuevo()}"/> |
||||
|
|
||||
|
<p:menuitem value="Tipos" icon="pi pi-tags"/> |
||||
|
<!-- <p:divider />--> |
||||
|
</p:submenu> |
||||
|
</p:menubar> |
||||
|
</h:form> |
||||
|
<!-- dialogos externos --> |
||||
|
<p:dialog id="rolD" widgetVar="rol" responsive="true" showEffect="fade" modal="true" resizable="false"> |
||||
|
<ui:include src="roles.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
<p:dialog id="paisDialog" widgetVar="pais" responsive="true" showEffect="fade" modal="true" resizable="false"> |
||||
|
<ui:include src="paises.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
<p:dialog id="estadosDialog" widgetVar="estado" responsive="true" showEffect="fade" modal="true" resizable="false"> |
||||
|
<ui:include src="estados.xhtml"/> |
||||
|
</p:dialog> |
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<h:form id="userTable"> |
||||
|
<p:growl id="messages" showDetail="true"/> |
||||
|
|
||||
|
<p:dataTable id="table" value="#{demoBeanUsuarios.usuarios}" var="item" |
||||
|
filteredValue="#{demoBeanUsuarios.usuariosFilter}" |
||||
|
globalFilterFunction="#{demoBeanUsuarios.globalFilterFunction}" |
||||
|
widgetVar="filter" |
||||
|
paginator="true" rows="10" rowSelectMode="add" paginatorPosition="bottom" |
||||
|
resizableColumns="true" |
||||
|
showGridlines="true" |
||||
|
> |
||||
|
|
||||
|
<f:facet name="header" > |
||||
|
<div style="display: flex; align-items: center;"> |
||||
|
|
||||
|
<div style="flex: 1;"> |
||||
|
<p:commandButton actionListener="#{demoBeanUsuarios.prepararNuevo()}" oncomplete="PF('user').show()" update=":dialogForm" value="Nuevo" icon="pi pi-plus" style="margin-top: 5px;" ajax="true"/> |
||||
|
</div> |
||||
|
|
||||
|
<div style="flex: 1; text-align: center;"> <!-- Div para el texto centrado --> |
||||
|
<header style="display: flex; justify-content: center; font-size: 30px;"><strong>Usuarios</strong></header> |
||||
|
</div> |
||||
|
|
||||
|
<div style="flex: 1; text-align: right;"> |
||||
|
<div class="ui-input-icon-left mr-2" > |
||||
|
<i class="pi pi-fw pi-search" /> |
||||
|
<p:inputText id="globalFilter" onkeyup="PF('filter').filter()" |
||||
|
placeholder="Buscar usuario" |
||||
|
|
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</f:facet> |
||||
|
|
||||
|
<p:column responsivePriority="1" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Nombre"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.nombre}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column responsivePriority="2" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Apellido P"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.apellidoPaterno}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column responsivePriority="2" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Contraseña"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.contrasenia}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column responsivePriority="3" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Rol"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.rolesId.rol}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column responsivePriority="3" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Email"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.email}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column responsivePriority="4" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Telefono"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.telefono}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column responsivePriority="3" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Estado"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.estadosId.nombre}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column responsivePriority="4" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Domicilio"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.domicilio}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column responsivePriority="5" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Estatus"/> |
||||
|
</f:facet> |
||||
|
<h:outputText value="#{item.estado == 2 ? 'Activo':'Inactivo'}"/> |
||||
|
</p:column> |
||||
|
|
||||
|
<p:column responsivePriority="6" style="text-align: center;"> |
||||
|
<f:facet name="header"> |
||||
|
<h:outputText value="Opciones"/> |
||||
|
</f:facet> |
||||
|
<p:commandButton actionListener="#{demoBeanUsuarios.rellenarEditar(item)}" oncomplete="PF('user').show()" update=":dialogForm" icon="pi pi-fw pi-pencil" styleClass="ui-button-secondary" ajax="true"/> |
||||
|
<p:commandButton actionListener="#{demoBeanUsuarios.prepararEliminar(item)}" icon="pi pi-trash" style="margin-left: 5px" oncomplete="PF('userD').show()" update=":dialogDelete" styleClass="ui-button-danger" ajax="true"/> |
||||
|
</p:column> |
||||
|
</p:dataTable> |
||||
|
</h:form> |
||||
|
|
||||
|
|
||||
|
<p:dialog id="dialogForm" header="#{demoBeanUsuarios.titulo}" widgetVar="user" responsive="true" showEffect="fade" modal="true" resizable="false"> |
||||
|
<h:form> |
||||
|
|
||||
|
<p:growl id="growl" showDetail="true" for="mensajeUsuario"/> |
||||
|
<h:panelGrid columns="6" cellpadding="7"> |
||||
|
|
||||
|
<p:outputLabel value="Nombre:" for="nombre" /> |
||||
|
<p:inputText id="nombre" value="#{demoBeanUsuarios.usuario.nombre}" title="Nombre" required="true" validatorMessage="nombre no valido" |
||||
|
requiredMessage="Este campo no puede estar vacio" |
||||
|
style="width: 223px"> |
||||
|
<f:validateRegex pattern="\b[A-ZÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,}(?:\s+[A-ZÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,})*\b" |
||||
|
for="nombre" /> |
||||
|
</p:inputText> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Apellido Paterno:" for="apellidoPaterno" /> |
||||
|
<p:inputText id="apellidoPaterno" value="#{demoBeanUsuarios.usuario.apellidoPaterno}" title="ApellidoPaterno" required="true" validatorMessage="apellido no valido" |
||||
|
requiredMessage="Este campo no puede estar vacio" |
||||
|
style="width: 223px"> |
||||
|
<f:validateRegex pattern="^\b[A-ZÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,}\b$" |
||||
|
for="apellidoPaterno" /> |
||||
|
</p:inputText> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Rol" for="rolId" /> |
||||
|
<p:selectOneMenu id="rolId" |
||||
|
value="#{demoBeanUsuarios.usuario.rolesId}" |
||||
|
converter="selectOneMenuConverter" |
||||
|
required="true" |
||||
|
requiredMessage="Se necesita un rol" > |
||||
|
|
||||
|
<f:selectItems value="#{demoBeanRoles.roles}" |
||||
|
var="item" |
||||
|
itemLabel="#{item.rol}" |
||||
|
itemValue="#{item}"/> |
||||
|
</p:selectOneMenu> |
||||
|
|
||||
|
|
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alert" for="nombre"/> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertA" for="apellidoPaterno"/> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertRol" for="rolId" /> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Contraseña:" for="contraseña"/> |
||||
|
<p:password id="contraseña" value="#{demoBeanUsuarios.usuario.contrasenia}" title="contraseña" toggleMask="true" redisplay="true" required="true" validatorMessage="contraseña no valida" requiredMessage="Este campo no puede estar vacio" |
||||
|
feedback="true" |
||||
|
placeholder="mayusculas y numeros" |
||||
|
promptLabel="Ingresa tu contraseña" weakLabel="Débil" |
||||
|
goodLabel="Buena" strongLabel="Fuerte" |
||||
|
style="width: 223px"> |
||||
|
<f:validateRegex pattern="^(?=.*[A-Z])(?=.*\d).+$" |
||||
|
for="contraseña"/> |
||||
|
</p:password> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Email:" for="email" /> |
||||
|
<p:inputText id="email" value="#{demoBeanUsuarios.usuario.email}" title="Email" required="true" validatorMessage="correo no valido" |
||||
|
requiredMessage="Este campo no puede estar vacio" |
||||
|
style="width: 223px"> |
||||
|
<f:validateRegex pattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$" |
||||
|
for="email" /> |
||||
|
</p:inputText> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Telefono:" for="telefono" /> |
||||
|
<p:inputText id="telefono" value="#{demoBeanUsuarios.usuario.telefono}" title="Telefono" required="true" validatorMessage="numero de telefono no valido" |
||||
|
requiredMessage="Este campo no puede estar vacio" |
||||
|
style="width: 223px"> |
||||
|
<f:validateRegex pattern="^\d{10}$" |
||||
|
for="telefono" /> |
||||
|
</p:inputText> |
||||
|
|
||||
|
|
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertC" for="contraseña"/> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertE" for="email"/> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertT" for="telefono"/> |
||||
|
|
||||
|
|
||||
|
<p:outputLabel value="Domicilio:" for="domicilio" /> |
||||
|
<p:inputText id="domicilio" value="#{demoBeanUsuarios.usuario.domicilio}" title="Domicilio" required="true" validatorMessage="domicilio no valido" |
||||
|
requiredMessage="Este campo no puede estar vacio" |
||||
|
style="width: 223px"> |
||||
|
<f:validateRegex pattern="^[A-Z].*#\d+.*" |
||||
|
for="domicilio" /><!-- validar Domicilio --> |
||||
|
</p:inputText> |
||||
|
|
||||
|
<p:outputLabel value="Estado" for="state" /> |
||||
|
<p:selectOneMenu id="state" |
||||
|
value="#{demoBeanUsuarios.usuario.estadosId}" |
||||
|
converter="selectOneMenuConverter" |
||||
|
required="true" |
||||
|
requiredMessage="Se necesita un estado" > |
||||
|
|
||||
|
<f:selectItems value="#{demoBeanEstados.estados}" |
||||
|
var="item" |
||||
|
itemLabel="#{item.nombre}" |
||||
|
itemValue="#{item}"/> |
||||
|
</p:selectOneMenu> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertS" for="state" /> |
||||
|
<p:outputLabel></p:outputLabel> |
||||
|
<p:message id="alertD" for="domicilio"/> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</h:panelGrid> |
||||
|
|
||||
|
<footer style="display: flex; margin-top: 20px; justify-content: flex-end;"> |
||||
|
<p:commandButton action="#{demoBeanUsuarios.agregar()}" rendered="#{demoBeanUsuarios.nuevo}" |
||||
|
update="growl,userTable:table,nombre,apellidoPaterno,email,telefono,contraseña,domicilio,state,rolId,alert,alertA,alertE,alertT,alertC,alertD,alertRol,alertS" |
||||
|
styleClass="ui-button-success" style="width: 50px;" icon="pi pi-save" |
||||
|
ajax="true"/> |
||||
|
|
||||
|
<p:commandButton action="#{demoBeanUsuarios.editarUsuario()}" icon="pi pi-save" |
||||
|
styleClass="ui-button-success" |
||||
|
update="growl,userTable:table,nombre,apellidoPaterno,email,telefono,contraseña,domicilio,state,rolId,alert,alertA,alertE,alertT,alertC,alertD,alertRol,alertS" |
||||
|
style="width: 50px;" rendered="#{!demoBeanUsuarios.nuevo}" ajax="true"/> |
||||
|
|
||||
|
<p:commandButton action="usuariosLista.xhtml" style="margin-left: 5px; width: 50px; " immediate="true" icon="pi pi-times" ajax="false" styleClass="ui-button-danger"/> |
||||
|
</footer> |
||||
|
</h:form> |
||||
|
|
||||
|
|
||||
|
</p:dialog> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<p:dialog id="dialogDelete" header="#{demoBeanUsuarios.titulo}" widgetVar="userD" responsive="true" showEffect="fade" modal="true" resizable="false"> |
||||
|
|
||||
|
<h:form> |
||||
|
|
||||
|
<h:panelGrid columns="2" cellpadding="7"> |
||||
|
|
||||
|
<h:outputText value="Nombre:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanUsuarios.usuario.nombre}" title="Nombre"/> |
||||
|
<h:outputText value="ApellidoPaterno:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanUsuarios.usuario.apellidoPaterno}" title="ApellidoPaterno"/> |
||||
|
<h:outputText value="Contraseña:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanUsuarios.usuario.contrasenia}" title="Contraseña"/> |
||||
|
<h:outputText value="Rol:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanUsuarios.usuario.rolesId.rol}" title="Rol"/> |
||||
|
<h:outputText value="Email:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanUsuarios.usuario.email}" title="Email"/> |
||||
|
<h:outputText value="Telefono:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanUsuarios.usuario.telefono}" title="Telefono"/> |
||||
|
<h:outputText value="Estado:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanUsuarios.usuario.estadosId.nombre}" title="Estado"/> |
||||
|
<h:outputText value="Domicilio:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanUsuarios.usuario.domicilio}" title="Domicilio"/> |
||||
|
<h:outputText value="Estatus:" style="font-weight: bold;"/> |
||||
|
<h:outputText value="#{demoBeanUsuarios.usuario.estado == 2 ? 'Activo':'Inactivo'}" title="Estatus"/> |
||||
|
</h:panelGrid> |
||||
|
|
||||
|
<footer style="display: flex; margin-top: 20px; justify-content: flex-end;"> |
||||
|
<p:commandButton actionListener="#{demoBeanUsuarios.eliminarUsuario()}" ajax="true" |
||||
|
icon="pi pi-trash" |
||||
|
update="userTable:table" |
||||
|
styleClass="ui-button-warning" |
||||
|
style=" width: 50px; " |
||||
|
/> |
||||
|
<p:commandButton action="usuariosLista.xhtml" immediate="true" ajax="false" |
||||
|
icon="pi pi-times" |
||||
|
styleClass="ui-button-danger" |
||||
|
style="margin-left: 5px; width: 50px;" |
||||
|
/> |
||||
|
</footer> |
||||
|
</h:form> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</p:dialog> |
||||
|
|
||||
|
|
||||
|
</f:view> |
||||
|
|
||||
|
</ui:define> |
||||
|
|
||||
|
</ui:composition> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -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="ProyectoInventario" default="default" basedir="." xmlns:ear="http://www.netbeans.org/ns/j2ee-earproject/2"> |
||||
|
<description>Builds, tests, and runs the project ProyectoInventario.</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> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,28 @@ |
|||||
|
libs.CopyLibs.classpath=\ |
||||
|
${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar |
||||
|
libs.CopyLibs.displayName=CopyLibs Task |
||||
|
libs.CopyLibs.prop-version=3.0 |
||||
|
libs.EclipseLink-GlassFish-v3.classpath=\ |
||||
|
${base}/../../../../../../../../GlassFish_Server4.0/glassfish/modules/org.eclipse.persistence.antlr.jar;\ |
||||
|
${base}/../../../../../../../../GlassFish_Server4.0/glassfish/modules/org.eclipse.persistence.asm.jar;\ |
||||
|
${base}/../../../../../../../../GlassFish_Server4.0/glassfish/modules/org.eclipse.persistence.core.jar;\ |
||||
|
${base}/../../../../../../../../GlassFish_Server4.0/glassfish/modules/org.eclipse.persistence.dbws.jar;\ |
||||
|
${base}/../../../../../../../../GlassFish_Server4.0/glassfish/modules/org.eclipse.persistence.jpa.jar;\ |
||||
|
${base}/../../../../../../../../GlassFish_Server4.0/glassfish/modules/org.eclipse.persistence.jpa.jpql.jar;\ |
||||
|
${base}/../../../../../../../../GlassFish_Server4.0/glassfish/modules/org.eclipse.persistence.jpa.modelgen.processor.jar;\ |
||||
|
${base}/../../../../../../../../GlassFish_Server4.0/glassfish/modules/org.eclipse.persistence.moxy.jar;\ |
||||
|
${base}/../../../../../../../../GlassFish_Server4.0/glassfish/modules/org.eclipse.persistence.oracle.jar;\ |
||||
|
${base}/../../../../../../../../GlassFish_Server4.0/glassfish/modules/javax.persistence.jar |
||||
|
libs.EclipseLink-GlassFish-v3.displayName=EclipseLink from GlassFish |
||||
|
libs.EclipseLink-GlassFish-v3.javadoc=\ |
||||
|
${base}/EclipseLink-GlassFish-v3/javaee-doc-api.jar |
||||
|
libs.javaee-endorsed-api-7.0.classpath=\ |
||||
|
${base}/javaee-endorsed-api-7.0/javax.annotation-api.jar;\ |
||||
|
${base}/javaee-endorsed-api-7.0/javax.xml.soap-api.jar;\ |
||||
|
${base}/javaee-endorsed-api-7.0/jaxb-api-osgi.jar;\ |
||||
|
${base}/javaee-endorsed-api-7.0/jaxws-api.jar;\ |
||||
|
${base}/javaee-endorsed-api-7.0/jsr181-api.jar |
||||
|
libs.javaee-endorsed-api-7.0.displayName=Java EE 7 Endorsed API Library |
||||
|
libs.javaee-endorsed-api-7.0.javadoc=\ |
||||
|
${base}/javaee-endorsed-api-7.0/javaee-doc-api.jar |
||||
|
libs.javaee-endorsed-api-7.0.prop-maven-dependencies=\n javax.annotation:javax.annotation-api:1.2\n javax.xml.bind:jaxb-api-osgi:2.2.7\n javax.xml.soap:javax.xml.soap-api:1.3.5\n javax.xml.ws:jaxws-api:2.2.8\n javax.jws:jsr181-api:1.0-MR1\n |
@ -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,660 @@ |
|||||
|
<?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="ProyectoInventario-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 name="-pre-init-libraries"> |
||||
|
<property location=".\lib\nblibraries.properties" name="libraries.path"/> |
||||
|
<dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/> |
||||
|
<pathconvert dirsep="/" property="libraries.dir"> |
||||
|
<path path="${libraries.dir.nativedirsep}"/> |
||||
|
</pathconvert> |
||||
|
<basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/> |
||||
|
<available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/> |
||||
|
</target> |
||||
|
<target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries"> |
||||
|
<loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties"> |
||||
|
<filterchain> |
||||
|
<replacestring from="$${base}" to="${libraries.dir}"/> |
||||
|
<escapeunicode/> |
||||
|
</filterchain> |
||||
|
</loadproperties> |
||||
|
</target> |
||||
|
<target depends="pre-init,init-private,-init-private-libraries" name="-init-libraries"> |
||||
|
<loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}"> |
||||
|
<filterchain> |
||||
|
<replacestring from="$${base}" to="${libraries.dir}"/> |
||||
|
<escapeunicode/> |
||||
|
</filterchain> |
||||
|
</loadproperties> |
||||
|
</target> |
||||
|
<target depends="pre-init,init-private,-init-libraries" name="init-userdir"> |
||||
|
<property location="${netbeans.user}/build.properties" name="user.properties.file"/> |
||||
|
</target> |
||||
|
<target depends="pre-init,init-private,-init-libraries,init-userdir" name="init-user"> |
||||
|
<property file="${user.properties.file}"/> |
||||
|
</target> |
||||
|
<target depends="pre-init,init-private,-init-libraries,init-userdir,init-user" name="init-project"> |
||||
|
<property file="nbproject/project.properties"/> |
||||
|
</target> |
||||
|
<target depends="pre-init,init-private,-init-libraries,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-libraries,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.ProyectoInventario-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.ProyectoInventario-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.ProyectoInventario-war.dist-ear}" todir="${build.dir}//"/> |
||||
|
<copyfiles files="${reference.ProyectoInventario-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.ProyectoInventario-ejb}/build.xml" inheritall="false" target="-run-deploy-am"/> |
||||
|
<ant antfile="${project.ProyectoInventario-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}/ProyectoInventarioClient.jar"/> |
||||
|
<sleep seconds="3"/> |
||||
|
<copy failonerror="false" file="${wa.copy.client.jar.from}/ProyectoInventario/ProyectoInventarioClient.jar" todir="${dist.dir}"/> |
||||
|
<copy failonerror="false" flatten="true" todir="${dist.dir}/"> |
||||
|
<fileset dir="${wa.copy.client.jar.from}/ProyectoInventario" includes="**/ProyectoInventarioClient.jar"/> |
||||
|
</copy> |
||||
|
<copy flatten="true" todir="${dist.dir}/ProyectoInventarioClient"> |
||||
|
<fileset dir="${wa.copy.client.jar.from}/ProyectoInventario" includes="**/*.*ar"/> |
||||
|
</copy> |
||||
|
<copy failonerror="false" flatten="false" todir="${dist.dir}/ProyectoInventarioClient"> |
||||
|
<fileset dir="${dist.dir}/gfdeploy/ProyectoInventario" 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.ProyectoInventario-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.ProyectoInventario-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=4389f768 |
||||
|
build.xml.script.CRC32=02fa562d |
||||
|
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=4389f768 |
||||
|
nbproject/build-impl.xml.script.CRC32=65862f86 |
||||
|
nbproject/build-impl.xml.stylesheet.CRC32=abdce74a@1.73 |
@ -0,0 +1,41 @@ |
|||||
|
build.classes.excludes=**/*.java,**/*.form,**/.nbattrs |
||||
|
build.dir=build |
||||
|
build.generated.dir=${build.dir}/generated |
||||
|
client.module.uri=ProyectoInventario-war |
||||
|
client.urlPart= |
||||
|
debug.classpath=${javac.classpath}::${jar.content.additional}:${run.classpath} |
||||
|
display.browser=true |
||||
|
dist.dir=dist |
||||
|
dist.jar=${dist.dir}/${jar.name} |
||||
|
endorsed.classpath=\ |
||||
|
${libs.javaee-endorsed-api-7.0.classpath} |
||||
|
j2ee.appclient.mainclass.args=${j2ee.appclient.tool.args} |
||||
|
j2ee.compile.on.save=true |
||||
|
j2ee.deploy.on.save=true |
||||
|
j2ee.platform=1.7 |
||||
|
j2ee.platform.classpath= |
||||
|
j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar |
||||
|
j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar |
||||
|
j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar |
||||
|
j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar |
||||
|
j2ee.platform.wsit.classpath= |
||||
|
j2ee.server.type=gfv4ee7 |
||||
|
jar.compress=false |
||||
|
jar.content.additional=\ |
||||
|
${reference.ProyectoInventario-war.dist-ear}:\ |
||||
|
${reference.ProyectoInventario-ejb.dist-ear} |
||||
|
jar.name=ProyectoInventario.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.ProyectoInventario-ejb=ProyectoInventario-ejb |
||||
|
project.ProyectoInventario-war=ProyectoInventario-war |
||||
|
reference.ProyectoInventario-ejb.dist-ear=${project.ProyectoInventario-ejb}/dist/ProyectoInventario-ejb.jar |
||||
|
reference.ProyectoInventario-war.dist-ear=${project.ProyectoInventario-war}/dist/ProyectoInventario-war.war |
||||
|
resource.dir=setup |
||||
|
run.classpath= |
||||
|
source.root=. |
@ -0,0 +1,42 @@ |
|||||
|
<?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>ProyectoInventario</name> |
||||
|
<minimum-ant-version>1.6.5</minimum-ant-version> |
||||
|
<web-module-libraries/> |
||||
|
<web-module-additional-libraries> |
||||
|
<library> |
||||
|
<file>${reference.ProyectoInventario-war.dist-ear}</file> |
||||
|
<path-in-war>/</path-in-war> |
||||
|
</library> |
||||
|
<library> |
||||
|
<file>${reference.ProyectoInventario-ejb.dist-ear}</file> |
||||
|
<path-in-war>/</path-in-war> |
||||
|
</library> |
||||
|
</web-module-additional-libraries> |
||||
|
</data> |
||||
|
<libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1"> |
||||
|
<definitions>.\lib\nblibraries.properties</definitions> |
||||
|
</libraries> |
||||
|
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1"> |
||||
|
<reference> |
||||
|
<foreign-project>ProyectoInventario-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>ProyectoInventario-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> |
@ -0,0 +1,2 @@ |
|||||
|
Manifest-Version: 1.0 |
||||
|
|
Loading…
Reference in new issue