[ADD] CAMBIOS 2

parent 5f846704
<component name="InspectionProjectProfileManager"> <component name="InspectionProjectProfileManager">
<profile version="1.0"> <profile version="1.0">
<option name="myName" value="Project Default" /> <option name="myName" value="Project Default" />
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<Languages>
<language minSize="87" name="Java" />
</Languages>
</inspection_tool>
<inspection_tool class="SpellCheckingInspection" enabled="true" level="INFORMATION" enabled_by_default="true" editorAttributes="INFORMATION_ATTRIBUTES"> <inspection_tool class="SpellCheckingInspection" enabled="true" level="INFORMATION" enabled_by_default="true" editorAttributes="INFORMATION_ATTRIBUTES">
<option name="processCode" value="true" /> <option name="processCode" value="true" />
<option name="processLiterals" value="true" /> <option name="processLiterals" value="true" />
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager"> <component name="MavenProjectsManager">
......
{
"java.configuration.updateBuildConfiguration": "interactive"
}
\ No newline at end of file
build.xml.data.CRC32=6abbea67 build.xml.data.CRC32=6abbea67
build.xml.script.CRC32=c7931e0f build.xml.script.CRC32=c7931e0f
build.xml.stylesheet.CRC32=651128d4@1.77.1.1 build.xml.stylesheet.CRC32=1707db4f@1.94.0.1
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # 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. # 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=6abbea67 nbproject/build-impl.xml.data.CRC32=6abbea67
nbproject/build-impl.xml.script.CRC32=367d1582 nbproject/build-impl.xml.script.CRC32=367d1582
nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1
nbproject/jaxws-build.xml.stylesheet.CRC32=6608c2cf nbproject/jaxws-build.xml.stylesheet.CRC32=fb430199
...@@ -13,4 +13,4 @@ j2ee.server.middleware=/home/sistem27user/glassfish-4.1.11 ...@@ -13,4 +13,4 @@ j2ee.server.middleware=/home/sistem27user/glassfish-4.1.11
javac.debug=true javac.debug=true
javadoc.preview=true javadoc.preview=true
selected.browser=Chrome selected.browser=Chrome
user.properties.file=/home/sistem27user/.netbeans/8.2/build.properties user.properties.file=/home/sistem27user/snap/netbeans/84/build.properties
...@@ -2,13 +2,6 @@ ...@@ -2,13 +2,6 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group> <group/>
<file>file:/D:/proyectosaco/securityRemake/src/java/moduloSeguridad/sqlserverdao/SqlServerDAOFactory.java</file>
<file>file:/D:/proyectosaco/securityRemake/src/java/moduloSeguridad/servlets/LoginServlet.java</file>
<file>file:/D:/proyectosaco/securityRemake/src/java/moduloSeguridad/filters/RequestsFilter.java</file>
<file>file:/D:/proyectosaco/securityRemake/src/java/moduloSeguridad/sqlserverdao/MenuSqlServerDAO.java</file>
<file>file:/D:/proyectosaco/securityRemake/src/java/moduloSeguridad/servlets/UsuarioServlet.java</file>
<file>file:/D:/proyectosaco/securityRemake/src/java/moduloSeguridad/config/RequestPath.java</file>
</group>
</open-files> </open-files>
</project-private> </project-private>
<?xml version="1.0" encoding="UTF-8"?>
<!--
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
-->
<!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">
<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>
...@@ -97,7 +97,7 @@ public class MenuMYSQLDAO implements MenuDAO { ...@@ -97,7 +97,7 @@ public class MenuMYSQLDAO implements MenuDAO {
sql = "{ CALL seguridad.SP_MENU( ?,?,?,?,?,?,?,?,?) }"; sql = "{ CALL seguridad.SP_MENU( ?,?,?,?,?,?,?,?,?) }";
con = MySQLDAOFactory.getConnectionSQL(base); con = MySQLDAOFactory.getConnectionSQL(base);
JSONArray params = new JSONArray(); JSONArray params = new JSONArray();
params.put("listarTipoDeUsuario"); params.put("listarTituloCompleto");
params.put(proyecto_detalle); params.put(proyecto_detalle);
params.put(proyecto); params.put(proyecto);
params.put(tipo); params.put(tipo);
...@@ -2769,146 +2769,52 @@ public class MenuMYSQLDAO implements MenuDAO { ...@@ -2769,146 +2769,52 @@ public class MenuMYSQLDAO implements MenuDAO {
@Override @Override
public JSONArray obtenerAcciones(int codigo, int jerarquia, int tipo_usuario) { public JSONArray obtenerAcciones(int codigo, int jerarquia, int tipo_usuario) {
Connection con = null;
JSONArray rs = new JSONArray(); JSONArray rs = new JSONArray();
try { try (Connection con = MySQLDAOFactory.getConnectionSQL("SECURITY")) {
PreparedStatement pst = null; String sql = "{ CALL seguridad.SP_MENU(?,?,?,?,?,?,?,?,?) }";
ResultSet rSet = null; JSONArray params = new JSONArray();
String sql = ""; params.put("obtenerAcciones");
con = MySQLDAOFactory.getConnectionSQL("SECURITY"); params.put(jerarquia);
params.put(codigo);
if (jerarquia == 2) { params.put(tipo_usuario);
sql = "select\n" + params.put(0);
" modulo.cod_modulo as codigo,\n" + params.put("");
" modulo.nom as nom_padre,\n" + params.put("");
" accion.cod_accion,\n" + params.put("");
" accion.nom_accion\n" + params.put("");
"from seguridad.modulo_acciones\n" + rs = DAOHelper.queryProcedure(con, sql, params);
" left join seguridad.modulo on modulo_acciones.cod_modulo = modulo.cod_modulo\n" +
" left join seguridad.accion on modulo_acciones.cod_accion = accion.cod_accion\n" +
"where modulo.cod_modulo = ? and modulo_acciones.cod_proyecto_detalle = ?;\n";
} else if (jerarquia == 3) {
sql = "select\n" +
" categoria.cod_categoria as codigo,\n" +
" categoria.nom as nom_padre,\n" +
" accion.cod_accion,\n" +
" accion.nom_accion\n" +
"from seguridad.categoria_acciones\n" +
" left join seguridad.categoria on categoria_acciones.cod_categoria = categoria.cod_categoria\n" +
" left join seguridad.accion on categoria_acciones.cod_accion = accion.cod_accion\n" +
"where categoria.cod_categoria = ? and categoria_acciones.cod_proyecto_detalle = ?;\n";
} else if (jerarquia == 4) {
sql = "select\n" +
" subcategoria.cod_subcategoria as codigo,\n" +
" subcategoria.nom as nom_padre,\n" +
" accion.cod_accion,\n" +
" accion.nom_accion\n" +
"from seguridad.subcategoria_acciones\n" +
" left join seguridad.subcategoria on subcategoria_acciones.cod_subcategoria = subcategoria.cod_subcategoria\n" +
" left join seguridad.accion on subcategoria_acciones.cod_accion = accion.cod_accion\n" +
"where subcategoria.cod_subcategoria = ? and subcategoria_acciones.cod_proyecto_detalle = ?;";
}
pst = con.prepareStatement(sql);
pst.setInt(1, codigo);
pst.setInt(2, tipo_usuario);
rSet = pst.executeQuery();
while (rSet.next()) {
JSONObject json = new JSONObject();
json.put("codigo",rSet.getInt("codigo"));
json.put("nom_padre",rSet.getString("nom_padre"));
json.put("cod_accion",rSet.getInt("cod_accion"));
json.put("nom_accion",rSet.getString("nom_accion"));
rs.put(json);
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally {
try {
if (con != null) {
con.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
} }
return rs; return rs;
} }
@Override @Override
public JSONObject listarPermisosPorVista(JSONObject datos) throws Exception { public JSONObject listarPermisosPorVista(JSONObject datos) throws Exception {
Connection con = null;
PreparedStatement pst = null;
ResultSet rSet = null;
JSONObject jsonReturn = new JSONObject(); JSONObject jsonReturn = new JSONObject();
JSONArray rs = new JSONArray(); JSONArray rs = new JSONArray();
try{ try (Connection con = MySQLDAOFactory.getConnectionSQL("SECURITY")) {
con = MySQLDAOFactory.getConnectionSQL("SECURITY"); String sql = "{ CALL seguridad.SP_MENU(?,?,?,?,?,?,?,?,?) }";
String sql = ""; JSONArray params = new JSONArray();
params.put("listarPermisosPorVista");
if(datos.getInt("jerarquia") == 2){ params.put(datos.getInt("jerarquia"));
sql = "select\n" + params.put(datos.getInt("codigo"));
" modulo_acciones.cod_mod_acc as codigo,\n" + params.put(datos.getInt("cod_proyecto_detalle"));
" modulo.cod_modulo,\n" + params.put(0);
" modulo.nom as nom_padre,\n" + params.put("");
" accion.cod_accion,\n" + params.put("");
" accion.nom_accion\n" + params.put("");
"from seguridad.modulo_acciones\n" + params.put("");
" inner join seguridad.modulo on modulo_acciones.cod_modulo = modulo.cod_modulo\n" +
" inner join seguridad.accion on modulo_acciones.cod_accion = accion.cod_accion\n" +
"where modulo.cod_modulo = ? and modulo_acciones.cod_proyecto_detalle = ? ;";
}else if (datos.getInt("jerarquia") == 3){
sql = "select\n" +
" categoria_acciones.cod_cat_acc as codigo,\n" +
" categoria.cod_categoria,\n" +
" categoria.nom as nom_padre,\n" +
" accion.cod_accion,\n" +
" accion.nom_accion\n" +
"from seguridad.categoria_acciones\n" +
" inner join seguridad.categoria on categoria_acciones.cod_categoria = categoria.cod_categoria\n" +
" inner join seguridad.accion on categoria_acciones.cod_accion = accion.cod_accion\n" +
"where categoria.cod_categoria = ? and categoria_acciones.cod_proyecto_detalle = ? ;";
}else if (datos.getInt("jerarquia") == 4){
sql = "select\n" +
" subcategoria_acciones.cod_sub_acc as codigo,\n" +
" subcategoria.cod_subcategoria,\n" +
" subcategoria.nom as nom_padre,\n" +
" accion.cod_accion,\n" +
" accion.nom_accion\n" +
"from seguridad.subcategoria_acciones\n" +
" inner join seguridad.subcategoria on subcategoria_acciones.cod_subcategoria = subcategoria.cod_subcategoria\n" +
" inner join seguridad.accion on subcategoria_acciones.cod_accion = accion.cod_accion\n" +
"where subcategoria.cod_subcategoria = ? and subcategoria_acciones.cod_proyecto_detalle = ? ;";
}
pst = con.prepareStatement(sql); rs = DAOHelper.queryProcedure(con, sql, params);
pst.setInt(1, datos.getInt("codigo")); jsonReturn.put("message", "Consulta exitosa");
pst.setInt(2, datos.getInt("cod_proyecto_detalle")); jsonReturn.put("status", true);
rSet = pst.executeQuery(); } catch (Exception e) {
while (rSet.next()){ jsonReturn.put("message", e.getMessage());
JSONObject json = new JSONObject(); jsonReturn.put("status", false);
json.put("codigo",rSet.getInt("codigo"));
// json.put("cod_modulo",rSet.getInt("cod_modulo"));
json.put("nom_padre",rSet.getString("nom_padre"));
json.put("cod_accion",rSet.getInt("cod_accion"));
json.put("nom_accion",rSet.getString("nom_accion"));
rs.put(json);
}
jsonReturn.put("message","Consulta exitosa");
jsonReturn.put("status",true);
}catch (Exception e) {
jsonReturn.put("message",e.getMessage());
jsonReturn.put("status",false);
e.printStackTrace();
}finally {
try {
if (con != null) {
con.close();
}
}catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
} }
} return jsonReturn.put("data", rs);
return jsonReturn.put("data",rs);
} }
@Override @Override
......
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd">
<!-- Define Persistence Unit -->
<persistence-unit name="my_persistence_unit">
</persistence-unit>
</persistence>
\ No newline at end of file
com/mycompany/moduloseguridad/sqlserverdao/SqlServerDAOFactory.class
com/mycompany/moduloseguridad/servlets/AuthServlet.class
com/mycompany/moduloseguridad/filters/RequestsFilter.class
com/mycompany/moduloseguridad/utilities/ResponseHelper.class
com/mycompany/moduloseguridad/servlets/RedireccionarServlet.class
com/mycompany/moduloseguridad/services/ProyectoService.class
com/mycompany/moduloseguridad/config/RequestPath.class
com/mycompany/moduloseguridad/sqlserverdao/MenuSqlServerDAO.class
com/mycompany/moduloseguridad/services/UsuarioService.class
com/mycompany/moduloseguridad/servlets/LoginServlet.class
com/mycompany/moduloseguridad/servlets/ProyectoServlet.class
com/mycompany/moduloseguridad/utilities/HttpRequest.class
com/mycompany/moduloseguridad/services/MenuService.class
com/mycompany/moduloseguridad/dao/ProyectoDAO.class
com/mycompany/moduloseguridad/servlets/LogOutServlet.class
com/mycompany/moduloseguridad/services/TipoUsuarioService.class
com/mycompany/moduloseguridad/dao/MenuDAO.class
com/mycompany/moduloseguridad/servlets/TipoUsuarioServlet.class
com/mycompany/moduloseguridad/utilities/GeneralMethods.class
com/mycompany/moduloseguridad/servlets/MantenimientoMenuServlet.class
com/mycompany/moduloseguridad/servlets/InterceptarRedireccionServlet.class
com/mycompany/moduloseguridad/utilities/dotenSrv.class
com/mycompany/moduloseguridad/dao/DAOFactory.class
com/mycompany/moduloseguridad/servlets/UsuarioServlet.class
com/mycompany/moduloseguridad/utilities/OsUtils.class
com/mycompany/moduloseguridad/utilities/GeneralVariables.class
com/mycompany/moduloseguridad/sqlserverdao/TipoUsuarioSqlServerDAO.class
com/mycompany/moduloseguridad/utilities/DAOHelper.class
com/mycompany/moduloseguridad/sqlserverdao/UsuarioSqlServerDAO.class
com/mycompany/moduloseguridad/sqlserverdao/ProyectoSqlServerDAO.class
com/mycompany/moduloseguridad/dao/TipoUsuarioDAO.class
com/mycompany/moduloseguridad/dao/UsuarioDAO.class
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/servlets/RedireccionarServlet.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/servlets/InterceptarRedireccionServlet.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/sqlserverdao/TipoUsuarioSqlServerDAO.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/dao/ProyectoDAO.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/sqlserverdao/UsuarioSqlServerDAO.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/dao/UsuarioDAO.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/utilities/ResponseHelper.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/sqlserverdao/SqlServerDAOFactory.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/dao/MenuDAO.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/sqlserverdao/MenuSqlServerDAO.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/services/MenuService.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/servlets/ProyectoServlet.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/servlets/LoginServlet.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/utilities/dotenSrv.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/utilities/GeneralMethods.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/services/UsuarioService.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/dao/TipoUsuarioDAO.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/filters/RequestsFilter.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/utilities/GeneralVariables.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/utilities/OsUtils.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/services/ProyectoService.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/servlets/AuthServlet.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/utilities/DAOHelper.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/config/RequestPath.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/utilities/HttpRequest.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/dao/DAOFactory.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/servlets/TipoUsuarioServlet.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/servlets/UsuarioServlet.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/servlets/MantenimientoMenuServlet.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/sqlserverdao/ProyectoSqlServerDAO.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/services/TipoUsuarioService.java
/home/sistem27user/Escritorio/securityRemake/src/main/java/com/mycompany/moduloseguridad/servlets/LogOutServlet.java
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment