Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
khergalant committed Mar 12, 2020
2 parents d07137c + d58d950 commit b9b374f
Show file tree
Hide file tree
Showing 58 changed files with 2,364 additions and 1,778 deletions.
101 changes: 61 additions & 40 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<groupId>fr.univlorraine</groupId>
<artifactId>ecandidat</artifactId>
<packaging>war</packaging>
<version>2.3.1-SNAPSHOT</version>
<version>2.3.2-SNAPSHOT</version>
<name>ecandidat</name>

<properties>
Expand All @@ -45,8 +45,8 @@
<vaadin.spring.version>1.0.2</vaadin.spring.version>

<!-- Spring -->
<springframework.version>5.1.6.RELEASE</springframework.version>
<spring.security.version>5.1.5.RELEASE</spring.security.version>
<springframework.version>5.2.4.RELEASE</springframework.version>
<spring.security.version>5.2.2.RELEASE</spring.security.version>

<!-- Log et mail -->
<logback.version>1.1.8</logback.version>
Expand All @@ -64,12 +64,12 @@

<!-- Base de données et utilitaires -->
<mysql.connector.version>5.1.39</mysql.connector.version>
<ojdbc8.version>18.3.0.0</ojdbc8.version>
<ojdbc8.version>19.3.0.0</ojdbc8.version>
<eclipselink.version>2.7.2</eclipselink.version>
<javax.persistence.version>2.1.1</javax.persistence.version>
<javax.validation.version>2.0.1.Final</javax.validation.version>
<spring.data.jpa.version>1.11.22.RELEASE</spring.data.jpa.version>
<hibernate.validator.version>6.0.13.Final</hibernate.validator.version>
<hibernate.validator.version>6.1.2.Final</hibernate.validator.version>
<hibernate-jpamodelgen.version>5.3.7.Final</hibernate-jpamodelgen.version>
<flywaydb.version>4.2.0</flywaydb.version>

Expand All @@ -83,7 +83,7 @@
<tools.univlorraine.version>1.5.11</tools.univlorraine.version>
<lombok.version>1.18.6</lombok.version>
<jackson-core.version>2.9.10</jackson-core.version>
<jackson-databind.version>2.9.10.1</jackson-databind.version>
<jackson-databind.version>2.9.10.3</jackson-databind.version>

<!-- Plugins -->
<maven-resources-plugin.version>3.0.1</maven-resources-plugin.version>
Expand Down Expand Up @@ -165,6 +165,7 @@
<exclude>configUrlServices.ul.*</exclude>
<exclude>ul/</exclude>
<exclude>VAADIN/gwt-unitCache/</exclude>
<exclude>test-ws.properties</exclude>
</excludes>
</resource>
</resources>
Expand All @@ -183,8 +184,7 @@
<exclude>license/</exclude>
<exclude>assembly/</exclude>
<exclude>repository/</exclude>
<exclude>i18n/*.sample.properties</exclude>
<!-- <exclude>i18n/candidat/candidat-messages_*.properties</exclude> -->
<exclude>i18n/*.sample.properties</exclude>
<exclude>**/logo.sample.png</exclude>
<exclude>template/*.sample.docx</exclude>
<exclude>**/*.scss</exclude>
Expand All @@ -201,33 +201,7 @@

<!-- Profil de déploiement local, avec les fichiers de config, sans les fichiers sample et avec Oracle -->
<profile>
<id>oracle-enable</id>
<repositories>
<!-- Oracle Repository -->
<repository>
<id>maven.oracle.com</id>
<name>oracle-maven-repo</name>
<url>https://maven.oracle.com</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.oracle.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>${ojdbc8.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<id>local</id>
<build>
<finalName>${project.name}-${project-distribution.version}</finalName>
<resources>
Expand Down Expand Up @@ -389,6 +363,41 @@
</plugins>
</build>
</profile>

<!-- Profil de déploiement Test (pour les WS) -->
<profile>
<id>test-ws</id>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
<executions>
<execution>
<id>copy-resources-test-ws</id>
<!-- here the phase you need -->
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>src/main/resources/ul/test</directory>
<exclude>delete-opi.sql</exclude>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<!-- Profile de license -->
<profile>
<id>license</id>
Expand Down Expand Up @@ -768,11 +777,11 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>

<!-- Logging -->
<dependency>
Expand Down Expand Up @@ -977,6 +986,18 @@
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.connector.version}</version>
</dependency>

<dependency>
<groupId>com.oracle.ojdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>${ojdbc8.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Tools -->
<dependency>
Expand Down
26 changes: 20 additions & 6 deletions src/main/java/fr/univlorraine/ecandidat/config/SpringConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@

import fr.univlorraine.ecandidat.Initializer;
import fr.univlorraine.ecandidat.utils.ConstanteUtils;
import fr.univlorraine.ecandidat.utils.KeyValue;
import fr.univlorraine.ecandidat.utils.MethodUtils;

/** Configuration Spring
*
* @author Adrien Colson */
/**
* Configuration Spring
* @author Adrien Colson
*/
@Configuration
@EnableSpringConfigured
@ComponentScan(basePackageClasses = Initializer.class)
Expand All @@ -56,7 +58,7 @@ public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderCon
/** @return ResourceBundleMessageSource pour les messages de l'application */
@Bean
public ResourceBundleMessageSource messageSource() {
ResourceBundleMessageSource resourceBundleMessageSource = new ResourceBundleMessageSource();
final ResourceBundleMessageSource resourceBundleMessageSource = new ResourceBundleMessageSource();
resourceBundleMessageSource.setBasenames("i18n/messages", "i18n/backoffice/backoffice-messages", "i18n/backoffice/nomenclature-messages", "i18n/candidat/candidat-messages");
resourceBundleMessageSource.setFallbackToSystemLocale(false);
return resourceBundleMessageSource;
Expand Down Expand Up @@ -107,12 +109,24 @@ public static DateTimeFormatter formatterDateTimeApoWsPj() {
/** @return l'url du WS des PJ Apogée */
@Bean
static String urlWsPjApogee() {
return MethodUtils.getUrlWSApogee(ConstanteUtils.WS_APOGEE_PJ_SERVICE);
return MethodUtils.getUrlWSApogee(ConstanteUtils.WS_APOGEE_PJ_URL_SERVICE);
}

/** @return l'url du WS des PJ Apogée */
@Bean
static KeyValue headerWsPjApogee() {
return MethodUtils.getHeaderWSApogee(ConstanteUtils.WS_APOGEE_PJ_URL_SERVICE);
}

/** @return l'url du WS de verification de l'INES */
@Bean
static String urlWsCheckInes() {
return MethodUtils.getUrlWSApogee(ConstanteUtils.WS_INES_CHECK_URI_SERVICE);
return MethodUtils.getUrlWSApogee(ConstanteUtils.WS_INES_CHECK_URL_SERVICE);
}

/** @return l'url du WS des PJ Apogée */
@Bean
static KeyValue headerWsCheckInes() {
return MethodUtils.getHeaderWSApogee(ConstanteUtils.WS_INES_CHECK_URL_SERVICE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
import fr.univlorraine.ecandidat.entities.ecandidat.Adresse;
import fr.univlorraine.ecandidat.entities.ecandidat.Commission;

/** Gestion de l'entité campagne
*
* @author Kevin Hergalant */
/**
* Gestion de l'entité campagne
* @author Kevin Hergalant
*/
@Component
public class AdresseController {
/* Injections */
Expand All @@ -39,9 +40,11 @@ public class AdresseController {
@Resource
private transient I18nController i18nController;

/** @param adresse
* @param delimiter
* @return le libelle d'une adresse */
/**
* @param adresse
* @param delimiter
* @return le libelle d'une adresse
*/
public String getLibelleAdresse(final Adresse adresse, final String delimiter) {
String libAdr = "";
if (adresse != null) {
Expand Down Expand Up @@ -81,32 +84,42 @@ public String getLibelleAdresse(final Adresse adresse, final String delimiter) {
return libAdr;
}

/** @param commission
* @param delimiter
* @return le libelle de l'adresse de la commission */
/**
* @param commission
* @param delimiter
* @return le libelle de l'adresse de la commission
*/
public String getLibelleAdresseCommission(final Commission commission, final String delimiter) {
String libAdr = getLibelleAdresse(commission.getAdresse(), delimiter);
Boolean addDelimiter = false;
if (commission.getTelComm() != null) {
addDelimiter = true;
libAdr = libAdr + delimiter + applicationContext.getMessage("candidature.adresse.tel", new Object[] {commission.getTelComm()}, UI.getCurrent().getLocale()) + delimiter;
libAdr = libAdr + delimiter + applicationContext.getMessage("candidature.adresse.tel", new Object[] { commission.getTelComm() }, UI.getCurrent().getLocale()) + delimiter;
}
if (commission.getMailComm() != null) {
if (!addDelimiter) {
addDelimiter = true;
libAdr = libAdr + delimiter;
}
String libMail = "<a href = 'mailto:" + commission.getMailComm() + "'>" + commission.getMailComm() + "</a>";
libAdr = libAdr + applicationContext.getMessage("candidature.adresse.mail", new Object[] {libMail}, UI.getCurrent().getLocale()) + delimiter;
final String libMail = "<a href = 'mailto:" + commission.getMailComm() + "'>" + commission.getMailComm() + "</a>";
libAdr = libAdr + applicationContext.getMessage("candidature.adresse.mail", new Object[] { libMail }, UI.getCurrent().getLocale()) + delimiter;
}
if (commission.getUrlComm() != null) {
if (!addDelimiter) {
addDelimiter = true;
libAdr = libAdr + delimiter;
}
final String libUrl = "<a target='_blank' href = '" + commission.getUrlComm() + "'>" + commission.getUrlComm() + "</a>";
libAdr = libAdr + applicationContext.getMessage("candidature.adresse.url", new Object[] { libUrl }, UI.getCurrent().getLocale()) + delimiter;
}
if (commission.getFaxComm() != null) {
if (!addDelimiter) {
addDelimiter = true;
libAdr = libAdr + delimiter;
}
libAdr = libAdr + applicationContext.getMessage("candidature.adresse.fax", new Object[] {commission.getFaxComm()}, UI.getCurrent().getLocale()) + delimiter;
libAdr = libAdr + applicationContext.getMessage("candidature.adresse.fax", new Object[] { commission.getFaxComm() }, UI.getCurrent().getLocale()) + delimiter;
}
String commentRetour = i18nController.getI18nTraduction(commission.getI18nCommentRetourComm());
final String commentRetour = i18nController.getI18nTraduction(commission.getI18nCommentRetourComm());
if (commentRetour != null && !commentRetour.equals("")) {
if (!addDelimiter) {
addDelimiter = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ private Candidature saveCandidature(Candidature candidature, final Boolean isPro
if (isProposition) {
/* envoi du mail à la commission */
if (candidature.getFormation().getCommission().getTemAlertPropComm()) {
mailController.sendMailByCod(candidature.getFormation().getCommission().getMailComm(),
mailController.sendMailByCod(candidature.getFormation().getCommission().getMailAlertComm(),
NomenclatureUtils.MAIL_COMMISSION_ALERT_PROPOSITION,
null,
candidature,
Expand Down Expand Up @@ -948,7 +948,7 @@ public void setConfirmationCandidature(final Candidature candidature, final Bool
if (!confirm) {
/* envoi du mail à la commission */
if (candidature.getFormation().getCommission().getTemAlertDesistComm()) {
mailController.sendMailByCod(candidature.getFormation().getCommission().getMailComm(),
mailController.sendMailByCod(candidature.getFormation().getCommission().getMailAlertComm(),
NomenclatureUtils.MAIL_COMMISSION_ALERT_DESISTEMENT,
null,
candidature,
Expand Down Expand Up @@ -1029,7 +1029,7 @@ public void cancelCandidature(final Candidature candidature,

/* envoi du mail à la commission */
if (candidature.getFormation().getCommission().getTemAlertAnnulComm()) {
mailController.sendMailByCod(candidature.getFormation().getCommission().getMailComm(),
mailController.sendMailByCod(candidature.getFormation().getCommission().getMailAlertComm(),
NomenclatureUtils.MAIL_COMMISSION_ALERT_ANNULATION,
null,
candidature,
Expand Down Expand Up @@ -1153,7 +1153,7 @@ public InputStream downloadLettre(final Candidature candidature, final String mo
libAvis = i18nController.getI18nTraduction(typeDecisionCand.getTypeDecision().getI18nLibTypDec(), locale);
// motif pour un avis défavorable
if (typeDecisionCand.getMotivationAvis() != null && templateLettre.equals(ConstanteUtils.TEMPLATE_LETTRE_REFUS)) {
motif = i18nController.getI18nTraduction(typeDecisionCand.getMotivationAvis().getI18nLibMotiv());
motif = i18nController.getI18nTraduction(typeDecisionCand.getMotivationAvis().getI18nLibMotiv(), locale);
}
// commentaire
if (typeDecisionCand.getCommentTypeDecCand() != null && !typeDecisionCand.getCommentTypeDecCand().equals("")
Expand Down
Loading

0 comments on commit b9b374f

Please sign in to comment.