Skip to content

Commit

Permalink
v1.032A
Browse files Browse the repository at this point in the history
  • Loading branch information
andiazher committed Mar 27, 2017
1 parent f6a0a7f commit bcff0b8
Show file tree
Hide file tree
Showing 17 changed files with 287 additions and 40 deletions.
Binary file added lib/commons-codec-1.9.jar
Binary file not shown.
Binary file added lib/commons-logging-1.2.jar
Binary file not shown.
Binary file added lib/fluent-hc-4.5.3.jar
Binary file not shown.
Binary file added lib/httpclient-cache-4.5.3.jar
Binary file not shown.
Binary file added lib/httpclient-win-4.5.3.jar
Binary file not shown.
Binary file added lib/httpmime-4.5.3.jar
Binary file not shown.
Binary file added lib/jna-4.1.0.jar
Binary file not shown.
Binary file added lib/jna-platform-4.1.0.jar
Binary file not shown.
24 changes: 20 additions & 4 deletions nbproject/build-impl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -997,20 +997,36 @@ exists or setup the property manually. For example like this:
</target>
<target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
<target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
<copyfiles files="${file.reference.commons-codec-1.9.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.commons-io-2.5.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.commons-logging-1.2.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.fluent-hc-4.5.3.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.httpclient-4.5.3.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.httpclient-cache-4.5.3.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.httpclient-win-4.5.3.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.httpcore-4.4.6.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.httpmime-4.5.3.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jna-4.1.0.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jna-platform-4.1.0.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.mysql-connector-java-5.1.23-bin.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.poi-3.15.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.httpcore-4.4.6.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.commons-io-2.5.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<mkdir dir="${build.web.dir}/META-INF"/>
<manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
</target>
<target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
<copyfiles files="${file.reference.commons-codec-1.9.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.commons-io-2.5.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.commons-logging-1.2.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.fluent-hc-4.5.3.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.httpclient-4.5.3.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.httpclient-cache-4.5.3.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.httpclient-win-4.5.3.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.httpcore-4.4.6.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.httpmime-4.5.3.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jna-4.1.0.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jna-platform-4.1.0.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.mysql-connector-java-5.1.23-bin.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.poi-3.15.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.httpcore-4.4.6.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.commons-io-2.5.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
</target>
<target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
<delete dir="${build.web.dir}/WEB-INF/lib"/>
Expand Down
6 changes: 3 additions & 3 deletions nbproject/genfiles.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ [email protected]
# 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=49fa2c45
nbproject/build-impl.xml.script.CRC32=5f51f1ae
build.xml.data.CRC32=d4b73c1b
build.xml.data.CRC32=fbe386c5
build.xml.script.CRC32=a5f9b636
build.xml.stylesheet.CRC32=[email protected]
# 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=d4b73c1b
nbproject/build-impl.xml.script.CRC32=33734823
nbproject/build-impl.xml.data.CRC32=fbe386c5
nbproject/build-impl.xml.script.CRC32=346dee08
nbproject/build-impl.xml.stylesheet.CRC32=[email protected]
nbproject/jaxws-build.xml.stylesheet.CRC32=6608c2cf
22 changes: 19 additions & 3 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,17 @@ dist.war=${dist.dir}/${war.name}
endorsed.classpath=\
${libs.javaee-endorsed-api-7.0.classpath}
excludes=
file.reference.commons-codec-1.9.jar=lib/commons-codec-1.9.jar
file.reference.commons-io-2.5.jar=lib/commons-io-2.5.jar
file.reference.commons-logging-1.2.jar=lib/commons-logging-1.2.jar
file.reference.fluent-hc-4.5.3.jar=lib/fluent-hc-4.5.3.jar
file.reference.httpclient-4.5.3.jar=lib/httpclient-4.5.3.jar
file.reference.httpclient-cache-4.5.3.jar=lib/httpclient-cache-4.5.3.jar
file.reference.httpclient-win-4.5.3.jar=lib/httpclient-win-4.5.3.jar
file.reference.httpcore-4.4.6.jar=lib/httpcore-4.4.6.jar
file.reference.httpmime-4.5.3.jar=lib/httpmime-4.5.3.jar
file.reference.jna-4.1.0.jar=lib/jna-4.1.0.jar
file.reference.jna-platform-4.1.0.jar=lib/jna-platform-4.1.0.jar
file.reference.mysql-connector-java-5.1.23-bin.jar=lib/mysql-connector-java-5.1.23-bin.jar
file.reference.poi-3.15.jar=lib/poi-3.15.jar
includes=**
Expand All @@ -48,11 +56,19 @@ j2ee.platform.wsit.classpath=
j2ee.server.type=gfv3ee6
jar.compress=false
javac.classpath=\
${file.reference.commons-codec-1.9.jar}:\
${file.reference.commons-io-2.5.jar}:\
${file.reference.commons-logging-1.2.jar}:\
${file.reference.fluent-hc-4.5.3.jar}:\
${file.reference.httpclient-4.5.3.jar}:\
${file.reference.mysql-connector-java-5.1.23-bin.jar}:\
${file.reference.poi-3.15.jar}:\
${file.reference.httpclient-cache-4.5.3.jar}:\
${file.reference.httpclient-win-4.5.3.jar}:\
${file.reference.httpcore-4.4.6.jar}:\
${file.reference.commons-io-2.5.jar}
${file.reference.httpmime-4.5.3.jar}:\
${file.reference.jna-4.1.0.jar}:\
${file.reference.jna-platform-4.1.0.jar}:\
${file.reference.mysql-connector-java-5.1.23-bin.jar}:\
${file.reference.poi-3.15.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.debug=true
Expand Down
38 changes: 35 additions & 3 deletions nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,56 @@
<name>concesionario</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<web-module-libraries>
<library dirs="200">
<file>${file.reference.commons-codec-1.9.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${file.reference.commons-io-2.5.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${file.reference.commons-logging-1.2.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${file.reference.fluent-hc-4.5.3.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${file.reference.httpclient-4.5.3.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${file.reference.mysql-connector-java-5.1.23-bin.jar}</file>
<file>${file.reference.httpclient-cache-4.5.3.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${file.reference.poi-3.15.jar}</file>
<file>${file.reference.httpclient-win-4.5.3.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${file.reference.httpcore-4.4.6.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${file.reference.commons-io-2.5.jar}</file>
<file>${file.reference.httpmime-4.5.3.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${file.reference.jna-4.1.0.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${file.reference.jna-platform-4.1.0.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${file.reference.mysql-connector-java-5.1.23-bin.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${file.reference.poi-3.15.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
</web-module-libraries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import com.sysware.concesionario.app.App;
import com.sysware.concesionario.entitie.Entitie;
import com.sysware.concesionario.services.WebServiceAsistenciaDen;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
Expand Down Expand Up @@ -56,7 +57,7 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
try{
ti= request.getParameter("ti");
identifica= request.getParameter("identification");
nombre= request.getParameter("nombres");
nombre= request.getParameter("nombre");
nombre2= request.getParameter("nombres2");
apellido= request.getParameter("apellidos");
apellido2= request.getParameter("apellidos2");
Expand Down Expand Up @@ -93,10 +94,12 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
cliente.getData().set(cliente.getColums().indexOf("PAIS"), "0");
cliente.create();
}
clientes= cliente.getEntitieParam("CEDULA", identifica);
String idCliente="";
for(Entitie e: clientes){
idCliente = e.getId();
try{
cliente= cliente.getEntitieParam("CEDULA", identifica).get(0);
idCliente = cliente.getId();
}catch(IndexOutOfBoundsException s){
System.out.println("Error: "+s);
}

Entitie asd = creteEntidadASD();
Expand Down Expand Up @@ -125,19 +128,44 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
if(last>=100000 && last<1000000){
id="0"+id;
}
try (PrintWriter out = response.getWriter()) {
out.println("ASD"+id);
}
asd.getEntitieID(last+"");
Calendar fecha = new GregorianCalendar();
String f= fecha.get(Calendar.YEAR) +"-"+(fecha.get(Calendar.MONTH)+1)+"-"+fecha.get(Calendar.DAY_OF_MONTH);
asd.getData().set(asd.getColums().indexOf("FECHA"),f );
asd.getData().set(asd.getColums().indexOf("FECHAEXP"), f);
asd.getData().set(asd.getColums().indexOf("POLIZA"), "ASD"+id);
asd.getData().set(asd.getColums().indexOf("POLIZA"), "AD"+id);
asd.getData().set(asd.getColums().indexOf("PLAN"), plan);
asd.getData().set(asd.getColums().indexOf("ESTADO"), "2");
asd.getData().set(asd.getColums().indexOf("CLIENTE"), idCliente);
asd.update();
//CONSUMO DE WEB SERVICE EN UN AGENTE EXTERIOR
WebServiceAsistenciaDen wsad = new WebServiceAsistenciaDen();

//System.out.println("Client2"+cliente);
String messagge = wsad.registro(asd, cliente);
if(messagge.equals("1")){
try (PrintWriter out = response.getWriter()) {
out.println("<script type=\"text/javascript\">\n"
+ "swal(\n" +
"'Guardado!',\n" +
"'Numero de Poliza AD"+id+" En breve se le enviara un correo',\n" +
"'success'\n" +
")\n"
+ "</script>");
}
}
else{
try (PrintWriter out = response.getWriter()) {
out.println("<script type=\"text/javascript\">\n"
+" swal(\n" +
"'Error!',\n" +
"'Poliza AD"+id+"; "+messagge+" ',\n" +
"'error'\n" +
")\n"
+ "</script>");
}
}

}
else{
response.sendRedirect("login.jsp?validate=Por+favor+ingresar+credenciales");
Expand Down
16 changes: 8 additions & 8 deletions src/java/com/sysware/concesionario/services/RESTFUL.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ public static void main(String[] args) throws Exception {
}


protected static String responseAsString(CloseableHttpResponse response) throws IOException {
return streamAsString(response.getEntity().getContent());
}
protected static String responseAsString(CloseableHttpResponse response) throws IOException {
return streamAsString(response.getEntity().getContent());
}

protected static String streamAsString(InputStream inputStream) throws IOException {
StringWriter writer = new StringWriter();
IOUtils.copy(inputStream, writer, ENCODING);
return writer.toString();
}
protected static String streamAsString(InputStream inputStream) throws IOException {
StringWriter writer = new StringWriter();
IOUtils.copy(inputStream, writer, ENCODING);
return writer.toString();
}


private static Response bodyResponse(String responseBody) {
Expand Down
Loading

0 comments on commit bcff0b8

Please sign in to comment.