Changes in / [af4112a:6e6193c] in prototipo_portal_2018
- Location:
- WebContent
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WebContent/index.html
raf4112a rd76b369 206 206 var f = $(this); 207 207 // inicio control de los botones radio en el formulario firmar (pdf,bdoc)-------------------------------------------- 208 alert("manejo de JsonPDF"); 208 209 //alert("manejo de JsonPDF"); 210 211 // FIRMA DE PDF 209 212 if(document.SignFormat.optradio[0].checked) // chequea si el botón radio PDF esta seleccionado y entra a la sección en caso contrario va al otro if (botón radio BDOC) 210 //alert(document.SignFormat.optradio[0].value); 211 if(document.SignFormat.optradio[1].checked) //chequea si el botón radio BDOC esta seleccionado y entra 212 //alert(document.SignFormat.optradio[1].value); 213 //fin de control de los botones radio en el formulario firmar (pdf,bdoc)---------------------------------------------- 214 215 216 //alert("se presiono firmar") 213 { 214 alert(document.SignFormat.optradio[0].value); 215 //alert("se presiono firmar pdf") 217 216 218 217 //var formData = new FormData(document.getElementById("verificar")); … … 222 221 formData.append("upload", $("#file-sign")[0].files[0]); 223 222 //formData.append(f.attr("name"), $(this)[0].files[0]); 223 224 //alert("antes de ajax"); 224 225 225 226 $.ajax({ … … 370 371 } 371 372 }); 372 }); 373 }); 374 </script> 375 376 377 <!-- Prueba de firma de BDOC --> 378 <!-- 379 <script> 380 $(function(){ 381 $("#firmar").on("submit", function(e){ 382 e.preventDefault(); 383 var f = $(this); 384 385 //alert("se presiono firmar") 373 } 374 375 // FIRMA DE BDOC 376 if(document.SignFormat.optradio[1].checked) //chequea si el botón radio BDOC esta seleccionado y entra 377 { 378 alert(document.SignFormat.optradio[1].value); 379 //alert("se presiono firmar") 386 380 387 381 //var formData = new FormData(document.getElementById("verificar")); … … 389 383 390 384 //formData.append("dato", "valor"); 385 // TODO: identificar una manera de pasar varios archivos a la vez 391 386 formData.append("upload", $("#file-sign")[0].files[0]); 392 //formData.append(f.attr("name"), $(this)[0].files[0]); 387 388 393 389 394 390 $.ajax({ 395 url: "https://192.168.12.125:8443/Murachi/0.1/archivos", 391 //url: "https://192.168.12.125:8443/Murachi/0.1/archivos/bdocs/cargas", 392 url: "https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/bdocs/cargas", 396 393 //url: "https://172.16.137.11:8443/Murachi/murachi/archivos", 397 394 //url: "https://172.16.137.11:8443/JAXRS-Murachi/murachi/archivos", … … 405 402 success: function(response) { 406 403 //alert(JSON.stringify(response)); 407 var html = manejoJsonPDF(JSON.stringify(response)); 408 //alert(html); 409 //alert("ver respuesta") 410 document.getElementById("respuesta").innerHTML = html; 411 404 405 //var aux = JSON.stringify(response); 406 //alert("aux: " + aux); 407 412 408 // identificador del archivo en el servidor 413 var fileId = response.fileId.toString(); 414 alert("fileId: "+ fileId); 415 409 var fileId = response.containerId.toString(); 410 //alert("fileId: "+ fileId); 416 411 417 412 // seleccionar certificado del firmante 418 alert("va a seleccionar certificado");413 //alert("va a seleccionar certificado"); 419 414 var cert; 420 415 window.hwcrypto.getCertificate({lang: "en"}).then(function(response) { … … 427 422 "fileId":fileId, 428 423 "certificate":cert.hex, 429 "city":" Merida",430 "state":" Merida",431 "postalCode":" 5101",424 "city":"Rubio", 425 "state":"Tachira", 426 "postalCode":"1234", 432 427 "country":"Venezuela", 433 "role":" Desarrollador",428 "role":"Militar", 434 429 "addSignature":false 435 430 }); … … 439 434 type: 'POST', 440 435 contentType: 'application/json', 441 url:"https://192.168.12.125:8443/Murachi/0.1/archivos/bdocs", 436 //url:"https://192.168.12.125:8443/Murachi/0.1/archivos/bdocs", 437 //url:"https://192.168.12.125:8443/Murachi/0.1/archivos/bdocs/firmas/pre", 438 url:"https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/bdocs/firmas/pre", 442 439 //url:"https://172.16.137.11:8443/Murachi/murachi/archivos/pdfs", 443 440 //url:"https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/pdfs", … … 458 455 //log_text("Generated signature:\n" + signature.hex); 459 456 460 alert("valor de la firma: " + signature.hex); 461 457 //alert("valor de la firma: " + signature.hex); 462 458 463 459 $.ajax({ 464 460 type: 'POST', 465 461 contentType: 'application/json', 466 url:"https://192.168.12.125:8443/Murachi/0.1/archivos/bdocs/resenas", 462 //url:"https://192.168.12.125:8443/Murachi/0.1/archivos/bdocs/resenas", 463 //url:"https://192.168.12.125:8443/Murachi/0.1/archivos/bdocs/firmas/post", 464 url:"https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/bdocs/firmas/post", 467 465 //url:"https://172.16.137.11:8443/Murachi/murachi/archivos/pdfs/resenas", 468 466 //url:"https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/pdfs/resenas", 469 467 dataType: 'json', 470 data: JSON.stringify({"signature":signature.hex }),468 data: JSON.stringify({"signature":signature.hex, "containerId":fileId}), 471 469 success: function(data, textStatus, jqXHR){ 472 470 /* … … 478 476 479 477 alert("ver respuesta"); 480 var linkToDownload = "<a href=\"https://192.168.12.125:8443/Murachi/0.1/archivos/descargas/" + data['signedFileId'] +"\">descargar archivo firmado</a>";478 //var linkToDownload = "<a href=\"https://192.168.12.125:8443/Murachi/0.1/archivos/descargas/" + data['signedFileId'] +"\">descargar archivo firmado</a>"; 481 479 //var linkToDownload = "<a href=\"https://172.16.137.11:8443/Murachi/murachi/archivos/descargas/" + data['signedFileId'] +"\">descargar archivo firmado</a>"; 482 //var linkToDownload = "<a href=\"https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/descargas/" + data['signedFileId'] +"\">descargar archivo firmado</a>";480 var linkToDownload = "<a href=\"https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/descargas/" + data['signedFileId'] +"\">descargar archivo firmado</a>"; 483 481 //alert(linkToDownload); 484 482 document.getElementById("respuesta").innerHTML = linkToDownload; … … 527 525 } 528 526 529 530 527 }); 531 532 533 528 534 529 }, function(err) { 535 530 log_text("getCertificate() failed: " + err); … … 537 532 $("#respuesta").html("getCertificate() failed: " + err); 538 533 }); 539 540 541 542 }, 543 error: function(response) { 544 //Que se ejecuta cuando finalice la petición de con error 545 $("#respuesta").html('Error...!!!'); 546 alert("ocurrio un error") 547 } 534 535 }, 536 //error: function(response) { 537 error: function(xhr, status, error) { 538 //Que se ejecuta cuando finalice la petición de con error 539 $("#respuesta").html('Error...!!!'); 540 541 alert(xhr.responseText); 542 alert(error); 543 544 alert("ocurrio un error en cargas"); 545 546 547 548 } 548 549 }); 550 551 552 } 553 554 //fin de control de los botones radio en el formulario firmar (pdf,bdoc)---------------------------------------------- 555 556 557 549 558 }); 550 559 }); 551 560 </script> 552 --> 553 561 562 563 554 564 555 565 <!-- Función que se conecta se servicio web de verificación de la firma electrónica … … 570 580 571 581 $.ajax({ 572 //url: "https://192.168.12.125:8443/Murachi/murachi/archivos/firmados",582 url: "https://192.168.12.125:8443/Murachi/0.1/archivos/firmados", 573 583 //url: "https://172.16.137.11:8443/Murachi/murachi/archivos/firmados", 574 584 //url: "https://172.16.137.11:8443/JAXRS-Murachi/murachi/archivos", 575 url: "https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/firmados",585 //url: "https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/firmados", 576 586 type: "post", 577 587 dataType: "json", … … 711 721 <h1>Firmar Electrónicamente</h1> 712 722 <div class="container kv-main"> 723 <form enctype="multipart/form-data" action="https://192.168.12.125:8443/Murachi/0.1/archivos" method="post" id="firmar" name="SignFormat"> 713 724 <!-- <form enctype="multipart/form-data" action="https://192.168.12.125:8443/Murachi/murachi/archivos" method="post" id="firmar"> --> 714 725 <!-- <form enctype="multipart/form-data" action="https://172.16.137.11:8443/Murachi/murachi/archivos" method="post" id="firmar"> --> 726 <<<<<<< HEAD 727 <!-- <form enctype="multipart/form-data" action="https://murachi.cenditel.gob.ve/Murachi/0.1/archivos" method="post" id="firmar" name="SignFormat"> --> 728 ======= 715 729 <form enctype="multipart/form-data" action="https://murachi.cenditel.gob.ve/Murachi/0.1/archivos" method="post" id="firmar" name="SignFormat"> 730 >>>>>>> af4112a625a407cdeac98f2cb85b999cdcc3d17e 716 731 <h2>Formato para la Firma</h2> 717 732 <p>Seleccione el tipo de formato que va a utilizar para firmar electrónicamente</p> … … 741 756 <h1>Verificar la firma electrónica</h1> 742 757 <div class="container kv-main"> 743 < !-- <form enctype="multipart/form-data" action="https://192.168.12.125:8443/Murachi/murachi/archivos/firmados" method="post" id="verificar"> -->758 <form enctype="multipart/form-data" action="https://192.168.12.125:8443/Murachi/0.1/archivos/firmados" method="post" id="verificar"> 744 759 <!-- <form enctype="multipart/form-data" action="https://172.16.137.11:8443/Murachi/murachi/archivos/firmados" method="post" id="verificar"> --> 745 < form enctype="multipart/form-data" action="https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/firmados" method="post" id="verificar">760 <!-- <form enctype="multipart/form-data" action="https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/firmados" method="post" id="verificar"> --> 746 761 <input id="file-check-sign" class="file" type="file" multiple data-min-file-count="1" name="upload"> 747 762 <br>
Note: See TracChangeset
for help on using the changeset viewer.