This is an automated email from the git hooks/post-receive script. New commit to branch struts2.5 in repository coser. See https://gitlab.nuiton.org/codelutin/coser.git commit 738b5011036efd61156b39a6e6a679b56c5e028d Author: jcouteau <couteau@codelutin.com> Date: Wed Nov 20 14:40:14 2019 +0100 Update xwork-core 2.3.x to struts2-core 2.5.x branch --- coser-business/pom.xml | 4 ++-- .../fr/ifremer/coser/services/ClientResultService.java | 2 +- .../java/fr/ifremer/coser/services/ControlService.java | 8 +++++--- .../ifremer/coser/util/io/OneRSufiResultFileFilter.java | 10 +++++++--- .../coser/validators/CoserExpressionValidator.java | 4 ++++ .../fr/ifremer/coser/services/ControlServiceTest.java | 5 +---- coser-web/pom.xml | 4 ---- coser-web/src/main/resources/struts.xml | 4 ++-- coser-web/src/main/webapp/WEB-INF/web.xml | 6 +++--- pom.xml | 16 ++-------------- 10 files changed, 27 insertions(+), 36 deletions(-) diff --git a/coser-business/pom.xml b/coser-business/pom.xml index 2cc7f51..fc058e5 100644 --- a/coser-business/pom.xml +++ b/coser-business/pom.xml @@ -116,8 +116,8 @@ <artifactId>opencsv</artifactId> </dependency> <dependency> - <groupId>org.apache.struts.xwork</groupId> - <artifactId>xwork-core</artifactId> + <groupId>org.apache.struts</groupId> + <artifactId>struts2-core</artifactId> </dependency> <dependency> <groupId>org.javassist</groupId> diff --git a/coser-business/src/main/java/fr/ifremer/coser/services/ClientResultService.java b/coser-business/src/main/java/fr/ifremer/coser/services/ClientResultService.java index b1ca348..7fd0295 100644 --- a/coser-business/src/main/java/fr/ifremer/coser/services/ClientResultService.java +++ b/coser-business/src/main/java/fr/ifremer/coser/services/ClientResultService.java @@ -519,7 +519,7 @@ public class ClientResultService { for (GlobalResult globalProject : selectedResults) { if (globalProject.isRsufi()) { RSufiResultPath path = globalProject.getRsufiProject(); - // load projet, needed to known source data file name + // load projet, needed to know source data file name Project project = path.getProject(); project = projectService.openProject(project.getName()); diff --git a/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java b/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java index 2b3a165..dc49c53 100644 --- a/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java +++ b/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java @@ -25,6 +25,8 @@ package fr.ifremer.coser.services; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.FileManagerFactory; import com.opensymphony.xwork2.ValidationAwareSupport; +import com.opensymphony.xwork2.DefaultLocaleProvider; +import com.opensymphony.xwork2.DefaultTextProvider; import com.opensymphony.xwork2.config.Configuration; import com.opensymphony.xwork2.config.ConfigurationManager; import com.opensymphony.xwork2.inject.Container; @@ -101,9 +103,9 @@ public class ControlService { public ControlService(CoserBusinessConfig config) { this.config = config; validationSupport = new ValidationAwareSupport(); - validationContext = new DelegatingValidatorContext(validationSupport); + validationContext = new DelegatingValidatorContext(validationSupport, new DefaultTextProvider(), new DefaultLocaleProvider()); - ConfigurationManager confManager = new ConfigurationManager(); + ConfigurationManager confManager = new ConfigurationManager("xwork"); Configuration conf = confManager.getConfiguration(); Container container = conf.getContainer(); @@ -1394,4 +1396,4 @@ public class ControlService { Matcher mLength = FISH_LENGTH_PATTERN.matcher(length); return mLength.matches(); } -} +} \ No newline at end of file diff --git a/coser-business/src/main/java/fr/ifremer/coser/util/io/OneRSufiResultFileFilter.java b/coser-business/src/main/java/fr/ifremer/coser/util/io/OneRSufiResultFileFilter.java index 7fd9ba8..bfc69f7 100644 --- a/coser-business/src/main/java/fr/ifremer/coser/util/io/OneRSufiResultFileFilter.java +++ b/coser-business/src/main/java/fr/ifremer/coser/util/io/OneRSufiResultFileFilter.java @@ -81,24 +81,28 @@ public class OneRSufiResultFileFilter implements FileFilter { File selectionDirectory = new File(selectionsDirectory, selection.getName()); File resultsDirectory = new File(selectionDirectory, CoserConstants.STORAGE_RESULTS_DIRECTORY); File resultDirectory = new File(resultsDirectory, rsufi.getName()); + File originsDirectory = new File(projectDirectory, CoserConstants.STORAGE_ORIGINAL_DIRECTORY); + File controlsDirectory = new File(projectDirectory, CoserConstants.STORAGE_CONTROL_DIRECTORY); String projectPath = projectDirectory.getCanonicalPath() + File.separator; String selectionsPath = selectionsDirectory.getCanonicalPath() + File.separator; String selectionPath = selectionDirectory.getCanonicalPath() + File.separator; String resultsPath = resultsDirectory.getCanonicalPath() + File.separator; String resultPath = resultDirectory.getCanonicalPath() + File.separator; + String originsPath = originsDirectory.getCanonicalPath() + File.separator; + String controlsPath = controlsDirectory.getCanonicalPath() + File.separator; // on prend // - tout ce qu'il y a dans le projet - // - sauf le répertoire "selections" + // - sauf les répertoire "selections", "original" et "controls" // - ou la selection entierement // - sauf le répertoire result // - ou le resultat entierrement result = (currentPathName.startsWith(projectPath) - && !currentPathName.startsWith(selectionsPath)) + && !(currentPathName.startsWith(originsPath)||currentPathName.startsWith(controlsPath))||currentPathName.startsWith(selectionsPath)) || (currentPathName.startsWith(selectionPath) && !currentPathName.startsWith(resultsPath)) - || currentPathName.startsWith(resultPath); + || currentPathName.startsWith(resultPath); // cas ou les données sources ne doivent pas être exporter // condition sur les noms de fichiers ? diff --git a/coser-business/src/main/java/fr/ifremer/coser/validators/CoserExpressionValidator.java b/coser-business/src/main/java/fr/ifremer/coser/validators/CoserExpressionValidator.java index a78772a..b8b7e11 100644 --- a/coser-business/src/main/java/fr/ifremer/coser/validators/CoserExpressionValidator.java +++ b/coser-business/src/main/java/fr/ifremer/coser/validators/CoserExpressionValidator.java @@ -24,6 +24,8 @@ package fr.ifremer.coser.validators; import com.opensymphony.xwork2.util.ValueStack; import com.opensymphony.xwork2.validator.ValidationException; import com.opensymphony.xwork2.validator.validators.ExpressionValidator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** * Modification de {@link ExpressionValidator} pour avoir les exceptions. @@ -32,6 +34,8 @@ import com.opensymphony.xwork2.validator.validators.ExpressionValidator; */ public class CoserExpressionValidator extends ExpressionValidator { + private static final Log log = LogFactory.getLog(CoserExpressionValidator.class); + private ValueStack localStack; public void setValueStack(ValueStack localStack) { diff --git a/coser-business/src/test/java/fr/ifremer/coser/services/ControlServiceTest.java b/coser-business/src/test/java/fr/ifremer/coser/services/ControlServiceTest.java index a49ce19..0b24629 100644 --- a/coser-business/src/test/java/fr/ifremer/coser/services/ControlServiceTest.java +++ b/coser-business/src/test/java/fr/ifremer/coser/services/ControlServiceTest.java @@ -41,10 +41,7 @@ import fr.ifremer.coser.data.Length; * Test about control service (validation...). * * @author chatellier - - * - - + * */ public class ControlServiceTest extends CoserTestAbstract { diff --git a/coser-web/pom.xml b/coser-web/pom.xml index 81f5c78..2c59fd2 100644 --- a/coser-web/pom.xml +++ b/coser-web/pom.xml @@ -105,10 +105,6 @@ <groupId>org.nuiton.web</groupId> <artifactId>nuiton-struts2</artifactId> </dependency> - <dependency> - <groupId>org.apache.struts.xwork</groupId> - <artifactId>xwork-core</artifactId> - </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> diff --git a/coser-web/src/main/resources/struts.xml b/coser-web/src/main/resources/struts.xml index 84bf9c0..e85f2c0 100644 --- a/coser-web/src/main/resources/struts.xml +++ b/coser-web/src/main/resources/struts.xml @@ -21,8 +21,8 @@ --> <!DOCTYPE struts PUBLIC - "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" - "http://struts.apache.org/dtds/struts-2.3.dtd"> + "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN" + "http://struts.apache.org/dtds/struts-2.5.dtd"> <struts> <constant name="struts.multipart.maxSize" value="100097152"/> diff --git a/coser-web/src/main/webapp/WEB-INF/web.xml b/coser-web/src/main/webapp/WEB-INF/web.xml index 04b887b..42edfb7 100644 --- a/coser-web/src/main/webapp/WEB-INF/web.xml +++ b/coser-web/src/main/webapp/WEB-INF/web.xml @@ -30,7 +30,7 @@ <filter> <filter-name>struts-prepare</filter-name> - <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class> + <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareFilter</filter-class> <init-param> <param-name>actionPackages</param-name> <param-value>fr.ifremer.coser.web</param-value> @@ -39,7 +39,7 @@ <filter> <filter-name>struts-execute</filter-name> - <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class> + <filter-class>org.apache.struts2.dispatcher.filter.StrutsExecuteFilter</filter-class> </filter> <filter> @@ -63,7 +63,7 @@ </filter-mapping> <listener> - <listener-class>org.apache.struts2.dispatcher.ng.listener.StrutsListener</listener-class> + <listener-class>org.apache.struts2.dispatcher.listener.StrutsListener</listener-class> </listener> <listener> diff --git a/pom.xml b/pom.xml index 58c82b3..efe08b5 100644 --- a/pom.xml +++ b/pom.xml @@ -103,9 +103,9 @@ <!-- Versions --> <jaxxVersion>2.8.6</jaxxVersion> - <nuitonI18nVersion>3.1</nuitonI18nVersion> + <nuitonI18nVersion>3.7</nuitonI18nVersion> <nuitonMatrixVersion>2.3.3</nuitonMatrixVersion> - <strutsVersion>2.3.36</strutsVersion> + <strutsVersion>2.5.20</strutsVersion> <nuitonReportPluginVersion>3.0</nuitonReportPluginVersion> <!-- Site configuration --> @@ -349,18 +349,6 @@ <version>${strutsVersion}</version> </dependency> - <dependency> - <groupId>org.apache.struts.xwork</groupId> - <artifactId>xwork-core</artifactId> - <version>${strutsVersion}</version> - <exclusions> - <exclusion> - <groupId>javassist</groupId> - <artifactId>javassist</artifactId> - </exclusion> - </exclusions> - </dependency> - <!-- temp security fix (struts dependency) --> <dependency> <groupId>commons-fileupload</groupId> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.