Revision 9488

View differences:

org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
 <modelVersion>4.0.0</modelVersion>
3
 <parent>
4
  <groupId>org.gvsig</groupId>
5
  <artifactId>org.gvsig.desktop</artifactId>
6
  <version>2.0.445</version>
7
 </parent>
8
 <artifactId>org.gvsig.busquedacatastral</artifactId>
9
 <version>1.0.188</version>
10
 <packaging>pom</packaging>
11
 <name>org.gvsig.busquedacatastral</name>
12
 <description>Busqueda catastral Plugin</description>
13

  
14
 <repositories>
15
  <repository>
16
   <id>gvsig-public-http-repository</id>
17
   <name>gvSIG maven public HTTP repository</name>
18
   <url>http://devel.gvsig.org/m2repo/j2se</url>
19
   <releases>
20
    <enabled>true</enabled>
21
    <updatePolicy>daily</updatePolicy>
22
    <checksumPolicy>warn</checksumPolicy>
23
   </releases>
24
   <snapshots>
25
    <enabled>true</enabled>
26
    <updatePolicy>daily</updatePolicy>
27
    <checksumPolicy>warn</checksumPolicy>
28
   </snapshots>
29
  </repository>
30
 </repositories>
31

  
32
 <url>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url>
33
 <scm>
34
  <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188</connection>
35
  <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188</developerConnection>
36
  <url>https://devel.gvsig.org/redmine/projects/gvsig-projects-pool/repository/show/org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188</url>
37
 </scm>
38

  
39
 <distributionManagement>
40
  <site>
41
   <id>gvsig-repository</id>
42
   <url>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url>
43
  </site>
44
 </distributionManagement>
45

  
46
 <build>
47
  <plugins>
48
   <plugin>
49
    <groupId>org.apache.maven.plugins</groupId>
50
    <artifactId>maven-release-plugin</artifactId>
51
    <configuration>
52
     <tagBase>https://devel.gvsig.org/svn/gvsig-projects-pool/${project.artifactId}/tags</tagBase>
53
    </configuration>
54
   </plugin>
55
  </plugins>
56
 </build>
57

  
58
 <dependencyManagement>
59
  <dependencies>
60
   <dependency>
61
    <groupId>org.gvsig</groupId>
62
    <artifactId>org.gvsig.busquedacatastral.app.mainplugin</artifactId>
63
    <version>${org.gvsig.busquedacatastral.version}</version>
64
   </dependency>
65
   <dependency>
66
    <groupId>org.gvsig</groupId>
67
    <artifactId>org.gvsig.busquedacatastral.lib.api</artifactId>
68
    <version>${org.gvsig.busquedacatastral.version}</version>
69
   </dependency>
70
   <dependency>
71
    <groupId>org.gvsig</groupId>
72
    <artifactId>org.gvsig.busquedacatastral.lib.impl</artifactId>
73
    <version>${org.gvsig.busquedacatastral.version}</version>
74
   </dependency>
75
   <dependency>
76
    <groupId>org.gvsig</groupId>
77
    <artifactId>org.gvsig.busquedacatastral.swing.api</artifactId>
78
    <version>${org.gvsig.busquedacatastral.version}</version>
79
   </dependency>
80
   <dependency>
81
    <groupId>org.gvsig</groupId>
82
    <artifactId>org.gvsig.busquedacatastral.swing.impl</artifactId>
83
    <version>${org.gvsig.busquedacatastral.version}</version>
84
   </dependency>
85

  
86
   <!--These dependencies are added to use the webservice and parse its response -->
87
   <dependency>
88
    <groupId>axis</groupId>
89
    <artifactId>axis-jaxrpc</artifactId>
90
    <version>1.4</version>
91
   </dependency>
92
   <dependency>
93
    <groupId>org.apache.axis</groupId>
94
    <artifactId>axis</artifactId>
95
    <version>1.4</version>
96
   </dependency>
97
   <dependency>
98
    <groupId>commons-logging</groupId>
99
    <artifactId>commons-logging</artifactId>
100
    <version>1.1.1</version>
101
   </dependency>
102
   <dependency>
103
    <groupId>commons-discovery</groupId>
104
    <artifactId>commons-discovery</artifactId>
105
    <version>0.4</version>
106
   </dependency>
107
   <dependency>
108
    <groupId>wsdl4j</groupId>
109
    <artifactId>wsdl4j</artifactId>
110
    <version>1.6.2</version>
111
   </dependency>
112

  
113
  </dependencies>
114
 </dependencyManagement>
115

  
116
 <modules>
117
  <module>org.gvsig.busquedacatastral.app</module>
118
  <module>org.gvsig.busquedacatastral.lib</module>
119
  <module>org.gvsig.busquedacatastral.swing</module>
120
 </modules>
121

  
122
 <properties>
123
  <org.gvsig.busquedacatastral.version>1.0.188</org.gvsig.busquedacatastral.version>
124
 </properties>
125
</project>
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188/org.gvsig.busquedacatastral.app/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
  <modelVersion>4.0.0</modelVersion>
3
  <parent>
4
    <groupId>org.gvsig</groupId>
5
    <artifactId>org.gvsig.busquedacatastral</artifactId>
6
    <version>1.0.188</version>
7
  </parent>
8
  <artifactId>org.gvsig.busquedacatastral.app</artifactId>
9
  <packaging>pom</packaging>
10
  <modules>
11
   <module>org.gvsig.busquedacatastral.app.mainplugin</module>
12
  </modules>
13
</project>
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188/org.gvsig.busquedacatastral.app/org.gvsig.busquedacatastral.app.mainplugin/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
 <modelVersion>4.0.0</modelVersion>
3
 <parent>
4
  <groupId>org.gvsig</groupId>
5
  <artifactId>org.gvsig.busquedacatastral.app</artifactId>
6
  <version>1.0.188</version>
7
 </parent>
8
 <artifactId>org.gvsig.busquedacatastral.app.mainplugin</artifactId>
9
 <name>${project.artifactId}</name>
10

  
11
 <dependencies>
12
  <dependency>
13
   <groupId>org.gvsig</groupId>
14
   <artifactId>org.gvsig.busquedacatastral.lib.api</artifactId>
15
  </dependency>
16
  <dependency>
17
   <groupId>org.gvsig</groupId>
18
   <artifactId>org.gvsig.busquedacatastral.lib.impl</artifactId>
19
  </dependency>
20
  <dependency>
21
   <groupId>org.gvsig</groupId>
22
   <artifactId>org.gvsig.busquedacatastral.swing.api</artifactId>
23
  </dependency>
24
  <dependency>
25
   <groupId>org.gvsig</groupId>
26
   <artifactId>org.gvsig.busquedacatastral.swing.impl</artifactId>
27
  </dependency>
28
  <dependency>
29
   <groupId>org.gvsig</groupId>
30
   <artifactId>org.gvsig.app.mainplugin</artifactId>
31
   <scope>compile</scope>
32
  </dependency>
33

  
34
  <!--These dependencies are added to use the webservice and parse its response -->
35
  <dependency>
36
   <groupId>axis</groupId>
37
   <artifactId>axis-jaxrpc</artifactId>
38
   <scope>compile</scope>
39
  </dependency>
40
  <dependency>
41
   <groupId>org.apache.axis</groupId>
42
   <artifactId>axis</artifactId>
43
   <scope>compile</scope>
44
  </dependency>
45
  <dependency>
46
   <groupId>commons-logging</groupId>
47
   <artifactId>commons-logging</artifactId>
48
   <scope>compile</scope>
49
  </dependency>
50
  <dependency>
51
   <groupId>commons-discovery</groupId>
52
   <artifactId>commons-discovery</artifactId>
53
   <scope>compile</scope>
54
  </dependency>
55
  <dependency>
56
   <groupId>wsdl4j</groupId>
57
   <artifactId>wsdl4j</artifactId>
58
   <scope>compile</scope>
59
  </dependency>
60

  
61

  
62
 </dependencies>
63

  
64
 <properties>
65
  <!-- Package info property values -->
66
  <gvsig.package.info.state>testing</gvsig.package.info.state>
67
  <gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge
68
   2.1.0-A</gvsig.package.info.dependencies>
69
  <gvsig.package.info.official>true</gvsig.package.info.official>
70
  <gvsig.package.info.name>Tools: Buscador Catastro (Spain)"</gvsig.package.info.name>
71
  <gvsig.package.info.description>Searchs for catastro info</gvsig.package.info.description>
72
  <gvsig.package.info.categories>Remote Services,Catastro</gvsig.package.info.categories>
73
  <gvsig.package.info.javaVM>j1_8</gvsig.package.info.javaVM>
74
  <gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-busquedacatastral/pool</gvsig.package.info.poolURL>
75
 </properties>
76
</project>
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188/org.gvsig.busquedacatastral.app/org.gvsig.busquedacatastral.app.mainplugin/buildNumber.properties
1
#Fri Apr 12 11:45:59 CEST 2024
2
buildNumber=192
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188/org.gvsig.busquedacatastral.app/org.gvsig.busquedacatastral.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties
1
#Translations for language [en]
2
#Tue Jun 05 16:07:12 CEST 2007
3
_busqueda_catastral=Cadastral Search
4
_busqueda_municipios=Municipality Search
5
_busqueda_vias=Street Search
6
_busqueda_numeros=Number Search
7

  
8
_BusquedaCatastralGettingParametersException=Error getting parameters
9
_BusquedaCatastralGettingDataException=Error getting data
10
_BusquedaCatastralInvalidSRSException=SRS not valid for cadastre
11
_BusquedaCatastralCreatingPanelException=Error creating panel
12
_BusquedaCatastralObtainingPointException=Error getting point
13
_BusquedaCatastralObtainingDataException=Error getting data
14
_error_getting_parameters=Error getting parameters
15
_error_needed_parameters=Needed parameter
16
_error_invalid_query=Invalid query
17
_error_obtaining_data=Error getting data
18
_error_creating_panel=Error creating panel
19
_error_obtaining_point=Error getting point
20
_error_getting_municipios=Error getting municipalities
21
_error_getting_vias=Error getting streets
22
_error_getting_numeros=Error getting numbers
23
_numero_not_found_for_parameters=Number not found
24

  
25
_error_obtaining_catastro_webservice=Error getting cadastre webservice
26
_error_reading_response_from_ws=Error reding webservice response
27
_no_hay_municipio_seleccionado=A municipality must be selected
28
_no_hay_via_seleccionada=A street must be selected
29
_no_hay_numero_seleccionado=A number must be selected
30
_error_getting_feature_store=Error getting data store
31
_error_reading_feature_store=Error reading feature store
32
_error_getting_cache_file=Error getting cache file
33
_error_borrando_cache=Error deleting cache
34
_error_provincia_not_informed=Province not informed
35
_error_municipio_not_informed=Municipality not informed
36
_error_tipo_parcela_not_informed=Smallholding type not informed
37
_error_tipo_via_not_informed=Street type not informed
38
_error_via_not_informed=Street not informed
39
_error_numero_not_informed=Number not informed
40
_error_poligono_not_informed=Zone not informed
41
_error_parcela_not_informed=Smallholding not informed
42
_error_rc_not_informed=Cadastral reference not informed
43
_error_refCatastral_not_informed=Cadastral reference not valid
44
_error_tipo_query_not_informed=Query type not informed
45
_error_SRS=Invalid SRS
46
_error_creando_panel_busqueda_catastral=Error creating Cadastral Search Panel
47
_error_creando_panel_vias=Error creating Street Search Panel
48
_error_creando_panel_municipios=Error creating Municipality Search Panel
49
_cache_delete_ok=Cache deleted correctly
50
_no_se_han_encontrado_resultados_para_estos_datos=There is not data for these parameters
51
_error_couldnt_get_coords=Coordinates not found for this reference
52
_error_obteniendo_el_punto_para_ref_catastral=Coordinates not found for this reference
53
_errors_found_by_ws=Webservice has found errors
54
_error_reprojecting_point=Error reprojecting point
55

  
56
_proyeccion_no_valida_se_usara_valor_por_defecto=Projection not valid for Cadastre. Default projection will be used
57
_provincia_vacia_en_busqueda_municipios=Empty Province in Municipality Search Panel
58
_provincia_vacia_en_busqueda_vias=Empty Province in Street Search Panel
59
_municipio_vacio_en_busqueda_vias=Empty Municipality in Street Search Panel
60
_provincia_vacia_en_busqueda_numeros=Empty Province in Numbers Search Panel
61
_municipio_vacio_en_busqueda_numeros=Empty Municipality in Numbers Search Panel
62
_via_vacia_en_busqueda_numeros=Empty Street in Numbers Search Panel
63

  
64
_referencia_catastral=Cadastral reference
65
_localizacion=Location
66
_provincia=Province
67
_municipio=Municipality
68
_municipios=Municipalities
69
_urbanos=Urban
70
_via=Street
71
_vias=Streets
72
_numero=Number
73
_numeros=Numbers
74
_bloque=Block
75
_escalera=Stair
76
_planta=Floor
77
_puerta=Door
78
_rusticos=Rustic
79
_poligono=Zone
80
_parcela=Smallholding
81
_borrar_cache=Delete Cache
82
_buscar=Search
83
_ver_datos=View Data
84
_localizar=Locate
85
_cancelar=Cancel
86
_aceptar=Accept
87
_desde=From
88
_hasta=To
89
_km=Km
90
_paraje=Setting
91
_borrar_puntos=Delete points
92
_loading_data=Loading Data
93

  
94
_error_accesing_catastral_server=Error accessing the Catastro server.\nCheck your internet connection.\nIf it is correct, perhaps, the server is out of order.
95

  
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188/org.gvsig.busquedacatastral.app/org.gvsig.busquedacatastral.app.mainplugin/src/main/resources-plugin/i18n/text.properties
1
#Translations for language [es]
2
#Mon Feb 26 16:06:24 CET 2007
3
#\u00e1 \u00e9 \u00ed \u00f3 \u00fa
4
_busqueda_catastral=B\u00fasqueda Catastral
5
_busqueda_municipios=B\u00fasqueda Municipios
6
_busqueda_vias=B\u00fasqueda V\u00edas
7
_busqueda_numeros=B\u00fasqueda N\u00fameros
8

  
9
_BusquedaCatastralGettingParametersException=Error obteniendo los par\u00e1metros
10
_BusquedaCatastralGettingDataException=Error obteniendo los datos solicitados
11
_BusquedaCatastralInvalidSRSException=El SRS usado no es v\u00e1lido para el catastro
12
_BusquedaCatastralCreatingPanelException=Error creando el panel
13
_BusquedaCatastralObtainingPointException=Error obteniendo el punto requerido
14
_BusquedaCatastralObtainingDataException=Error obteniendo los datos requeridos
15
_error_getting_parameters=Error en los par\u00e1metros introducidos
16
_error_needed_parameters=Falta par\u00e1metro necesario
17
_error_invalid_query=La consulta no es v\u00e1lida
18
_error_obtaining_data=Error obteniendo los datos
19
_error_creating_panel=Error creando el panel
20
_error_obtaining_point=Error obteniendo el punto
21
_error_getting_municipios=Error obteniendo los municipios
22
_error_getting_vias=Error obteniendo las v\u00edas
23
_error_getting_numeros=Error obteniendo los n\u00fameros
24
_numero_not_found_for_parameters=No se ha encontrado ning\u00fan n\u00famero para los par\u00e1metros indicados
25

  
26
_error_obtaining_catastro_webservice=Error obteniendo el servicio web del catastro
27
_error_reading_response_from_ws=Error leyendo la respuesta dada por el webservice
28
_no_hay_municipio_seleccionado=Debe de seleccionar un municipio.
29
_no_hay_via_seleccionada=Debe de seleccionar una v\u00eda.
30
_no_hay_numero_seleccionado=Debe de seleccionar un n\u00famero
31
_error_getting_feature_store=Error obteniendo almac\u00e9n de datos
32
_error_reading_feature_store=Error leyendo almac\u00e9n de datos
33
_error_getting_cache_file=Error obteniendo fichero de la cache
34
_error_borrando_cache=Error borrando la cache
35
_error_provincia_not_informed=Falta el campo Provincia
36
_error_municipio_not_informed=Falta el campo Municipio
37
_error_tipo_parcela_not_informed=Debe indicar el tipo de parcela
38
_error_tipo_via_not_informed=Falta el campo tipo de via
39
_error_via_not_informed=Falta el campo Via
40
_error_numero_not_informed=Falta el N\u00famero
41
_error_poligono_not_informed=Falta el Pol\u00edgono
42
_error_parcela_not_informed=Falta la Parcela
43
_error_rc_not_informed=Falta la referencia catastral
44
_error_refCatastral_not_informed=Referencia catastral no v\u00e1lida
45
_error_tipo_query_not_informed=Falta el tipo de consulta
46
_error_SRS=Error SRS no correcto
47
_error_creando_panel_busqueda_catastral=Se ha producido un error intentando crear el panel de B\u00fasqueda Catastral
48
_error_creando_panel_vias=Se ha producido un error intentando crear el panel de B\u00fasqueda V\u00edas
49
_error_creando_panel_municipios=Se ha producido un error intentando crear el panel de B\u00fasqueda Municipios
50
_cache_delete_ok=Cach\u00e9 borrada correctamente
51
_no_se_han_encontrado_resultados_para_estos_datos=No se han encontrado resultados para los datos indicados
52
_error_couldnt_get_coords=No se han encontrado coordenadas para esta referencia
53
_error_obteniendo_el_punto_para_ref_catastral=No se han encontrado coordenadas para la referencia
54
_errors_found_by_ws=El servicio web ha encontrado errores
55
_error_reprojecting_point=Se ha producido un error intentado reproyectar el punto a la vista seleccionada
56

  
57
_proyeccion_no_valida_se_usara_valor_por_defecto=Proyecci\u00f3n no admitida por el catastro. Se usar\u00e1 la proyecci\u00f3n por defecto
58
_provincia_vacia_en_busqueda_municipios=Provincia vac\u00eda en panel de b\u00fasqueda de municipios
59
_provincia_vacia_en_busqueda_vias=Provincia vac\u00eda en panel de b\u00fasqueda de v\u00edas
60
_municipio_vacio_en_busqueda_vias=Municipio vac\u00edo en panel de b\u00fasqueda de v\u00edas
61
_provincia_vacia_en_busqueda_numeros=Provincia vac\u00eda en panel de b\u00fasqueda de n\u00fameros
62
_municipio_vacio_en_busqueda_numeros=Municipio vac\u00edo en panel de b\u00fasqueda de n\u00fameros
63
_via_vacia_en_busqueda_numeros=V\u00eda vac\u00edo en panel de b\u00fasqueda de n\u00fameros
64

  
65
_referencia_catastral=Referencia Catastral
66
_localizacion=Localizaci\u00f3n
67
_provincia=Provincia
68
_municipio=Municipio
69
_municipios=Municipios
70
_urbanos=Urbanos
71
_via=Via
72
_vias=Vias
73
_numero=N\u00famero
74
_numeros=N\u00fameros
75
_bloque=Bloque
76
_escalera=Escalera
77
_planta=Planta
78
_puerta=Puerta
79
_rusticos=R\u00fasticos
80
_poligono=Pol\u00edgono
81
_parcela=Parcela
82
_borrar_cache=Borrar cach\u00e9
83
_buscar=Buscar
84
_ver_datos=Ver datos
85
_localizar=Localizar
86
_cancelar=Cancelar
87
_aceptar=Aceptar
88
_desde=Desde
89
_hasta=Hasta
90
_km=Km
91
_paraje=Paraje
92
_borrar_puntos=Borrar Puntos
93
_loading_data=Cargando datos
94

  
95
_error_accesing_catastral_server=Error accediendo al servidor de Catastro.\nRevise su conexi?n a internet.\nSi es correcta, tal vez el servidor est? fuera de servicio.
96

  
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188/org.gvsig.busquedacatastral.app/org.gvsig.busquedacatastral.app.mainplugin/src/main/resources-plugin/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="org.gvsig.app.mainplugin" />
4
	<libraries library-dir="lib"/>
5
	<resourceBundle name="text"/>
6
	<extensions>
7
		<extension class-name="org.gvsig.busquedacatastral.app.mainplugin.BusquedaCatastralExtension"
8
			description="Search by catastral info"
9
			active="true"
10
			priority="1">
11
   <action name="busqueda-catastral" label="_busqueda_catastral" tooltip="_busqueda_catastral"
12
        position="650101000" action-command="busqueda-catastral" icon="view-navigation-busqueda-catastral"
13
        accelerator="" />
14
      <menu text="View/Navigation/_busqueda_catastral" name="busqueda-catastral" />
15
      <tool-bar name="_busqueda_catastral" position="650101000">
16
        <action-tool name="busqueda-catastral" />
17
      </tool-bar>
18

  
19
		</extension>
20

  
21
	</extensions>
22
</plugin-config>
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188/org.gvsig.busquedacatastral.app/org.gvsig.busquedacatastral.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml
1
<assembly>
2
  <id>gvsig-plugin-package</id>
3
  <formats>
4
    <format>zip</format>
5
  </formats>
6
  <baseDirectory>${project.artifactId}</baseDirectory>
7
  <includeBaseDirectory>true</includeBaseDirectory>
8
  <files>
9
    <file>
10
      <source>target/${project.artifactId}-${project.version}.jar</source>
11
      <outputDirectory>lib</outputDirectory>
12
    </file>
13
    <file>
14
      <source>target/package.info</source>
15
    </file>
16
  </files>
17

  
18
  <fileSets>
19
    <fileSet>
20
      <directory>src/main/resources-plugin</directory>
21
      <outputDirectory>.</outputDirectory>
22
    </fileSet>
23
  </fileSets>
24

  
25
  <dependencySets>
26
    <dependencySet>
27
      <useProjectArtifact>false</useProjectArtifact>
28
      <useTransitiveDependencies>false</useTransitiveDependencies>
29
      <outputDirectory>lib</outputDirectory>
30
      <includes>
31
        <include>org.gvsig:org.gvsig.busquedacatastral.lib.api</include>
32
        <include>org.gvsig:org.gvsig.busquedacatastral.lib.impl</include>
33
        <include>org.gvsig:org.gvsig.busquedacatastral.swing.api</include>
34
        <include>org.gvsig:org.gvsig.busquedacatastral.swing.impl</include>
35
        <include>axis:axis-jaxrpc</include>
36
        <include>org.apache.axis:axis</include>
37
        <include>commons-logging:commons-logging</include>
38
        <include>commons-discovery:commons-discovery</include>
39
        <include>wsdl4j:wsdl4j</include>
40
      </includes>
41
    </dependencySet>
42
  </dependencySets>
43

  
44
</assembly>
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188/org.gvsig.busquedacatastral.app/org.gvsig.busquedacatastral.app.mainplugin/src/main/java/org/gvsig/busquedacatastral/app/mainplugin/BusquedaCatastralExtension.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.busquedacatastral.app.mainplugin;
24

  
25
import java.awt.Color;
26
import java.awt.event.ActionEvent;
27
import java.awt.event.ActionListener;
28
import java.io.File;
29

  
30
import javax.swing.JOptionPane;
31

  
32
import org.apache.commons.lang3.StringUtils;
33
import org.cresques.cts.IProjection;
34

  
35
import org.gvsig.andami.IconThemeHelper;
36
import org.gvsig.andami.Utilities;
37
import org.gvsig.andami.plugins.Extension;
38
import org.gvsig.app.ApplicationLocator;
39
import org.gvsig.app.ApplicationManager;
40
import org.gvsig.app.project.documents.view.ViewDocument;
41
import org.gvsig.app.project.documents.view.gui.IView;
42
import org.gvsig.busquedacatastral.lib.api.BusquedaCatastralLocator;
43
import org.gvsig.busquedacatastral.lib.api.BusquedaCatastralManager;
44
import org.gvsig.busquedacatastral.lib.api.ReferenciaCatastral;
45
import org.gvsig.busquedacatastral.lib.api.exceptions.BusquedaCatastralException;
46
import org.gvsig.busquedacatastral.lib.api.exceptions.BusquedaCatastralRemoteServiceException;
47
import org.gvsig.busquedacatastral.lib.impl.ws.CallejeroCatastroWSLocator;
48
import org.gvsig.busquedacatastral.swing.api.BusquedaCatastralConsultaCatastralPanel;
49
import org.gvsig.busquedacatastral.swing.api.BusquedaCatastralSwingLocator;
50
import org.gvsig.busquedacatastral.swing.api.exceptions.BusquedaCatastralCreatingPanelException;
51
import org.gvsig.busquedacatastral.swing.api.exceptions.BusquedaCatastralObtainingDataException;
52
import org.gvsig.busquedacatastral.swing.api.exceptions.BusquedaCatastralObtainingPointException;
53
import org.gvsig.fmap.geom.Geometry;
54
import org.gvsig.fmap.geom.GeometryLocator;
55
import org.gvsig.fmap.geom.GeometryManager;
56
import org.gvsig.fmap.geom.primitive.Envelope;
57
import org.gvsig.fmap.geom.primitive.Point;
58
import org.gvsig.fmap.mapcontext.MapContext;
59
import org.gvsig.fmap.mapcontext.MapContextLocator;
60
import org.gvsig.fmap.mapcontext.ViewPort;
61
import org.gvsig.fmap.mapcontext.layers.vectorial.GraphicLayer;
62
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
63
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager;
64
import org.gvsig.symbology.SymbologyLocator;
65
import org.gvsig.symbology.SymbologyManager;
66
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol;
67
import org.gvsig.tools.ToolsLocator;
68
import org.gvsig.tools.dynobject.DynObject;
69
import org.gvsig.tools.i18n.I18nManager;
70
import org.gvsig.tools.locator.LocatorException;
71
import org.gvsig.tools.swing.api.ToolsSwingLocator;
72
import org.gvsig.tools.swing.api.windowmanager.WindowManager;
73

  
74
import org.slf4j.Logger;
75
import org.slf4j.LoggerFactory;
76

  
77

  
78

  
79
/**
80
 * Extension for catastral data searchs
81
 * @author dmartinez (dmartinez@disid.com)
82
 */
83
public class BusquedaCatastralExtension extends Extension {
84
	private Logger              logger           = LoggerFactory.getLogger(BusquedaCatastralExtension.class);
85

  
86
	private static final String CACHEFOLDERNAME="BusquedaCatastral";
87

  
88
	public static final String SHOW_POINT_BUSQUEDACATASTRAL_ID = "ShowPointBusquedaCatastral";
89

  
90
	public void initialize() {
91
	    IconThemeHelper.registerIcon(null, "view-navigation-busqueda-catastral", this);
92
	    BusquedaCatastralLocator.getManager().setCacheFolder(new File(Utilities.TEMPDIRECTORYPATH, CACHEFOLDERNAME));
93
	}
94

  
95
	public void postInitialize() {
96

  
97
	}
98

  
99
	public void execute(String actionCommand) {
100
	    final WindowManager winManager = ToolsSwingLocator.getWindowManager();
101
	    final I18nManager i18nManager = ToolsLocator.getI18nManager();
102

  
103
	    if (StringUtils.equalsIgnoreCase(actionCommand, "busqueda-catastral")) {
104
	        //Create GUI to query catastro
105
	        BusquedaCatastralConsultaCatastralPanel panel;
106
            try {
107
                panel = BusquedaCatastralSwingLocator.getManager().createConsultaCatastralPanel();
108
            } catch (BusquedaCatastralRemoteServiceException e) {
109
                logger.error("Error creating panel", e);
110
                JOptionPane.showMessageDialog(
111
                    null,
112
                    new StringBuilder().append(i18nManager.getTranslation("_error_accesing_catastral_server")),
113
                    i18nManager.getTranslation("error"), JOptionPane.ERROR_MESSAGE);
114
                return;
115
            } catch (Exception e) {
116
                logger.error("Error creating panel", e);
117
                JOptionPane.showMessageDialog(
118
                    null,
119
                    new StringBuilder().append(i18nManager.getTranslation("_error_creating_panel"))
120
                        .append(":").append(e.getLocalizedMessage()),
121
                    i18nManager.getTranslation("error"), JOptionPane.ERROR_MESSAGE);
122
                return;
123
            }
124
            panel.addActionListener(new ActionListener() {
125

  
126
                public void actionPerformed(ActionEvent event) {
127
                    BusquedaCatastralConsultaCatastralPanel panel = (BusquedaCatastralConsultaCatastralPanel) event.getSource();
128
                    if (panel.isSelectedAction(BusquedaCatastralConsultaCatastralPanel.PanelAction.CANCEL)) {
129
                        return;
130
                    }else if(panel.isSelectedAction(BusquedaCatastralConsultaCatastralPanel.PanelAction.FOCUSTOPOINT)){
131
                        Point selectedPoint;
132
                        ReferenciaCatastral selectedRefCatastral;
133
                        try {
134
                            selectedPoint = panel.getPoint(getActiveViewProjection());
135
                            selectedRefCatastral=panel.getSelectedReferenciaCatastral();
136
                        } catch (BusquedaCatastralObtainingPointException e) {
137
                            logger.error("Error obtaining point", e);
138
                            JOptionPane.showMessageDialog(
139
                                null,
140
                                new StringBuilder().append(i18nManager.getTranslation("_error_obtaining_point"))
141
                                    .append(":").append(e.getLocalizedMessage()),
142
                                i18nManager.getTranslation("error"), JOptionPane.ERROR_MESSAGE);
143
                            return;
144
                        }
145
                        focusToPoint(selectedPoint);
146
                        showPoint(selectedPoint,selectedRefCatastral.getRC());
147
                    }else if(panel.isSelectedAction(BusquedaCatastralConsultaCatastralPanel.PanelAction.DELETEPOINTS)){
148
                        deletePoints();
149
                    }else if(panel.isSelectedAction(BusquedaCatastralConsultaCatastralPanel.PanelAction.SHOWDATA)){
150
                        try {
151
                            DynObject datosCatastrales=panel.getDatosCatastrales();
152
                        } catch (BusquedaCatastralObtainingDataException e) {
153
                            logger.error("Error obtaining datos catastrales", e);
154
                            JOptionPane.showMessageDialog(
155
                                null,
156
                                new StringBuilder().append(i18nManager.getTranslation("_error_obtaining_data"))
157
                                    .append(":").append(e.getLocalizedMessage()),
158
                                i18nManager.getTranslation("error"), JOptionPane.ERROR_MESSAGE);
159
                            return;
160
                        }
161
                        //TODO Mostrar los datos obtenidos
162
                    }
163
                }
164
            });
165

  
166
            winManager.showWindow(panel.asJComponent(), i18nManager.getTranslation("_busqueda_catastral"),
167
                WindowManager.MODE.WINDOW);
168

  
169
	    }
170
	}
171

  
172

  
173

  
174
	public boolean isEnabled() {
175
	  //It needs an active view with a valid viewport
176
	    IView view = getActiveView();
177
        if (view != null) {
178
            ViewPort viewPort = view.getMapControl().getViewPort();
179
            Envelope viewPortEnvelope = viewPort.getEnvelope();
180
            if(viewPortEnvelope == null || viewPortEnvelope.isEmpty()){
181
                return false;
182
            }
183
            return true;
184
        }
185
        return false;
186
	}
187

  
188
	public boolean isVisible() {
189
	    //It needs an active view
190
	    IView view = getActiveView();
191
        if (view != null) {
192
            return true;
193
        }
194
        return false;
195
	}
196

  
197

  
198
    private IView getActiveView() {
199
        ApplicationManager application = ApplicationLocator.getManager();
200
        IView view = (IView) application.getActiveComponent(ViewDocument.class);
201
        return view;
202
    }
203

  
204
    private IProjection getActiveViewProjection(){
205
        if (getActiveView()!=null){
206
            return getActiveView().getMapControl().getViewPort().getProjection();
207
        }else{
208
            return null;
209
        }
210
    }
211

  
212
    /**
213
     * Focus the view centered in a selected Point
214
     * @param focusPoint
215
     */
216
    private void focusToPoint(Point focusPoint){
217
        IView activeView = getActiveView();
218
        if (activeView!=null){
219
            ViewPort viewPort =activeView.getMapControl().getViewPort();
220
            MapContext mapContext = activeView.getMapControl().getMapContext();
221
            Envelope envelope = viewPort.getAdjustedEnvelope();
222
            envelope.centerTo(focusPoint);
223
            mapContext.zoomToEnvelope(envelope);
224
        }
225
    }
226

  
227

  
228
    /**
229
     * Show the m in the point p on the graphicLayer
230
     *
231
     * @param m
232
     * @param ct
233
     */
234
    private void showPoint(Point p, String refCatastral) {
235
        IView activeView = getActiveView();
236
        if (activeView!=null){
237
            ViewPort viewPort =activeView.getMapControl().getViewPort();
238
            MapContext mapContext = activeView.getMapControl().getMapContext();
239
            GraphicLayer graphics = mapContext.getGraphicsLayer();
240
            GeometryManager geomManager = GeometryLocator.getGeometryManager();
241
            SymbolManager symbolManager = MapContextLocator.getSymbolManager();
242

  
243
            ISymbol markerSymbol = symbolManager.createSymbol(Geometry.TYPES.POINT, Color.RED);
244
            ISimpleTextSymbol textSymbol = getTextSymbol();
245
            textSymbol.setColor(Color.RED);
246
            textSymbol.setText(refCatastral);
247
            int idMarkerSymbol = graphics.addSymbol(markerSymbol);
248
            int idTextSymbol = graphics.addSymbol(textSymbol);
249
            Point clonedPoint = (Point) p.cloneGeometry();
250
            graphics.addGraphic(SHOW_POINT_BUSQUEDACATASTRAL_ID, clonedPoint, idTextSymbol);
251
            graphics.addGraphic(SHOW_POINT_BUSQUEDACATASTRAL_ID, clonedPoint, idMarkerSymbol);
252
            mapContext.invalidate();
253
        }
254
    }
255

  
256
    /*
257
     * Creates a text symbol to be used
258
     */
259
    private ISimpleTextSymbol getTextSymbol(){
260
        SymbologyManager symbologyManager = SymbologyLocator.getSymbologyManager();
261
        ISimpleTextSymbol textSymbol = symbologyManager.createSimpleTextSymbol();
262
        textSymbol.setFontSize(10);
263
        return textSymbol;
264
    }
265

  
266
    private void deletePoints(){
267
        IView activeView = getActiveView();
268
        if (activeView!=null){
269
            ViewPort viewPort =activeView.getMapControl().getViewPort();
270
            MapContext mapContext = activeView.getMapControl().getMapContext();
271
            GraphicLayer graphics = mapContext.getGraphicsLayer();
272
            graphics.removeGraphics(SHOW_POINT_BUSQUEDACATASTRAL_ID);
273
            mapContext.invalidate();
274
        }
275

  
276
    }
277

  
278
}
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188/org.gvsig.busquedacatastral.lib/org.gvsig.busquedacatastral.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.busquedacatastral.lib.impl.DefaultBusquedaCatastralLibrary
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188/org.gvsig.busquedacatastral.lib/org.gvsig.busquedacatastral.lib.impl/src/main/java/org/gvsig/busquedacatastral/lib/impl/DefaultBusquedaCatastralLibrary.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.busquedacatastral.lib.impl;
24

  
25
import org.gvsig.busquedacatastral.lib.api.BusquedaCatastralLibrary;
26
import org.gvsig.busquedacatastral.lib.api.BusquedaCatastralLocator;
27
import org.gvsig.tools.library.AbstractLibrary;
28
import org.gvsig.tools.library.LibraryException;
29

  
30

  
31
/**
32
 * Defines library for busqueda catastral
33
 * @author daniel
34
 *
35
 */
36
public class DefaultBusquedaCatastralLibrary  extends AbstractLibrary{
37
    @Override
38
    public void doRegistration() {
39
        registerAsImplementationOf(BusquedaCatastralLibrary.class);
40
    }
41

  
42
    @Override
43
    protected void doInitialize() throws LibraryException {
44
        BusquedaCatastralLocator.registerManager(DefaultBusquedaCatastralManager.class);
45
    }
46

  
47
    @Override
48
    protected void doPostInitialize() throws LibraryException {
49
        //Do nothing
50
    }
51
}
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188/org.gvsig.busquedacatastral.lib/org.gvsig.busquedacatastral.lib.impl/src/main/java/org/gvsig/busquedacatastral/lib/impl/Main.java
1
package org.gvsig.busquedacatastral.lib.impl;
2
import java.io.ByteArrayInputStream;
3
import java.io.InputStream;
4
import java.rmi.RemoteException;
5

  
6
import javax.xml.bind.JAXBContext;
7
import javax.xml.bind.JAXBException;
8
import javax.xml.bind.Unmarshaller;
9
import javax.xml.rpc.ServiceException;
10

  
11
import org.apache.axis.message.MessageElement;
12
import org.gvsig.busquedacatastral.lib.impl.ws.CallejeroCatastroWSLocator;
13
import org.gvsig.busquedacatastral.lib.impl.ws.CallejeroCatastroWSSoap;
14
import org.gvsig.busquedacatastral.lib.impl.ws.classes.MunicipiosWSResponse;
15
import org.gvsig.busquedacatastral.lib.impl.ws.classes.ProvinciasWSResponse;
16
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.ConsultaMunicipieror;
17
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.ConsultaProvincieror;
18
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.ObjectFactory;
19

  
20

  
21
/*
22
 * Copyright 2016 DiSiD Technologies S.L.L. All rights reserved.
23
 *
24
 * Project  : DiSiD WebServiceProject
25
 * SVN Id   : $Id$
26
 */
27

  
28
public class Main {
29

  
30
    public static void main(String[] args)  {
31
        try {
32
            CallejeroCatastroWSLocator locator=
33
                new CallejeroCatastroWSLocator();
34
            CallejeroCatastroWSSoap callejeroWS =
35
                locator.getCallejeroCatastroSoap();
36
            ProvinciasWSResponse provincias = callejeroWS.obtenerProvincias();
37

  
38
            ObjectFactory objfactory=new ObjectFactory();
39
            if (provincias!=null){
40
                MessageElement[] any = provincias.get_any();
41
                MessageElement me=any[0];
42
                JAXBContext jaxbContext = JAXBContext.newInstance(ConsultaProvincieror.class);
43

  
44
                Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
45
                InputStream input = new ByteArrayInputStream(me.getAsString().getBytes());
46
                ConsultaProvincieror cp = (ConsultaProvincieror) jaxbUnmarshaller.unmarshal(input);
47
                cp.getProvinciero();
48
            }
49
            MunicipiosWSResponse municipios = callejeroWS.obtenerMunicipios("VALENCIA", "");
50
            if (municipios!=null){
51
                MessageElement[] any = municipios.get_any();
52
                MessageElement me=any[0];
53
                JAXBContext jaxbContext = JAXBContext.newInstance(ConsultaMunicipieror.class);
54

  
55
                Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
56
                InputStream input = new ByteArrayInputStream(me.getAsString().getBytes());
57
                ConsultaMunicipieror cm = (ConsultaMunicipieror) jaxbUnmarshaller.unmarshal(input);
58
                cm.getMunicipiero();
59
            }
60

  
61

  
62
        } catch (ServiceException e) {
63
            // TODO Auto-generated catch block
64
            e.printStackTrace();
65
        } catch (RemoteException e) {
66
            // TODO Auto-generated catch block
67
            e.printStackTrace();
68
        } catch (JAXBException e) {
69
            // TODO Auto-generated catch block
70
            e.printStackTrace();
71
        } catch (Exception e) {
72
            // TODO Auto-generated catch block
73
            e.printStackTrace();
74
        }
75

  
76

  
77

  
78
    }
79

  
80
}
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188/org.gvsig.busquedacatastral.lib/org.gvsig.busquedacatastral.lib.impl/src/main/java/org/gvsig/busquedacatastral/lib/impl/ProvinciasFactory.java
1
package org.gvsig.busquedacatastral.lib.impl;
2

  
3
import java.io.ByteArrayInputStream;
4
import java.io.File;
5
import java.io.IOException;
6
import java.io.InputStream;
7
import java.rmi.RemoteException;
8
import java.util.List;
9

  
10
import javax.xml.bind.JAXBContext;
11
import javax.xml.bind.Unmarshaller;
12

  
13
import org.apache.axis.message.MessageElement;
14
import org.apache.commons.lang3.StringUtils;
15

  
16
import org.gvsig.busquedacatastral.lib.api.BusquedaCatastralManager;
17
import org.gvsig.busquedacatastral.lib.api.exceptions.BusquedaCatastralException;
18
import org.gvsig.busquedacatastral.lib.api.exceptions.BusquedaCatastralGettingParamsException;
19
import org.gvsig.busquedacatastral.lib.api.exceptions.BusquedaCatastralRemoteServiceException;
20
import org.gvsig.busquedacatastral.lib.impl.ws.classes.ProvinciasWSResponse;
21
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.ConsultaProvincieror;
22
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.Err;
23
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.Prov;
24
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.Provinciero;
25
import org.gvsig.fmap.dal.DataTypes;
26
import org.gvsig.fmap.dal.exception.DataException;
27
import org.gvsig.fmap.dal.feature.EditableFeature;
28
import org.gvsig.fmap.dal.feature.EditableFeatureType;
29
import org.gvsig.fmap.dal.feature.FeatureStore;
30
import org.gvsig.tools.ToolsLocator;
31
import org.gvsig.tools.dynobject.DynObject;
32
import org.gvsig.tools.exception.BaseException;
33
import org.gvsig.tools.i18n.I18nManager;
34

  
35
import org.slf4j.Logger;
36
import org.slf4j.LoggerFactory;
37

  
38
public class ProvinciasFactory extends WSObjectsFactory{
39

  
40
    private static final Logger logger = LoggerFactory
41
        .getLogger(ProvinciasFactory.class);
42

  
43
    private final static String PROVINCIAS_FILENAME="provincias.dbf";
44

  
45

  
46
    public ProvinciasFactory(BusquedaCatastralManager manager){
47
        super(manager);
48
    }
49

  
50
    private Provinciero provinciero=null;
51
    public  List<DynObject> getProvincias() throws BusquedaCatastralException{
52
        //TODO
53
        //1.-Ver si existe fichero en tmp
54
        //2.- Si no existe
55
        //  2.1.- consulta web para obtener provinciero
56
        //  2.2.- generar archivo a partir de provinciero
57
        //3.-Leer fichero con listado de provincias
58
        //  3.1.- Por cada registro en provincia, construir un DynObject
59
        //4.-Devolver listado de DynObject
60

  
61
        File provinciasFile=null;
62

  
63
        try {
64
            provinciasFile = new File(manager.getCacheFolder(),PROVINCIAS_FILENAME);
65
            if (!provinciasFile.exists()){
66
                createDBF(provinciasFile);
67
            }
68
            return this.getListFromDBF(provinciasFile);
69
        } catch ( BusquedaCatastralException e) {
70
            throw e;
71
        } catch ( Exception e) {
72
            logger.warn("Error getting provincias from file '"+provinciasFile.getAbsolutePath()+"'.",e);
73
            throw new BusquedaCatastralGettingParamsException(e);
74
        }
75
    }
76

  
77

  
78
    @Override
79
    protected void defineType(EditableFeatureType type) throws BusquedaCatastralException {
80
        provinciero=getProvinciero();
81
        int maxNombre=0;
82
        int maxCodigo=0;
83
        for(Prov prov:provinciero.getProv()){
84
            if(StringUtils.isNotEmpty(prov.getNp()) && prov.getNp().length()>maxNombre){
85
                maxNombre=prov.getNp().length();
86
            }
87
            if(StringUtils.isNotEmpty(prov.getCpine()) && prov.getCpine().length()>maxCodigo){
88
                maxCodigo=prov.getCpine().length();
89
            }
90
        }
91
        type.add(BusquedaCatastralManager.CAMPO_PROVINCIA_NOMBRE, DataTypes.STRING,
92
            maxNombre);
93
        type.add(BusquedaCatastralManager.CAMPO_PROVINCIA_CODIGO, DataTypes.STRING,
94
            maxCodigo);
95
    }
96

  
97
    @Override
98
    protected void writeFileData(FeatureStore featureStore) throws DataException, BusquedaCatastralException {
99
        provinciero=getProvinciero();
100
        for(Prov prov:provinciero.getProv()){
101
            EditableFeature ef;
102
            ef = featureStore.createNewFeature().getEditable();
103
            ef.set(BusquedaCatastralManager.CAMPO_PROVINCIA_NOMBRE, prov.getNp());
104
            ef.set(BusquedaCatastralManager.CAMPO_PROVINCIA_CODIGO, prov.getCpine());
105
            featureStore.insert(ef);
106
        }
107
        provinciero = null;
108
    }
109

  
110
    private Provinciero getProvinciero() throws BusquedaCatastralException{
111
        if( provinciero == null ) {
112
            try {
113
                ProvinciasWSResponse provincias = getCatastroWS().obtenerProvincias();
114
                if (provincias!=null){
115
                    MessageElement[] any = provincias.get_any();
116
                    MessageElement me=any[0];
117
                    JAXBContext jaxbContext = JAXBContext.newInstance(ConsultaProvincieror.class);
118

  
119
                    Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
120
                    InputStream input = new ByteArrayInputStream(me.getAsString().getBytes());
121
                    ConsultaProvincieror cp = (ConsultaProvincieror) jaxbUnmarshaller.unmarshal(input);
122

  
123
                    if (cp!=null && cp.getLerr()!=null){
124
                        webserviceErrors(cp.getLerr().getErr());
125
                    }
126

  
127
                    provinciero =  cp.getProvinciero();
128
                }else{
129
                    logger.error("Webservice response is empty");
130
                    I18nManager i18nManager = ToolsLocator.getI18nManager();
131
                    throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_reading_response_from_ws"),null);
132
                }
133

  
134
            } catch (BusquedaCatastralRemoteServiceException e) {
135
                logger.error("Error accesing webservice",e);
136
                I18nManager i18nManager = ToolsLocator.getI18nManager();
137
                throw e;
138
            } catch (RemoteException e) {
139
                logger.error("Error marshalling response from webservice",e);
140
                I18nManager i18nManager = ToolsLocator.getI18nManager();
141
                throw new BusquedaCatastralRemoteServiceException(i18nManager.getTranslation("_error_reading_response_from_ws"), e);
142
            } catch (Exception e) {
143
                logger.error("Error marshalling response from webservice",e);
144
                I18nManager i18nManager = ToolsLocator.getI18nManager();
145
                throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_reading_response_from_ws"), e);
146
            }
147
        }
148
        return provinciero;
149
    }
150

  
151

  
152
    @Override
153
    protected String getExpressionQuery() {
154
        return null;
155
    }
156

  
157

  
158
}
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.188/org.gvsig.busquedacatastral.lib/org.gvsig.busquedacatastral.lib.impl/src/main/java/org/gvsig/busquedacatastral/lib/impl/ReferenciasCatastralesFactory.java
1
package org.gvsig.busquedacatastral.lib.impl;
2

  
3
import java.io.ByteArrayInputStream;
4
import java.io.InputStream;
5
import java.rmi.RemoteException;
6
import java.util.ArrayList;
7
import java.util.HashSet;
8
import java.util.List;
9
import java.util.Set;
10

  
11
import javax.xml.bind.JAXBContext;
12
import javax.xml.bind.Unmarshaller;
13

  
14
import org.apache.axis.message.MessageElement;
15
import org.apache.commons.lang3.StringUtils;
16

  
17
import org.gvsig.busquedacatastral.lib.api.BusquedaCatastralManager;
18
import org.gvsig.busquedacatastral.lib.api.QueryCatastral;
19
import org.gvsig.busquedacatastral.lib.api.QueryCatastral.TipoParcela;
20
import org.gvsig.busquedacatastral.lib.api.QueryCatastral.TipoQuery;
21
import org.gvsig.busquedacatastral.lib.api.ReferenciaCatastral;
22
import org.gvsig.busquedacatastral.lib.api.TipoVia;
23
import org.gvsig.busquedacatastral.lib.api.exceptions.BusquedaCatastralException;
24
import org.gvsig.busquedacatastral.lib.api.exceptions.BusquedaCatastralGettingParamsException;
25
import org.gvsig.busquedacatastral.lib.api.exceptions.BusquedaCatastralRemoteServiceException;
26
import org.gvsig.busquedacatastral.lib.impl.ws.classes.ConsultaDNPPPWSResponse;
27
import org.gvsig.busquedacatastral.lib.impl.ws.classes.ConsultaDNPWSResponse;
28
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.Bico;
29
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.ConsultaDnp;
30
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.Dt;
31
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.Lors;
32
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.Lorus;
33
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.Lourb;
34
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.Lous;
35
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.Lrcdnp;
36
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.Rc;
37
import org.gvsig.busquedacatastral.lib.impl.ws.classes.cxf.Rcdnp;
38
import org.gvsig.fmap.dal.exception.DataException;
39
import org.gvsig.fmap.dal.feature.EditableFeatureType;
40
import org.gvsig.fmap.dal.feature.FeatureStore;
41
import org.gvsig.tools.ToolsLocator;
42
import org.gvsig.tools.dynobject.DynObject;
43
import org.gvsig.tools.i18n.I18nManager;
44

  
45
import org.slf4j.Logger;
46
import org.slf4j.LoggerFactory;
47

  
48
public class ReferenciasCatastralesFactory extends WSObjectsFactory{
49

  
50
    private static final Logger logger = LoggerFactory
51
        .getLogger(ReferenciasCatastralesFactory.class);
52

  
53

  
54
    public ReferenciasCatastralesFactory(BusquedaCatastralManager manager){
55
        super(manager);
56
    }
57

  
58

  
59
    public List<ReferenciaCatastral> getReferencias(QueryCatastral query) throws BusquedaCatastralException{
60
        ConsultaDnp consultaDatosNoPrivados=null;
61

  
62
        if (query==null){
63
            logger.error("Query no valida");
64
            I18nManager i18nManager = ToolsLocator.getI18nManager();
65
            throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_invalid_query"), null);
66
        }else{
67
            if ( TipoQuery.POR_RC.equals(query.getTipoQuery()) ){
68
                consultaDatosNoPrivados =getReferenciasByRC(query.getReferenciaCatastral());
69
            }else if( TipoQuery.POR_LOCALIZACION.equals(query.getTipoQuery()) ){
70
                if (TipoParcela.URBANA.equals(query.getTipoParcela())){
71
                    consultaDatosNoPrivados =getReferenciasUrbanas(query);
72
                }else if (TipoParcela.RUSTICA.equals(query.getTipoParcela())){
73
                    consultaDatosNoPrivados =getReferenciasRusticas(query);
74
                }else{
75
                    logger.error("Tipo parcela invalido");
76
                    I18nManager i18nManager = ToolsLocator.getI18nManager();
77
                    throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_tipo_parcela_not_informed"), null);
78
                }
79
            } else{
80
                logger.error("Tipo query invalido");
81
                I18nManager i18nManager = ToolsLocator.getI18nManager();
82
                throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_tipo_query_not_informed"), null);
83
            }
84

  
85
            if (consultaDatosNoPrivados!=null && consultaDatosNoPrivados.getLerr()!=null){
86
                webserviceErrors(consultaDatosNoPrivados.getLerr().getErr());
87
            }
88

  
89
            return  new ArrayList( createReferenciasCatastrales( consultaDatosNoPrivados) );
90

  
91
        }
92
    }
93

  
94
    private Set<ReferenciaCatastral> createReferenciasCatastrales(ConsultaDnp consultaDatosNoPrivados){
95
        Set<ReferenciaCatastral> results=new HashSet<ReferenciaCatastral>();
96
        if ( consultaDatosNoPrivados.getLrcdnp()!=null ){
97
            getReferenciasCatastralesFrom(consultaDatosNoPrivados.getLrcdnp());
98
            results.addAll( getReferenciasCatastralesFrom(consultaDatosNoPrivados.getLrcdnp()) );
99
        }
100
        if ( consultaDatosNoPrivados.getBico()!=null ){
101
            DefaultReferenciaCatastral refCatastral=getReferenciaCatastralFrom(consultaDatosNoPrivados.getBico());
102
            if (refCatastral!=null){
103
                results.add(refCatastral);
104
            }
105
        }
106
        return results;
107
    }
108

  
109
    private DefaultReferenciaCatastral getReferenciaCatastralFrom(Bico bico){
110
        if ( bico!=null ){
111
            DefaultReferenciaCatastral refCatastral=new DefaultReferenciaCatastral();
112
            if (bico.getBi()!=null){
113
                if( bico.getBi().getIdbi()!=null ){
114
                    fillReferenciaCatastralFrom(bico.getBi().getIdbi().getRc(), refCatastral);
115
                }
116
                if ( bico.getBi().getDt()!=null ){
117
                    fillReferenciaCatastralFrom(bico.getBi().getDt(), refCatastral);
118
                }
119
            }
120
            return refCatastral;
121
        }else{
122
            return null;
123
        }
124
    }
125

  
126
    private Set<ReferenciaCatastral> getReferenciasCatastralesFrom(Lrcdnp lrcdnp){
127
        Set<ReferenciaCatastral> results=new HashSet<ReferenciaCatastral>();
128
        for ( Rcdnp rcdnp:lrcdnp.getRcdnp()){
129
            if(rcdnp!=null){
130
                DefaultReferenciaCatastral refCatastral=new DefaultReferenciaCatastral();
131
                if (rcdnp.getRc()!=null){
132
                    fillReferenciaCatastralFrom(rcdnp.getRc(), refCatastral);
133
                }
134
                if (rcdnp.getDt()!=null){
135
                    fillReferenciaCatastralFrom(rcdnp.getDt(), refCatastral);
136
                }
137
            results.add(refCatastral);
138
            }
139
        }
140
        return results;
141
    }
142

  
143
    private void fillReferenciaCatastralFrom(Rc rc, DefaultReferenciaCatastral refCatastral){
144
        if (rc!=null){
145
            refCatastral.setPc1(rc.getPc1());
146
            refCatastral.setPc2(rc.getPc2());
147
            refCatastral.setCar(rc.getCar());
148
            refCatastral.setDc1(rc.getCc1());
149
            refCatastral.setDc2(rc.getCc2());
150
        }
151
    }
152

  
153
    private void fillReferenciaCatastralFrom(Dt dt, DefaultReferenciaCatastral refCatastral){
154
        if (dt!=null){
155
            refCatastral.setProvincia(dt.getNp());
156
            refCatastral.setMunicipio(dt.getNm());
157
            if (dt.getLocs()!=null){
158
                if (dt.getLocs().getLous()!=null){
159
                    Lous lous=dt.getLocs().getLous();
160
                    if (lous.getLourb()!=null){
161
                        //Urbana
162
                        Lourb lourb=lous.getLourb();
163
                        fillReferenciaCatastralFrom(lourb, refCatastral);
164
                    }
165
                    if(lous.getLorus()!=null && lous.getLorus().getCpp()!=null){
166
                        Lorus lorus=lous.getLorus();
167
                        fillReferenciaCatastralFrom(lorus, refCatastral);;
168
                    }
169
                }
170
                if (dt.getLocs().getLors()!=null){
171
                    Lors lors=dt.getLocs().getLors();
172
                    if (lors.getLourb()!=null){
173
                        //Urbana
174
                        Lourb lourb=lors.getLourb();
175
                        fillReferenciaCatastralFrom(lourb, refCatastral);
176
                    }
177
                    if(lors.getLorus()!=null && lors.getLorus().getCpp()!=null){
178
                        Lorus lorus=lors.getLorus();
179
                        fillReferenciaCatastralFrom(lorus, refCatastral);
180
                    }
181
                }
182
            }
183
        }
184
    }
185

  
186
    private void fillReferenciaCatastralFrom(Lorus lorus, DefaultReferenciaCatastral refCatastral){
187
        if(lorus!=null && lorus.getCpp()!=null){
188
            refCatastral.setPoligono(lorus.getCpp().getCpo());
189
            refCatastral.setParcela(lorus.getCpp().getCpa());
190
            refCatastral.setParaje(lorus.getNpa());
191
        }
192
    }
193

  
194
    private void fillReferenciaCatastralFrom(Lourb lourb, DefaultReferenciaCatastral refCatastral){
195
        if (lourb.getDir()!=null){
196
            if (lourb.getDir().getTv()!=null){
197
                TipoVia tipoVia=TipoVia.getTipoViaByAbrev(lourb.getDir().getTv());
198
                refCatastral.setTipoVia(tipoVia);
199
            }
200
            refCatastral.setVia(lourb.getDir().getNv());
201
            refCatastral.setPatio(lourb.getDir().getPnp());
202
            refCatastral.setKm(lourb.getDir().getKm());
203
            if (lourb.getLoint()!=null){
204
                refCatastral.setBloque(lourb.getLoint().getBq());
205
                refCatastral.setEscalera(lourb.getLoint().getEs());
206
                refCatastral.setPlanta(lourb.getLoint().getPt());
207
                refCatastral.setPuerta(lourb.getLoint().getPu());
208
            }
209
        }
210
    }
211

  
212

  
213
    private ConsultaDnp getReferenciasByRC(String rc) throws BusquedaCatastralException{
214
        try {
215
             ConsultaDNPWSResponse dnpResponse = getCatastroWS().
216
                 consulta_DNPRC("", "", rc);
217
            if (dnpResponse!=null){
218
                MessageElement[] any = dnpResponse.get_any();
219
                MessageElement me=any[0];
220
                JAXBContext jaxbContext = JAXBContext.newInstance(ConsultaDnp.class);
221

  
222
                Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
223
                InputStream input = new ByteArrayInputStream(me.getAsString().getBytes());
224
                ConsultaDnp cdnp = (ConsultaDnp) jaxbUnmarshaller.unmarshal(input);
225

  
226
                return cdnp;
227
            }else{
228
                logger.error("Webservice response is empty");
229
                I18nManager i18nManager = ToolsLocator.getI18nManager();
230
                throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_reading_response_from_ws"),null);
231
            }
232

  
233
        } catch (RemoteException e) {
234
            logger.error("Error accesing webservice",e);
235
            I18nManager i18nManager = ToolsLocator.getI18nManager();
236
            throw new BusquedaCatastralRemoteServiceException(i18nManager.getTranslation("_error_obtaining_catastro_webservice"), e);
237
        } catch (Exception e) {
238
            logger.error("Error marshalling response from webservice",e);
239
            I18nManager i18nManager = ToolsLocator.getI18nManager();
240
            throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_reading_response_from_ws"), e);
241
        }
242

  
243
    }
244

  
245
    private ConsultaDnp getReferenciasUrbanas(QueryCatastral query) throws BusquedaCatastralException{
246
        validateQueryUrbana(query);
247
        try {
248
            DynObject provincia=query.getProvincia();
249
            DynObject municipio=query.getMunicipio();
250
            DynObject via=query.getVia();
251
            String nombreProvincia=(String) provincia.getDynValue(BusquedaCatastralManager.CAMPO_PROVINCIA_NOMBRE);
252
            String nombreMunicipio=(String) municipio.getDynValue(BusquedaCatastralManager.CAMPO_MUNICIPIO_NOMBRE);
253
            String tipoViaAbrev=query.getTipoVia().getAbrev();
254
            String nombreVia=(String)via.getDynValue(BusquedaCatastralManager.CAMPO_VIA_NOMBRE);
255

  
256
            ConsultaDNPWSResponse dnpResponse = getCatastroWS().
257
                 consulta_DNPLOC(nombreProvincia, nombreMunicipio, tipoViaAbrev, nombreVia,
258
                     query.getNumero(), query.getBloque(), query.getEscalera(), query.getPlanta(), query.getPuerta());
259
            if (dnpResponse!=null){
260
                MessageElement[] any = dnpResponse.get_any();
261
                MessageElement me=any[0];
262
                JAXBContext jaxbContext = JAXBContext.newInstance(ConsultaDnp.class);
263

  
264
                Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
265
                InputStream input = new ByteArrayInputStream(me.getAsString().getBytes());
266
                ConsultaDnp cdnp = (ConsultaDnp) jaxbUnmarshaller.unmarshal(input);
267

  
268
                return cdnp;
269
            }else{
270
                logger.error("Webservice response is empty");
271
                I18nManager i18nManager = ToolsLocator.getI18nManager();
272
                throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_reading_response_from_ws"),null);
273
            }
274

  
275
        } catch (RemoteException e) {
276
            logger.error("Error accesing webservice",e);
277
            I18nManager i18nManager = ToolsLocator.getI18nManager();
278
            throw new BusquedaCatastralRemoteServiceException(i18nManager.getTranslation("_error_obtaining_catastro_webservice"), e);
279
        } catch (Exception e) {
280
            logger.error("Error marshalling response from webservice",e);
281
            I18nManager i18nManager = ToolsLocator.getI18nManager();
282
            throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_reading_response_from_ws"), e);
283
        }
284
    }
285

  
286

  
287
    private ConsultaDnp getReferenciasRusticas(QueryCatastral query) throws BusquedaCatastralException{
288
        validateQueryRustica(query);
289
        try {
290
            DynObject provincia=query.getProvincia();
291
            DynObject municipio=query.getMunicipio();
292
            String nombreProvincia=(String) provincia.getDynValue(BusquedaCatastralManager.CAMPO_PROVINCIA_NOMBRE);
293
            String nombreMunicipio=(String) municipio.getDynValue(BusquedaCatastralManager.CAMPO_MUNICIPIO_NOMBRE);
294

  
295

  
296
            ConsultaDNPPPWSResponse dnpResponse = getCatastroWS().
297
                 consulta_DNPPP(nombreProvincia, nombreMunicipio, query.getPoligono(), query.getParcela());
298
            if (dnpResponse!=null){
299
                MessageElement[] any = dnpResponse.get_any();
300
                MessageElement me=any[0];
301
                JAXBContext jaxbContext = JAXBContext.newInstance(ConsultaDnp.class);
302

  
303
                Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
304
                InputStream input = new ByteArrayInputStream(me.getAsString().getBytes());
305
                ConsultaDnp cdnp = (ConsultaDnp) jaxbUnmarshaller.unmarshal(input);
306

  
307
                return cdnp;
308
            }else{
309
                logger.error("Webservice response is empty");
310
                I18nManager i18nManager = ToolsLocator.getI18nManager();
311
                throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_reading_response_from_ws"),null);
312
            }
313

  
314
        } catch (RemoteException e) {
315
            logger.error("Error accesing webservice",e);
316
            I18nManager i18nManager = ToolsLocator.getI18nManager();
317
            throw new BusquedaCatastralRemoteServiceException(i18nManager.getTranslation("_error_obtaining_catastro_webservice"), e);
318
        } catch (Exception e) {
319
            logger.error("Error marshalling response from webservice",e);
320
            I18nManager i18nManager = ToolsLocator.getI18nManager();
321
            throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_reading_response_from_ws"), e);
322
        }
323
    }
324

  
325

  
326
    private void validateQueryUrbana(QueryCatastral query) throws BusquedaCatastralException{
327
        if (query.getProvincia()==null){
328
            logger.error("Provincia no informada");
329
            I18nManager i18nManager = ToolsLocator.getI18nManager();
330
            throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_provincia_not_informed"), null);
331
        }
332
        if (query.getMunicipio()==null){
333
            logger.error("Municipio no informado");
334
            I18nManager i18nManager = ToolsLocator.getI18nManager();
335
            throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_municipio_not_informed"), null);
336
        }
337
        if (query.getTipoVia()==null){
338
            logger.error("Tipo Via no informado");
339
            I18nManager i18nManager = ToolsLocator.getI18nManager();
340
            throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_tipo_via_not_informed"), null);
341
        }
342
        if (query.getVia()==null){
343
            logger.error("Via no informado");
344
            I18nManager i18nManager = ToolsLocator.getI18nManager();
345
            throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_via_not_informed"), null);
346
        }
347
        if (query.getNumero()==null){
348
            logger.error("Numero no informado");
349
            I18nManager i18nManager = ToolsLocator.getI18nManager();
350
            throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_numero_not_informed"), null);
351
        }
352
    }
353

  
354

  
355
    private void validateQueryRustica(QueryCatastral query) throws BusquedaCatastralException{
356
        if (query.getProvincia()==null){
357
            logger.error("Provincia no informada");
358
            I18nManager i18nManager = ToolsLocator.getI18nManager();
359
            throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_provincia_not_informed"), null);
360
        }
361
        if (query.getMunicipio()==null){
362
            logger.error("Municipio no informado");
363
            I18nManager i18nManager = ToolsLocator.getI18nManager();
364
            throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_municipio_not_informed"), null);
365
        }
366
        if (query.getPoligono()==null){
367
            logger.error("Poligono no informado");
368
            I18nManager i18nManager = ToolsLocator.getI18nManager();
369
            throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_poligono_not_informed"), null);
370
        }
371
        if (query.getParcela()==null){
372
            logger.error("Municipio no informado");
373
            I18nManager i18nManager = ToolsLocator.getI18nManager();
374
            throw new BusquedaCatastralGettingParamsException(i18nManager.getTranslation("_error_parcela_not_informed"), null);
375
        }
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff