Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
securityRemake
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Juan Guevara Mayta
securityRemake
Commits
8750b183
Commit
8750b183
authored
Oct 15, 2022
by
Aaron Josue Yaya Maza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EDIT] SE QUITÓ LLAMADO A planillaws
parent
072daa0b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
22 deletions
+50
-22
RequestPath.class
.../WEB-INF/classes/moduloSeguridad/config/RequestPath.class
+0
-0
UsuarioServlet.class
...INF/classes/moduloSeguridad/servlets/UsuarioServlet.class
+0
-0
SqlServerDAOFactory.class
...es/moduloSeguridad/sqlserverdao/SqlServerDAOFactory.class
+0
-0
RequestPath.java
src/java/moduloSeguridad/config/RequestPath.java
+4
-0
UsuarioServlet.java
src/java/moduloSeguridad/servlets/UsuarioServlet.java
+45
-17
SqlServerDAOFactory.java
...ava/moduloSeguridad/sqlserverdao/SqlServerDAOFactory.java
+1
-5
No files found.
build/web/WEB-INF/classes/moduloSeguridad/config/RequestPath.class
View file @
8750b183
No preview for this file type
build/web/WEB-INF/classes/moduloSeguridad/servlets/UsuarioServlet.class
View file @
8750b183
No preview for this file type
build/web/WEB-INF/classes/moduloSeguridad/sqlserverdao/SqlServerDAOFactory.class
View file @
8750b183
No preview for this file type
src/java/moduloSeguridad/config/RequestPath.java
View file @
8750b183
...
...
@@ -21,6 +21,10 @@ public final class RequestPath {
public
static
final
String
LOGIN
=
BASE
+
"user/login"
;
public
static
final
String
ENVIAR_NUEVO_TOKEN
=
BASE
+
"proyecto/enviarNuevoToken"
;
public
static
final
String
VERIFICAR_LOGIN
=
BASE
+
"user/verificarLogin"
;
public
static
final
String
listarPersonalPorTipoDocNumDoc
=
BASE
+
"user/listarPersonalPorTipoDocNumDoc"
;
public
static
final
String
listarPersonalPorCodigo
=
BASE
+
"user/listarPersonalPorCodigo"
;
public
static
final
String
listarTipoDocumento
=
BASE
+
"user/listarTipoDocumento"
;
/*Rest Matricula*/
private
static
final
String
BASE_MATRICULA
=
dotenSrv
.
obtenerValorVariableEntorno
(
"BASE_MATRICULA"
);
public
static
final
String
PERIODO_SERVLET
=
BASE_MATRICULA
+
"periodo/periodoServlet"
;
...
...
src/java/moduloSeguridad/servlets/UsuarioServlet.java
View file @
8750b183
...
...
@@ -14,14 +14,13 @@ import javax.servlet.http.HttpServlet;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.xml.ws.WebServiceRef
;
import
moduloSeguridad.config.RequestPath
;
import
moduloSeguridad.services.UsuarioService
;
import
moduloSeguridad.utilities.HttpRequest
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.json.JSONArray
;
import
org.json.JSONObject
;
import
pe.siso.planillaws.service.Personal
;
import
pe.siso.planillaws.service.PersonalService_Service
;
import
pe.siso.planillaws.service.TipoDocumento
;
import
pe.siso.planillaws.service.TipoDocumentoService_Service
;
/**
*
...
...
@@ -29,11 +28,11 @@ import pe.siso.planillaws.service.TipoDocumentoService_Service;
*/
public
class
UsuarioServlet
extends
HttpServlet
{
@WebServiceRef
(
wsdlLocation
=
"WEB-INF/wsdl/app9.sacooliveros.edu.pe_8080/PlanillaWS/PersonalService.wsdl"
)
/*
@WebServiceRef(wsdlLocation = "WEB-INF/wsdl/app9.sacooliveros.edu.pe_8080/PlanillaWS/PersonalService.wsdl")
private PersonalService_Service service_1;
@WebServiceRef(wsdlLocation = "WEB-INF/wsdl/app9.sacooliveros.edu.pe_8080/PlanillaWS/TipoDocumentoService.wsdl")
private
TipoDocumentoService_Service
service
;
private TipoDocumentoService_Service service;
*/
@Override
protected
void
service
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
...
...
@@ -191,15 +190,28 @@ public class UsuarioServlet extends HttpServlet {
response
.
setContentType
(
"application/json"
);
PrintWriter
out
=
response
.
getWriter
();
JSONArray
array
=
new
JSONArray
();
List
<
TipoDocumento
>
lista
=
listarTipoDocumento
();
/*
List<TipoDocumento> lista = listarTipoDocumento();
for (int i = 0; i < lista.size(); i++) {
JSONObject rs = new JSONObject();
rs.put("codTipoDocumento", lista.get(i).getCodTipoDocumento());
rs.put("tipoDocumento", lista.get(i).getNomCor());
rs.put("longitud", lista.get(i).getLon());
array.put(rs);
}*/
JSONObject
respuesta
=
null
;
JSONObject
obj
=
new
JSONObject
();
HttpRequest
httpRequest
=
new
HttpRequest
();
String
r
=
httpRequest
.
getRespuesta
(
RequestPath
.
listarPersonalPorCodigo
,
HttpRequest
.
POST
,
obj
,
""
);
//Respuesta del server
respuesta
=
new
JSONObject
(
r
);
JSONArray
data
=
respuesta
.
getJSONArray
(
"data"
);
for
(
int
i
=
0
;
i
<
data
.
length
();
i
++)
{
JSONObject
rs
=
new
JSONObject
();
rs
.
put
(
"codTipoDocumento"
,
data
.
getJSONObject
(
i
).
getString
(
"cod_tipo_documento"
));
rs
.
put
(
"tipoDocumento"
,
data
.
getJSONObject
(
i
).
getString
(
"nom_cor"
));
rs
.
put
(
"longitud"
,
data
.
getJSONObject
(
i
).
getString
(
"lon"
));
array
.
put
(
rs
);
}
out
.
println
(
array
);
}
...
...
@@ -334,25 +346,41 @@ public class UsuarioServlet extends HttpServlet {
out
.
println
(
rs
);
}
private
java
.
util
.
List
<
pe
.
siso
.
planillaws
.
service
.
TipoDocumento
>
listarTipoDocumento
()
{
//
private java.util.List<pe.siso.planillaws.service.TipoDocumento> listarTipoDocumento() {
// Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
// If the calling of port operations may lead to race condition some synchronization is required.
pe
.
siso
.
planillaws
.
service
.
TipoDocumentoService
port
=
service
.
getTipoDocumentoServicePort
();
/*
pe.siso.planillaws.service.TipoDocumentoService port = service.getTipoDocumentoServicePort();
return port.listarTipoDocumento();
}
}
*/
private
Personal
listarPersonalPorTipoDocNumDoc
(
java
.
lang
.
String
tipoDocumento
,
java
.
lang
.
String
numeroDocumento
,
java
.
lang
.
String
estado
)
{
private
JSONObject
listarPersonalPorTipoDocNumDoc
(
java
.
lang
.
String
tipoDocumento
,
java
.
lang
.
String
numeroDocumento
,
java
.
lang
.
String
estado
)
throws
IOException
{
// Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
// If the calling of port operations may lead to race condition some synchronization is required.
pe
.
siso
.
planillaws
.
service
.
PersonalService
port
=
service_1
.
getPersonalServicePort
();
return
port
.
listarPersonalPorTipoDocNumDoc
(
tipoDocumento
,
numeroDocumento
,
estado
);
/*pe.siso.planillaws.service.PersonalService port = service_1.getPersonalServicePort();
return port.listarPersonalPorTipoDocNumDoc(tipoDocumento, numeroDocumento, estado);*/
JSONObject
respuesta
=
null
;
JSONObject
obj
=
new
JSONObject
()
.
put
(
"tipoDocumento"
,
tipoDocumento
)
.
put
(
"numeroDocumento"
,
numeroDocumento
)
.
put
(
"estado"
,
estado
);
HttpRequest
httpRequest
=
new
HttpRequest
();
String
r
=
httpRequest
.
getRespuesta
(
RequestPath
.
listarPersonalPorTipoDocNumDoc
,
HttpRequest
.
POST
,
obj
,
""
);
//Respuesta del server
respuesta
=
new
JSONObject
(
r
);
return
respuesta
;
}
private
Personal
listarPersonalPorCodigo
(
java
.
lang
.
String
tipoDocumento
)
{
private
JSONObject
listarPersonalPorCodigo
(
java
.
lang
.
String
tipoDocumento
)
throws
IOException
{
// Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
// If the calling of port operations may lead to race condition some synchronization is required.
pe
.
siso
.
planillaws
.
service
.
PersonalService
port
=
service_1
.
getPersonalServicePort
();
return
port
.
listarPersonalPorCodigo
(
tipoDocumento
);
/*pe.siso.planillaws.service.PersonalService port = service_1.getPersonalServicePort();
return port.listarPersonalPorCodigo(tipoDocumento);*/
JSONObject
respuesta
=
null
;
JSONObject
obj
=
new
JSONObject
()
.
put
(
"tipoDocumento"
,
tipoDocumento
);
HttpRequest
httpRequest
=
new
HttpRequest
();
String
r
=
httpRequest
.
getRespuesta
(
RequestPath
.
listarPersonalPorCodigo
,
HttpRequest
.
POST
,
obj
,
""
);
//Respuesta del server
respuesta
=
new
JSONObject
(
r
);
return
respuesta
;
}
private
void
listarUsuarioManual
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
...
...
src/java/moduloSeguridad/sqlserverdao/SqlServerDAOFactory.java
View file @
8750b183
...
...
@@ -28,11 +28,7 @@ public class SqlServerDAOFactory extends DAOFactory {
String
databaseName
=
""
;
String
userSgbd
=
""
;
String
passwordSgbd
=
""
;
if
(
base
.
equalsIgnoreCase
(
"security"
))
{
/*String user = "###########";
String pwd = "########";
String url = "jdbc:sqlserver://172.16.0.6:1433;databaseName=security";*/
// String url = "jdbc:sqlserver://172.16.2.40:1433;databaseName=Security";
if
(
base
.
equalsIgnoreCase
(
"security"
))
{
host
=
dotenSrv
.
obtenerValorVariableEntorno
(
"SQLSERVER_SECURITY_DB_HOST"
);
port
=
dotenSrv
.
obtenerValorVariableEntorno
(
"SQLSERVER_SECURITY_DB_PORT"
);
databaseName
=
dotenSrv
.
obtenerValorVariableEntorno
(
"SQLSERVER_SECURITY_DB_NAME"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment