diff --git a/bin/deploy.sh b/bin/deploy.sh index 02bd92d572519e4582cc315b2e89a19756bd63a2..0a68132ce544bad27e071fe9b1e5beb83523f8da 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -42,7 +42,8 @@ echo_bold_green "Maven version..." mvn --version echo_bold_green "Packaging..." -mvn clean package +mvn clean install --projects=.,www-shared,www-client +mvn clean package --projects=www-server echo_bold_green "Deployment to $SERVER..." (cd www-server; mvn cargo:redeploy -Premote -Dcargo.server.settings=$SERVER) diff --git a/config/pmd-suppressions.properties b/config/pmd-suppressions.properties index d1c076e6ed2709b42de926ec8609ff7fe83a57fe..fd6a1ac8251caa2931ef48696753b0f785d067d9 100644 --- a/config/pmd-suppressions.properties +++ b/config/pmd-suppressions.properties @@ -1,2 +1,24 @@ # See https://maven.apache.org/plugins/maven-pmd-plugin/examples/violation-exclusions.html # annotations generate not clean code +fr.agrometinfo.www.shared.dto.IndicatorDTOBeanJsonDeserializerImpl=UnnecessaryImport +fr.agrometinfo.www.shared.dto.IndicatorDTOBeanJsonSerializerImpl=UnnecessaryImport +fr.agrometinfo.www.shared.dto.IndicatorDTO_MapperImpl=UnnecessaryImport +fr.agrometinfo.www.shared.dto.PeriodDTOBeanJsonDeserializerImpl=UnnecessaryImport +fr.agrometinfo.www.shared.dto.PeriodDTOBeanJsonSerializerImpl=UnnecessaryImport +fr.agrometinfo.www.shared.dto.PeriodDTO_MapperImpl=UnnecessaryImport +fr.agrometinfo.www.shared.service.IndicatorServiceFactory=UnnecessaryImport +org.geojson.FeatureBeanJsonDeserializerImpl=UnnecessaryImport +org.geojson.FeatureBeanJsonSerializerImpl=UnnecessaryImport +org.geojson.FeatureCollectionBeanJsonDeserializerImpl=UnnecessaryImport +org.geojson.FeatureCollectionBeanJsonSerializerImpl=UnnecessaryImport +org.geojson.FeatureCollection_MapperImpl=UnnecessaryImport +org.geojson.Feature_MapperImpl=UnnecessaryImport +org.geojson.GeoJsonObjectBeanJsonDeserializerImpl=UnnecessaryImport +org.geojson.LngLatAltBeanJsonDeserializerImpl=UnnecessaryImport +org.geojson.LngLatAltBeanJsonSerializerImpl=UnnecessaryImport +org.geojson.LngLatAlt_MapperImpl=UnnecessaryImport +org.geojson.PolygonBeanJsonDeserializerImpl=UnnecessaryImport +org.geojson.PolygonBeanJsonSerializerImpl=UnnecessaryImport +org.geojson.Polygon_MapperImpl=UnnecessaryImport +# wrong positive +fr.agrometinfo.www.server.dao.RegionDaoHibernate=UselessOverridingMethod diff --git a/pom.xml b/pom.xml index 57c6ed185f90f1fa34b28aedaa99c71d447b352d..2575832b73fe3e81b3b3a84e981bef3a792650ec 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>fr.agrometinfo</groupId> <artifactId>www</artifactId> - <version>0.1.1-SNAPSHOT</version> + <version>0.1.2-SNAPSHOT</version> <packaging>pom</packaging> <name>AgroMetInfo web app</name> <description>Website for AgroMetInfo in Jakarta EE 10 and GWT.</description> diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md index 0f5238c4a21fa2fbb3735deedf876d412e127f99..6fcaafe4193f0400f1ce4e2b7aa7bfaee89ef72d 100644 --- a/src/site/markdown/index.md +++ b/src/site/markdown/index.md @@ -40,8 +40,13 @@ psql -h localhost -U agrometinfo -d agrometinfo -1 -f init_data.postgresql.sql ``` 6. Grant permissions to SEASON ``` +GRANT USAGE ON SCHEMA agrometinfo TO season; GRANT SELECT ON TABLE indicator TO season; GRANT ALL ON TABLE dailyvalue TO season; +GRANT SELECT ON TABLE period TO season; +GRANT SELECT ON TABLE normalvalue TO season; +GRANT SELECT ON SEQUENCE dailyvalue_id_seq TO season; +GRANT ALL ON SEQUENCE dailyvalue_id_seq TO season; ``` ### Package diff --git a/www-client/pom.xml b/www-client/pom.xml index b6f847b27ab9d39f5c2af03d8cfc62516c57fcde..131a2a94ed763c6c70a2c3f3d3ffd9a2396bd7e2 100644 --- a/www-client/pom.xml +++ b/www-client/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>fr.agrometinfo</groupId> <artifactId>www</artifactId> - <version>0.1.1-SNAPSHOT</version> + <version>0.1.2-SNAPSHOT</version> </parent> <artifactId>www-client</artifactId> diff --git a/www-client/src/main/java/fr/agrometinfo/www/client/presenter/MapPresenter.java b/www-client/src/main/java/fr/agrometinfo/www/client/presenter/MapPresenter.java index 624aa99022714602a4dbb629a4c9c3b284e42854..e1fbf9a2b91a6f08c83b17f3462c762a13d9a054 100644 --- a/www-client/src/main/java/fr/agrometinfo/www/client/presenter/MapPresenter.java +++ b/www-client/src/main/java/fr/agrometinfo/www/client/presenter/MapPresenter.java @@ -21,6 +21,7 @@ import com.google.gwt.user.client.Random; import elemental2.dom.HTMLDivElement; import elemental2.dom.Node; import fr.agrometinfo.www.client.i18n.AppConstants; +import fr.agrometinfo.www.client.util.ApplicationUtils; import fr.agrometinfo.www.client.view.BaseView; import fr.agrometinfo.www.client.view.MapView; import fr.agrometinfo.www.shared.dto.ChoiceDTO; @@ -55,7 +56,7 @@ public final class MapPresenter implements Presenter { /** * URL to get indicator values. */ - private static final String VALUES_URL = GWT.getModuleBaseURL().replace("/app/", "") + "/rs/" + private static final String VALUES_URL = ApplicationUtils.getApplicationUrl() + "/rs/" + IndicatorService.PATH + "/" + IndicatorService.PATH_VALUES; /** diff --git a/www-client/src/main/java/fr/agrometinfo/www/client/util/ApplicationUtils.java b/www-client/src/main/java/fr/agrometinfo/www/client/util/ApplicationUtils.java index a281e7173583d3685ee5f8349999e832ac8f75f9..c85b6f62b06a1e9617244e9bb1e6cf664cbda4ac 100644 --- a/www-client/src/main/java/fr/agrometinfo/www/client/util/ApplicationUtils.java +++ b/www-client/src/main/java/fr/agrometinfo/www/client/util/ApplicationUtils.java @@ -3,6 +3,7 @@ package fr.agrometinfo.www.client.util; import java.util.HashMap; import java.util.Map; +import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.DOM; /** @@ -11,6 +12,15 @@ import com.google.gwt.user.client.DOM; * @author Olivier Maury */ public interface ApplicationUtils { + /** + * @return root path of application. + */ + static String getApplicationUrl() { + final String url = GWT.getModuleBaseURL(); + final String app = "/" + GWT.getModuleName() + "/"; + return url.substring(0, url.length() - app.length()); + } + /** * @return available locales for the app. */ diff --git a/www-server/pom.xml b/www-server/pom.xml index 573ff4bfc97de9123b4b544a98869fc7f397a9b1..b2e33368c323cdca3dc76acdc7408dd15e35740b 100644 --- a/www-server/pom.xml +++ b/www-server/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>fr.agrometinfo</groupId> <artifactId>www</artifactId> - <version>0.1.1-SNAPSHOT</version> + <version>0.1.2-SNAPSHOT</version> </parent> <artifactId>www-server</artifactId> diff --git a/www-server/src/main/resources/log4j2.xml b/www-server/src/main/resources/log4j2.xml index 332659472b526d28d475d9db8cdebf533e420608..a82f9cbe2913c2f689a197cf3bc5e63857b8b695 100644 --- a/www-server/src/main/resources/log4j2.xml +++ b/www-server/src/main/resources/log4j2.xml @@ -4,7 +4,7 @@ <Appenders> <Console name="console" target="SYSTEM_OUT"> <PatternLayout> - <pattern>dev-cas | %d | %-5p | %c#%M() | %L - %m%n</pattern> + <pattern>agrometinfo | %d | %-5p | %c#%M() | %L - %m%n</pattern> </PatternLayout> </Console> <!-- https://logging.apache.org/log4j/2.x/manual/appenders.html#RollingFileAppender --> diff --git a/www-shared/config/cpd-suppressions.properties b/www-shared/config/cpd-suppressions.properties new file mode 100644 index 0000000000000000000000000000000000000000..016017d554d39bad5a1d54a5c0df173340d06051 --- /dev/null +++ b/www-shared/config/cpd-suppressions.properties @@ -0,0 +1 @@ +# See https://maven.apache.org/plugins/maven-pmd-plugin/examples/violation-exclusions.html diff --git a/www-shared/config/pmd-suppressions.properties b/www-shared/config/pmd-suppressions.properties index fd6a1ac8251caa2931ef48696753b0f785d067d9..46a40bd59b544b7a41a2074494d7ecb35f6db349 100644 --- a/www-shared/config/pmd-suppressions.properties +++ b/www-shared/config/pmd-suppressions.properties @@ -20,5 +20,3 @@ org.geojson.LngLatAlt_MapperImpl=UnnecessaryImport org.geojson.PolygonBeanJsonDeserializerImpl=UnnecessaryImport org.geojson.PolygonBeanJsonSerializerImpl=UnnecessaryImport org.geojson.Polygon_MapperImpl=UnnecessaryImport -# wrong positive -fr.agrometinfo.www.server.dao.RegionDaoHibernate=UselessOverridingMethod diff --git a/www-shared/pom.xml b/www-shared/pom.xml index 9c00ff5effbe7eca790f8934394547ab85ca3191..7db4ad09780aaef6ce7ec5d398ad65834046f47d 100644 --- a/www-shared/pom.xml +++ b/www-shared/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>fr.agrometinfo</groupId> <artifactId>www</artifactId> - <version>0.1.1-SNAPSHOT</version> + <version>0.1.2-SNAPSHOT</version> </parent> <artifactId>www-shared</artifactId>