Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DemoRest
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
Percy Quispe Huarcaya
DemoRest
Commits
9a6a7e75
Commit
9a6a7e75
authored
Apr 24, 2018
by
Percy Quispe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add
parent
c00e6358
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
12 deletions
+82
-12
RequestFilter.java
src/java/demojsoncrud/servlets/RequestFilter.java
+3
-3
VistasExtras.java
src/java/demojsoncrud/utilities/VistasExtras.java
+16
-0
mantenimientoPersona.js
web/js/pages/mantenimientoPersona.js
+9
-1
sidebar.js
web/js/pages/sidebar.js
+36
-8
detalleMantenimientoPersona.jsp
web/vistas/detalleMantenimientoPersona.jsp
+17
-0
mantenimientoPersona.jsp
web/vistas/mantenimientoPersona.jsp
+1
-0
No files found.
src/java/demojsoncrud/servlets/RequestFilter.java
View file @
9a6a7e75
...
...
@@ -78,14 +78,14 @@ public class RequestFilter implements Filter, ServletContextListener {
if
(
valid
.
getBoolean
(
"status"
))
{
JSONObject
menu
=
new
JSONObject
(
valid
.
getString
(
"menu"
));
//Obtiene el menu
JSONArray
views
=
new
JSONArray
(
menu
.
get
(
"vistas"
).
toString
());
//Obtiene las vistas disponibles del usuario
List
<
Object
>
salida
=
views
.
toList
();
List
<
Object
>
vistas
=
views
.
toList
();
String
ruta
=
request
.
getRequestURI
();
int
indice
=
GeneralUtils
.
obtenerIndex
(
ruta
);
String
rutaJsp
=
ruta
.
substring
(
indice
,
ruta
.
length
());
if
(
url
.
contains
(
".jsp"
)){
boolean
acceso
=
false
;
for
(
Object
vista
:
vi
ew
s
){
System
.
out
.
println
(
"Vista : "
+
vista
+
"rutaJSP : "
+
rutaJsp
);
for
(
Object
vista
:
vi
sta
s
){
System
.
out
.
println
(
"Vista : "
+
vista
+
"
rutaJSP : "
+
rutaJsp
);
if
(
vista
.
toString
().
equalsIgnoreCase
(
rutaJsp
)){
acceso
=
true
;
break
;
...
...
src/java/demojsoncrud/utilities/VistasExtras.java
0 → 100644
View file @
9a6a7e75
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package
demojsoncrud
.
utilities
;
import
java.util.List
;
public
final
class
VistasExtras
{
private
static
final
String
detalleMantenimientoPersona
=
"detalleMantenimientoPersona"
;
public
static
List
<
String
>
getVistasExtras
(){
return
null
;
}
}
web/js/pages/mantenimientoPersona.js
View file @
9a6a7e75
...
...
@@ -103,7 +103,8 @@ const persona = {
{
targets
:
3
,
orderable
:
false
,
width
:
'5%'
,
className
:
'centrado'
},
{
targets
:
4
,
orderable
:
false
,
width
:
'25%'
,
className
:
'centrado'
},
{
targets
:
5
,
orderable
:
false
,
width
:
'10%'
,
className
:
'centrado'
},
{
targets
:
6
,
orderable
:
false
,
width
:
'10%'
,
className
:
'centrado'
}
{
targets
:
6
,
orderable
:
false
,
width
:
'10%'
,
className
:
'centrado'
},
{
targets
:
7
,
orderable
:
false
,
width
:
'5%'
,
className
:
'centrado'
}
],
dom
:
'<"datatable-scroll"t><"datatable-footer"ip>'
,
fixedColumns
:
true
,
...
...
@@ -152,6 +153,13 @@ const persona = {
</li>
</ul>`
}
},
{
data
:
'null'
,
className
:
'text-center'
,
render
:
function
(
data
,
type
,
row
)
{
return
"<i class='icon-forward'></i>"
;
}
}
],
'fnInitComplete'
:
function
(
oSettings
,
json
)
{
...
...
web/js/pages/sidebar.js
View file @
9a6a7e75
...
...
@@ -2,6 +2,9 @@ let getMenu = () => {
return
JSON
.
parse
(
Cookies
.
get
(
'menu'
));
}
let
setMenu
=
()
=>
{
let
location
=
window
.
location
;
let
position
=
getUrl
(
location
.
pathname
);
let
path
=
location
.
pathname
.
substring
(
position
+
1
);
//obtiene el nombre de la vista jsp para activar la clase .active
let
menu
=
document
.
getElementById
(
"MENU"
);
let
contenido
=
getMenu
();
console
.
log
(
contenido
)
...
...
@@ -10,27 +13,35 @@ let setMenu = () => {
let
html
=
'<li class="navigation-header"><span><i class="icon-menu" title="Main pages"></i>'
+
titulo
[
'nombre'
]
+
'</span></li>'
;
for
(
let
i
in
modulo
){
let
categoria
=
modulo
[
i
][
'categoria'
];
html
+=
'<li>'
html
+=
'<li
>'
+
'<a href="'
+
modulo
[
i
][
'url'
]
+
'">'
+
'<i class="fa '
+
modulo
[
i
][
'ico'
]
+
' fa-lg"></i>'
+
'<span>'
+
modulo
[
i
][
'nombre'
]
+
'</span>'
+
'</a>'
;
for
(
let
j
in
categoria
){
let
subCategoria
=
modulo
[
i
][
'subCategoria'
];
console
.
log
(
window
.
location
);
html
+=
'<ul>'
+
'<li>'
;
html
+=
'<ul>'
;
if
(
path
===
categoria
[
j
][
'url'
]){
html
+=
'<li class="active">'
;
}
else
{
html
+=
'<li>'
;
}
if
(
subCategoria
===
undefined
){
html
+=
'<a href="../vistas/'
+
categoria
[
j
][
'url'
]
+
'">'
;
html
+=
'<a
class="addClass" id="'
+
categoria
[
j
][
'url'
]
+
'"
href="../vistas/'
+
categoria
[
j
][
'url'
]
+
'">'
;
}
else
{
html
+=
'<a href="'
+
window
.
location
+
categoria
[
j
][
'url'
]
+
'">'
;
html
+=
'<a
class="addClass" id="'
+
categoria
[
j
][
'url'
]
+
'"
href="'
+
window
.
location
+
categoria
[
j
][
'url'
]
+
'">'
;
}
html
+=
'<span>'
+
categoria
[
j
][
'nombre'
]
+
'</span>'
+
'</a>'
;
if
(
subCategoria
!==
undefined
){
for
(
let
k
in
subCategoria
){
html
+=
'<ul class="hidden-ul" style="display: block;">'
;
+
'<li><a href="'
+
subCategoria
[
k
][
'url'
]
+
'">'
+
subCategoria
[
k
][
'nombre'
]
+
'</a></li>'
if
(
path
===
subCategoria
[
k
][
'url'
]){
html
+=
'<li class="active">'
;
}
else
{
html
+=
'<li>'
;
}
html
+=
'<a href="'
+
subCategoria
[
k
][
'url'
]
+
'">'
+
subCategoria
[
k
][
'nombre'
]
+
'</a></li>'
+
'</ul>'
;
}
}
...
...
@@ -41,5 +52,22 @@ let setMenu = () => {
}
menu
.
innerHTML
=
html
;
}
let
getUrl
=
(
pathname
)
=>
{
let
position
=
0
;
for
(
let
i
=
pathname
.
length
-
1
;
i
>
0
;
i
--
)
{
if
(
pathname
[
i
]
===
'/'
){
position
=
i
;
break
;
}
}
return
position
;
}
//let setClass = () =>{
// let location = window.location;
// let position =getUrl(location.pathname);
// let path = location.pathname.substring(position+1);
// debugger
// $("#"+path).addClass("test");
//}
setMenu
();
//setClass();
web/vistas/detalleMantenimientoPersona.jsp
0 → 100644
View file @
9a6a7e75
<
%
--
Document
:
detalleMantenimientoPersona
Created
on
:
24
/
04
/
2018
,
10:50:46
AM
Author
:
sistem08user
--
%
>
<
%@
page
contentType=
"text/html"
pageEncoding=
"UTF-8"
%
>
<!DOCTYPE html>
<html>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title>
JSP Page
</title>
</head>
<body>
<h1>
Hello World!
</h1>
</body>
</html>
web/vistas/mantenimientoPersona.jsp
View file @
9a6a7e75
...
...
@@ -65,6 +65,7 @@
<th>
CORREO ELECTRONICO
</th>
<th>
ESTADO
</th>
<th>
ACCIONES
</th>
<th>
IR DETALLE
</th>
</tr>
</thead>
<tbody>
...
...
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