Skip to content

Commit

Permalink
v1.0.0 Demostrador
Browse files Browse the repository at this point in the history
  • Loading branch information
bolollo committed Sep 17, 2014
1 parent f4a69d4 commit 1322b69
Show file tree
Hide file tree
Showing 29 changed files with 1,501 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="TOMCAT_HOME/common/lib/servlet-api.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/common/lib/jasper-runtime.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/common/lib/jsp-api.jar"/>
<classpathentry kind="src" path="WEB-INF/src"/>
<classpathentry kind="src" output="work" path="work"/>
<classpathentry kind="lib" path="WEB-INF/lib/commons-beanutils-1.7.0.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/commons-collections-3.2.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/commons-lang-2.4.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/commons-logging-1.1.1.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/ezmorph-1.0.6.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/json-lib-2.2.1-jdk15.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/commons-httpclient-3.1.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/commons-codec-1.3.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/commons-validator-1.3.0.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/xom-1.2.3.jar"/>
<classpathentry kind="output" path="WEB-INF/classes"/>
</classpath>
1 change: 1 addition & 0 deletions .cvsignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
work
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin
1 change: 1 addition & 0 deletions WEB-INF/.cvsignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
classes
Binary file added WEB-INF/lib/commons-beanutils-1.7.0.jar
Binary file not shown.
Binary file added WEB-INF/lib/commons-codec-1.3.jar
Binary file not shown.
Binary file added WEB-INF/lib/commons-collections-3.2.jar
Binary file not shown.
Binary file added WEB-INF/lib/commons-httpclient-3.1.jar
Binary file not shown.
Binary file added WEB-INF/lib/commons-lang-2.4.jar
Binary file not shown.
Binary file added WEB-INF/lib/commons-logging-1.1.1.jar
Binary file not shown.
Binary file added WEB-INF/lib/commons-validator-1.3.0.jar
Binary file not shown.
Binary file added WEB-INF/lib/ezmorph-1.0.6.jar
Binary file not shown.
Binary file added WEB-INF/lib/json-lib-2.2.1-jdk15.jar
Binary file not shown.
Binary file added WEB-INF/lib/xom-1.2.3.jar
Binary file not shown.
54 changes: 54 additions & 0 deletions cercaCarrersCadastre.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.net.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="org.w3c.dom.*" %>
<%@ page import="org.apache.commons.httpclient.*" %>
<%@ page import="org.apache.commons.httpclient.methods.*" %>
<%@ page import="net.sf.json.xml.XMLSerializer" %>
<%@ page import="net.sf.json.JSON" %>
<%@ page import="net.sf.json.JSONArray" %>
<%
response.setContentType("application/json");
HttpClient httpclient = new HttpClient();
String SERVIDOR_CATASTRO = "http://ovc.catastro.meh.es/ovcservweb/OVCSWLocalizacionRC/";
String SERVIDOR_CALLEJERO = SERVIDOR_CATASTRO+"OVCCallejero.asmx/";
String RUTA_CATASTRO_DNPLOC = SERVIDOR_CALLEJERO+"Consulta_DNPLOC?";
String jsonp = request.getParameter("jsonp");
String resp = "";
String provincia = request.getParameter("provincia");
String municipi = request.getParameter("municipi");
String sigla = request.getParameter("sigla");
String calle = request.getParameter("calle");
String numero = request.getParameter("numero");
String peticio = RUTA_CATASTRO_DNPLOC+"Provincia="+provincia+"&Municipio="+URLEncoder.encode(municipi)+"&Sigla="+sigla+"&Calle="+URLEncoder.encode(calle)+"&Numero="+numero+"&Bloque=&Escalera=&Planta=&Puerta=&";
//System.out.println(peticio);
GetMethod httpget = new GetMethod(peticio);
try {
String respuesta = "";
httpclient.executeMethod(httpget);
String status=httpget.getStatusLine().toString();
if(status.indexOf("OK") != -1){
respuesta = httpget.getResponseBodyAsString();
}else{
out.write("{\"ERROR\":\"No es pot obtenir el llistat de vies\"}");
}
//respuesta = respuesta.replaceAll("'","@");
JSON jsonResponse = new JSONArray();
XMLSerializer xmlS= new XMLSerializer();
xmlS.setSkipNamespaces(true);
jsonResponse = xmlS.read(respuesta);
resp = jsonResponse.toString();
if (jsonp != null){
resp = jsonp + "(" + resp + ")";
}
out.println(resp);
}catch(Exception e){
e.printStackTrace();
}finally {
httpget.releaseConnection();
}
%>
51 changes: 51 additions & 0 deletions cercaCarrersMunicipi.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.net.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="org.w3c.dom.*" %>
<%@ page import="org.apache.commons.httpclient.*" %>
<%@ page import="org.apache.commons.httpclient.methods.*" %>
<%@ page import="net.sf.json.xml.XMLSerializer" %>
<%@ page import="net.sf.json.JSON" %>
<%@ page import="net.sf.json.JSONArray" %>
<%
response.setContentType("application/json");
HttpClient httpclient = new HttpClient();
String SERVIDOR_CATASTRO = "http://ovc.catastro.meh.es/ovcservweb/OVCSWLocalizacionRC/";
String SERVIDOR_CALLEJERO = SERVIDOR_CATASTRO+"OVCCallejeroCodigos.asmx/";
String RUTA_CATASTRO_VIA = SERVIDOR_CALLEJERO+"ConsultaViaCodigos?";
String jsonp = request.getParameter("jsonp");
String resp = "";
String provincia = request.getParameter("provincia");
String municipi = request.getParameter("municipi");
String peticio = RUTA_CATASTRO_VIA+"CodigoProvincia="+provincia+"&CodigoMunicipio="+municipi+"&CodigoMunicipioINE=&CodigoVia=&";
GetMethod httpget = new GetMethod(peticio);
try {
String respuesta = "";
httpclient.executeMethod(httpget);
String status=httpget.getStatusLine().toString();
if(status.indexOf("OK") != -1){
respuesta = httpget.getResponseBodyAsString();
}else{
out.write("{\"ERROR\":\"No es pot obtenir el llistat de vies\"}");
}
//respuesta = respuesta.replaceAll("'","@");
JSON jsonResponse = new JSONArray();
XMLSerializer xmlS= new XMLSerializer();
xmlS.setSkipNamespaces(true);
jsonResponse = xmlS.read(respuesta);
resp = jsonResponse.toString();
if (jsonp != null){
resp = jsonp + "(" + resp + ")";
}
out.println(resp);
}catch(Exception e){
e.printStackTrace();
}finally {
httpget.releaseConnection();
}
%>
52 changes: 52 additions & 0 deletions cercaXYCadastre.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.net.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="org.w3c.dom.*" %>
<%@ page import="org.apache.commons.httpclient.*" %>
<%@ page import="org.apache.commons.httpclient.methods.*" %>
<%@ page import="net.sf.json.xml.XMLSerializer" %>
<%@ page import="net.sf.json.JSON" %>
<%@ page import="net.sf.json.JSONArray" %>
<%
response.setContentType("application/json");
HttpClient httpclient = new HttpClient();
String SERVIDOR_CATASTRO = "http://ovc.catastro.meh.es/ovcservweb/OVCSWLocalizacionRC/";
String SERVIDOR_CALLEJERO = SERVIDOR_CATASTRO+"OVCCoordenadas.asmx/";
String RUTA_CATASTRO_CPMRC = SERVIDOR_CALLEJERO+"Consulta_CPMRC?";
String jsonp = request.getParameter("jsonp");
String resp = "";
String rc = request.getParameter("rc");
String srs = request.getParameter("epsg");
String peticio = RUTA_CATASTRO_CPMRC+"RC="+rc+"&SRS="+srs+"&Provincia=&Municipio=&";
System.out.println(peticio);
GetMethod httpget = new GetMethod(peticio);
try {
String respuesta = "";
httpclient.executeMethod(httpget);
String status=httpget.getStatusLine().toString();
if(status.indexOf("OK") != -1){
respuesta = httpget.getResponseBodyAsString();
}else{
out.write("{\"ERROR\":\"No es pot obtenir el llistat de vies\"}");
}
//respuesta = respuesta.replaceAll("'","@");
JSON jsonResponse = new JSONArray();
XMLSerializer xmlS= new XMLSerializer();
xmlS.setSkipNamespaces(true);
jsonResponse = xmlS.read(respuesta);
resp = jsonResponse.toString();
if (jsonp != null){
resp = jsonp + "(" + resp + ")";
}
out.println(resp);
}catch(Exception e){
e.printStackTrace();
}finally {
httpget.releaseConnection();
}
%>
3 changes: 3 additions & 0 deletions css/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@CHARSET "UTF-8";

#map { height: 600px; }
87 changes: 87 additions & 0 deletions css/select2-bootstrap.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
.form-control .select2-choice {
border: 0;
border-radius: 2px;
}

.form-control .select2-choice .select2-arrow {
border-radius: 0 2px 2px 0;
}

.form-control.select2-container {
height: auto !important;
padding: 0;
}

.form-control.select2-container.select2-dropdown-open {
border-color: #5897FB;
border-radius: 3px 3px 0 0;
}

.form-control .select2-container.select2-dropdown-open .select2-choices {
border-radius: 3px 3px 0 0;
}

.form-control.select2-container .select2-choices {
border: 0 !important;
border-radius: 3px;
}

.control-group.warning .select2-container .select2-choice,
.control-group.warning .select2-container .select2-choices,
.control-group.warning .select2-container-active .select2-choice,
.control-group.warning .select2-container-active .select2-choices,
.control-group.warning .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.warning .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.warning .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #C09853 !important;
}

.control-group.warning .select2-container .select2-choice div {
border-left: 1px solid #C09853 !important;
background: #FCF8E3 !important;
}

.control-group.error .select2-container .select2-choice,
.control-group.error .select2-container .select2-choices,
.control-group.error .select2-container-active .select2-choice,
.control-group.error .select2-container-active .select2-choices,
.control-group.error .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.error .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.error .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #B94A48 !important;
}

.control-group.error .select2-container .select2-choice div {
border-left: 1px solid #B94A48 !important;
background: #F2DEDE !important;
}

.control-group.info .select2-container .select2-choice,
.control-group.info .select2-container .select2-choices,
.control-group.info .select2-container-active .select2-choice,
.control-group.info .select2-container-active .select2-choices,
.control-group.info .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.info .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.info .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #3A87AD !important;
}

.control-group.info .select2-container .select2-choice div {
border-left: 1px solid #3A87AD !important;
background: #D9EDF7 !important;
}

.control-group.success .select2-container .select2-choice,
.control-group.success .select2-container .select2-choices,
.control-group.success .select2-container-active .select2-choice,
.control-group.success .select2-container-active .select2-choices,
.control-group.success .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.success .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.success .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #468847 !important;
}

.control-group.success .select2-container .select2-choice div {
border-left: 1px solid #468847 !important;
background: #DFF0D8 !important;
}
Binary file added css/select2-spinner.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1322b69

Please sign in to comment.