diff --git a/addons/cadastrapp/js/searchParcelleByRef.js b/addons/cadastrapp/js/searchParcelleByRef.js
index 82f7ee5d..668bd11e 100644
--- a/addons/cadastrapp/js/searchParcelleByRef.js
+++ b/addons/cadastrapp/js/searchParcelleByRef.js
@@ -542,21 +542,61 @@ GEOR.Addons.Cadastre.initRechercheParcelle = function() {
} else if (currentForm.id == 'parcForthForm') {
// Recherche parcelle par fichier
if (currentForm.getForm().findField('filePath').value != undefined && currentForm.getForm().findField('filePath').value.length > 2) {
-
+
+ // Message de chargement
+ var box = Ext.MessageBox.wait("Lecture du document...",OpenLayers.i18n('Chargement'));
+
+ // Titre de l'onglet resultat
var resultTitle = OpenLayers.i18n('cadastrapp.result.title.fichier');
+
+ // LECTURE CSV
+ var files = document.getElementById("parcForthForm").querySelectorAll("input[type=file]")[0].files;
+
+ function readFile (blob, callback){
+ var reader = new FileReader();
+ reader.onload = callback;
+ reader.readAsText(blob);
+ }
- // sousmet le form (pour envoyer le fichier)
- currentForm.getForm().submit({
- url : GEOR.Addons.Cadastre.cadastrappWebappUrl + 'fromParcellesFile',
- params : {},
- success : function(form, action) {
- GEOR.Addons.Cadastre.addNewResultParcelle(resultTitle, GEOR.Addons.Cadastre.getResultParcelleStore(action.response.responseText, true));
- },
- failure : function(form, action) {
- alert('ERROR');
- }
+ // read content
+ readFile(files[0], function(e){
+
+ if (typeof(e.target.result) == "string"){
+
+ var content = JSON.stringify(e.target.result);
+ content = JSON.parse(content);
+ // Separateurs: virgule, point virgule, pipe, espace et retour à la ligne
+ content = content.split(/\r\n|\n|,|;|\|/);
+
+ // Filtre pour ne garder que ce qui ressemble a un identifiant de parcelle
+ // et ne garder qu'une occurence de chaque identifiant
+ var parcellesFromFile = content.filter(function (value, index, self) {
+ return (self.indexOf(value) === index && value.length >= 8 && value.match("^[0-9]{5,}.*"));
+ });
+
+ // Envoie la liste de compte communal extraite du fichier
+ Ext.Ajax.request({
+ method : 'POST',
+ url : GEOR.Addons.Cadastre.url.serviceParcelle,
+ params : { parcelle : parcellesFromFile},
+ success : function(result) {
+ box.hide();
+ GEOR.Addons.Cadastre.addNewResultParcelle(resultTitle, GEOR.Addons.Cadastre.getResultParcelleStore(result.responseText, false));
+ },
+ failure : function(form, action) {
+ box.hide();
+ alert('ERROR');
+ }
+ });
+ }else{
+ box.hide();
+ alert('Mauvais type de fichier');
+ }
});
- } else {
+
+ }
+
+ else {
//TITRE de l'onglet resultat
var resultTitle = "Recherche par lot";
diff --git a/cadastrapp/README.md b/cadastrapp/README.md
index 1c713157..777a30df 100644
--- a/cadastrapp/README.md
+++ b/cadastrapp/README.md
@@ -16,18 +16,18 @@ This application is made to be installed behind GeOrchestra security proxy. To i
-- As for gerochestra tomcat instance, you will have to create a new instance
(choose a port not already use here we choose 8480 for http endpoint and 8405 to stop
```
- sudo tomcat6-instance-create -p 8480 -c 8405 /var/lib/tomcat-cadastrapp
+ sudo tomcat9-instance-create -p 8480 -c 8405 /var/lib/tomcat-cadastrapp
```
### Init policy and service
sudo mkdir /var/lib/tomcat-cadastrapp/conf/policy.d
sudo touch /var/lib/tomcat-cadastrapp/conf/policy.d/empty.policy
- sudo chown -R tomcat6:tomcat6 /var/lib/tomcat-cadastrapp
- sudo cp /etc/init.d/tomcat6 /etc/init.d/tomcat-cadastrapp
- sudo cp /etc/default/tomcat6 /etc/default/tomcat-cadastrapp
+ sudo chown -R tomcat:tomcat /var/lib/tomcat-cadastrapp
+ sudo cp /etc/init.d/tomcat9 /etc/init.d/tomcat-cadastrapp
+ sudo cp /etc/default/tomcat9 /etc/default/tomcat-cadastrapp
Finally, edit the ```/etc/init.d/tomcat-cadastrapp``` script, find the following line:
```
-# Provides: tomcat6
+# Provides: tomcat9
```
... and replace it with:
```
@@ -44,12 +44,12 @@ JAVA_OPTS="-Djava.awt.headless=true -XX:+UseConcMarkSweepGC"
And later add these lines (change the ```STOREPASSWORD``` string):
```
JAVA_OPTS="$JAVA_OPTS \
- -Xms1024m \
+ -Xms256m \
-Xmx1024m \
-XX:MaxPermSize=256m"
JAVA_OPTS="$JAVA_OPTS \
- -Djavax.net.ssl.trustStore=/etc/tomcat6/keystore \
+ -Djavax.net.ssl.trustStore=/etc/georchestra/keystore \
-Djavax.net.ssl.trustStorePassword=STOREPASSWORD"
```
### Configure connectors
@@ -86,7 +86,7 @@ In ```/var/lib/tomcat-cadastrapp/conf/context.xml```, add a new ResourceLink at
#### Add jar require for this datasource
To be able to connect to postgresql database, tomcat will have to get postgresql client librairie in his classloader.
-In tomcat6 instance, you will have to add ```postgresql-9.1-901-1.jdbc4.jar``` to ```/var/lib/tomcat-cadastrapp/lib``` folder (with a symlink)
+In tomcat9 instance, you will have to add ```postgresql-42.2.22.jar``` to ```/var/lib/tomcat-cadastrapp/lib``` folder (with a symlink)
### Start the instance
diff --git a/cadastrapp/pom.xml b/cadastrapp/pom.xml
index 93698b91..5e137da2 100644
--- a/cadastrapp/pom.xml
+++ b/cadastrapp/pom.xml
@@ -12,18 +12,18 @@
Web application for cadastre management over Georchestra
UTF-8
- 1.8.6
- 1.7.25
- 1.2.3
+ 2.12.3
+ 1.7.30
+ 1.2.7
1.7.25
- 9.4-1205-jdbc4
- 3.0.4
- 4.3.24.RELEASE
- 4.1.7.Final
- 4.0.1.Final
- 9.2
- 2.0.17
- 2.3.0
+ 42.3.1
+ 5.3.9
+ 6.0.0.Alpha7
+ 5.1.2.Final
+ 25.2
+ 3.0.0-RC1
+ 2.3.2
+ 2.10.5
@@ -52,28 +52,8 @@
- org.apache.cxf
- cxf-rt-frontend-jaxrs
- ${cxf.version}
-
-
- org.apache.cxf
- cxf-rt-rs-client
- ${cxf.version}
-
-
- org.codehaus.jackson
- jackson-core-asl
- ${jackson.version}
-
-
- org.codehaus.jackson
- jackson-mapper-asl
- ${jackson.version}
-
-
- org.codehaus.jackson
- jackson-jaxrs
+ com.fasterxml.jackson.core
+ jackson-databind
${jackson.version}
@@ -92,6 +72,11 @@
spring-web
${spring.version}
+
+ org.springframework
+ spring-webmvc
+ ${spring.version}
+
org.springframework
@@ -106,7 +91,7 @@
org.springframework.data
spring-data-jpa
- 1.11.22.RELEASE
+ 2.5.4
@@ -116,7 +101,7 @@
- org.hibernate
+ org.hibernate.orm
hibernate-core
${hibernate-version}
compile
@@ -144,7 +129,7 @@
- org.hibernate
+ org.hibernate.orm
hibernate-entitymanager
${hibernate-version}
compile
@@ -180,7 +165,7 @@
- org.hibernate
+ org.hibernate.orm
hibernate-ehcache
${hibernate-version}
compile
@@ -228,28 +213,23 @@
org.apache.commons
commons-lang3
- 3.6
+ 3.11
org.apache.xmlgraphics
fop
- 2.3
-
-
- net.sf.supercsv
- super-csv
- 2.4.0
-
-
- net.sf.supercsv
- super-csv-dozer
- 2.4.0
-
+ 2.6
+
- org.geotools
- gt-render
- ${geotools.version}
+ net.sf.supercsv
+ super-csv
+ 2.4.0
+
+
+ net.sf.supercsv
+ super-csv-dozer
+ 2.4.0
org.geotools
@@ -261,6 +241,11 @@
gt-wms
${geotools.version}
+
+ org.geotools
+ gt-http
+ ${geotools.version}
+
org.geotools
gt-wfs-ng
@@ -281,7 +266,7 @@
junit
junit
- 4.12
+ 4.13.1
test
@@ -300,13 +285,29 @@
provided
javax.servlet
javax.servlet-api
- 3.0.1
+ 3.1.0
org.apache.pdfbox
pdfbox
${pdfbox.version}
+
+
+ io.springfox
+ springfox-swagger2
+ ${springfox.version}
+
+
+ io.springfox
+ springfox-swagger-ui
+ ${springfox.version}
+
+
+ io.springfox
+ springfox-spring-webmvc
+ ${springfox.version}
+
@@ -339,7 +340,7 @@
org.eclipse.jetty
jetty-maven-plugin
- 9.2.11.v20150529
+ 9.4.41.v20210516
/cadastrapp/
@@ -360,56 +361,23 @@
org.apache.maven.plugins
maven-javadoc-plugin
2.10.3
-
-
-
- org.apache.cxf
- cxf-java2wadl-plugin
- 3.0.0
-
-
-
org.apache.maven.plugins
maven-compiler-plugin
-
- 1.7
+
+ 1.8
- org.apache.maven.plugins
- maven-war-plugin
- 3.2.3
-
-
-
- target/site
-
-
- target/generated
- apidocs
-
-
-
-
+ maven-dependency-plugin
+ 3.1.2
+
-
- maven-javadoc-plugin
-
-
- build-javadocs
- generate-sources
-
- javadoc
-
-
-
-
-
+
org.codehaus.mojo
exec-maven-plugin
1.6.0
@@ -452,7 +420,7 @@
maven-assembly-plugin
- 3.2.0
+ 3.3.0
addon-assembly.xml
@@ -468,52 +436,10 @@
-
- org.apache.cxf
- cxf-java2wadl-plugin
- ${cxf.version}
-
-
-
- parsejavadoc
- generate-sources
-
- parsejavadoc
-
-
-
- process-classes
- process-classes
-
- java2wadl
-
-
-
- org.georchestra.cadastrapp.service.BatimentController
- org.georchestra.cadastrapp.service.CommuneController
- org.georchestra.cadastrapp.service.ParcelleController
- org.georchestra.cadastrapp.service.ProprietaireController
- org.georchestra.cadastrapp.service.CoProprietaireController
- org.georchestra.cadastrapp.service.SectionController
- org.georchestra.cadastrapp.service.InfoBulleController
- org.georchestra.cadastrapp.service.UniteCadastraleController
- org.georchestra.cadastrapp.service.VoieController
- org.georchestra.cadastrapp.service.pdf.BordereauParcellaireController
- org.georchestra.cadastrapp.service.pdf.ReleveProprieteController
- org.georchestra.cadastrapp.service.pdf.DemandeController
- org.georchestra.cadastrapp.service.DatadirController
-
- org.apache.cxf.maven_plugin.javatowadl.ResourceMapJavaDocProvider
- true
-
-
-
-
pl.project13.maven
git-commit-id-plugin
- 3.0.1
+ 4.0.3
@@ -597,7 +523,7 @@
org.apache.maven.plugins
maven-antrun-plugin
- 1.7
+ 3.0.0
set-project-packageversion
@@ -656,57 +582,6 @@
-
- rpmPackage
-
-
-
- org.apache.maven.plugins
- maven-war-plugin
-
-
- org.codehaus.mojo
- rpm-maven-plugin
- 2.1.3
-
-
- generate-rpm
-
- rpm
-
-
-
-
- georchestra-${project.artifactId}
- UTF-8
- Applications/Internet
- ${rpm.gpg.key}
-
-
- /usr/share/lib/georchestra-${project.artifactId}
-
-
-
-
-
- /
-
-
-
-
-
-
-
-
-
-
docker
@@ -719,7 +594,7 @@
com.spotify
docker-maven-plugin
- 0.3.8
+ 1.2.2
${dockerImageName}
${project.basedir}/src/docker
@@ -739,7 +614,7 @@
com.google.guava
guava
- 19.0
+ 30.1.1-jre
diff --git a/cadastrapp/src/main/java/org/georchestra/cadastrapp/configuration/CadastrappPlaceHolder.java b/cadastrapp/src/main/java/org/georchestra/cadastrapp/configuration/CadastrappPlaceHolder.java
index 7389e625..b67a78ee 100644
--- a/cadastrapp/src/main/java/org/georchestra/cadastrapp/configuration/CadastrappPlaceHolder.java
+++ b/cadastrapp/src/main/java/org/georchestra/cadastrapp/configuration/CadastrappPlaceHolder.java
@@ -10,7 +10,13 @@
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
-
+/**
+ *
+ * CadastrappPlaceHolder
+ *
+ * @author Pierre Jégo / pierre.jego@jdev.fr
+ *
+ */
public class CadastrappPlaceHolder extends PropertyPlaceholderConfigurer {
private static Map propertiesMap;
diff --git a/cadastrapp/src/main/java/org/georchestra/cadastrapp/configuration/SwaggerConfig.java b/cadastrapp/src/main/java/org/georchestra/cadastrapp/configuration/SwaggerConfig.java
new file mode 100644
index 00000000..1947ef15
--- /dev/null
+++ b/cadastrapp/src/main/java/org/georchestra/cadastrapp/configuration/SwaggerConfig.java
@@ -0,0 +1,52 @@
+package org.georchestra.cadastrapp.configuration;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.PathProvider;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
+
+
+@Configuration
+@EnableSwagger2WebMvc
+public class SwaggerConfig {
+
+
+ @Bean
+ public Docket api() {
+
+
+ return new Docket(DocumentationType.SWAGGER_2)
+ .pathProvider(new PathProvider() {
+
+ // remvove duplicate cadastrapp entry in operation path
+ @Override
+ public String getOperationPath(String operationPath) {
+ return operationPath.replace("cadastrapp/", "");
+ }
+
+ @Override
+ public String getResourceListingPath(String groupName, String apiDeclaration) {
+ return null;
+ }
+ })
+ .select()
+ .apis(RequestHandlerSelectors.any())
+ .build()
+ .apiInfo(apiInfo());
+ }
+
+ private ApiInfo apiInfo() {
+ return new ApiInfoBuilder().title("geOrchestra Cadastrapp API").description("API to access to Majic and EDIGEO information").version("1.10")
+ .termsOfServiceUrl("https://docs.georchestra.org/cadastrapp/latest/")
+ .license("GNU General Public License v3.0")
+ .licenseUrl("https://github.com/georchestra/georchestra/blob/master/LICENSE.txt")
+ .build();
+ }
+
+}
diff --git a/cadastrapp/src/main/java/org/georchestra/cadastrapp/helper/BatimentHelper.java b/cadastrapp/src/main/java/org/georchestra/cadastrapp/helper/BatimentHelper.java
index 36d6b0b1..8eeeba3b 100644
--- a/cadastrapp/src/main/java/org/georchestra/cadastrapp/helper/BatimentHelper.java
+++ b/cadastrapp/src/main/java/org/georchestra/cadastrapp/helper/BatimentHelper.java
@@ -3,8 +3,6 @@
import java.util.List;
import java.util.Map;
-import javax.ws.rs.core.HttpHeaders;
-
import org.georchestra.cadastrapp.service.CadController;
import org.slf4j.Logger;
@@ -26,7 +24,7 @@ public final class BatimentHelper extends CadController {
*
* @return buildings information on this plot
*/
- public List