Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ec9e9ca
Initial plan
Copilot Dec 22, 2025
2a200e5
Update dependencies to fix security vulnerabilities
Copilot Dec 22, 2025
ba65b55
Fix type incompatibility in StudyDAO.findByAuthor() for Spring 4.x co…
Copilot Dec 22, 2025
8b796bf
Migrate AbstractServiceTest to Spring 4.x test framework
Copilot Dec 22, 2025
a0888a8
Replace deprecated queryForInt() with queryForObject() for Spring 4.x…
Copilot Dec 23, 2025
033e7ba
Upgrade Hibernate from 3.3.1 to 4.3.11 for Spring 4.x compatibility
Copilot Dec 23, 2025
932951d
Replace deprecated Hibernate 3.x annotations with JPA standard annota…
Copilot Dec 23, 2025
228966f
Update Hibernate API calls for Hibernate 4.x compatibility
Copilot Dec 23, 2025
5c051b1
Fix EnvironmentTest to use Hibernate 4.x ReturningWork instead of Ses…
Copilot Dec 23, 2025
466b033
Update Spring configuration and imports from Hibernate 3 to Hibernate 4
Copilot Dec 23, 2025
10c33b7
Remove HibernateAccessor import and update JavaDoc to reference Hiber…
Copilot Dec 23, 2025
5ed7298
Fix Hibernate 4.x Session API: replace getSession() with getSessionFa…
Copilot Dec 23, 2025
592d619
Replace all remaining getSession() calls with getSessionFactory().get…
Copilot Dec 23, 2025
dae2603
Fix remaining getSession() calls across all DAO and utility classes f…
Copilot Dec 23, 2025
a11c304
Add SLF4J dependencies for Hibernate 4.3.11 compatibility
Copilot Dec 23, 2025
de60f11
Fix SLF4J compatibility: use log4j-slf4j-impl 2.17.2 and add log4j-1.…
Copilot Dec 23, 2025
febad00
Upgrade SLF4J to 2.0.16 and use log4j-slf4j2-impl 2.24.3 for full Log…
Copilot Dec 23, 2025
57bd922
Use SLF4J 1.7.36 with log4j-slf4j-impl for Hibernate 4.3.11 compatibi…
Copilot Dec 23, 2025
eacb0e1
Upgrade Hibernate to 5.6.15.Final and SLF4J to 2.0.16 for modern API …
Copilot Dec 23, 2025
9987438
Update Spring configuration and imports from Hibernate 4 to Hibernate 5
Copilot Dec 23, 2025
7b3adde
Fix Hibernate 5.x API compatibility: update FlushMode to FlushModeTyp…
Copilot Dec 23, 2025
70fc525
Fix Hibernate 5.x cache configuration: migrate from EhCacheProvider t…
Copilot Dec 23, 2025
3bd9672
Upgrade c3p0 from 0.9.1.2 to 0.10.1 to fix JDBC compatibility with ne…
Copilot Dec 23, 2025
d1eb8f7
Fix remaining Hibernate 3 imports in test classes: update to Hibernate 5
Copilot Dec 23, 2025
0695c7c
Fix EnvironmentTest: remove manual connection commit/close for Hibern…
Copilot Dec 23, 2025
2bca510
Add Spring 4.x compatibility classes for deprecated form controllers …
Copilot Dec 23, 2025
0024ba7
Reimplement Spring 4.x compatibility classes using AbstractController…
Copilot Dec 23, 2025
724a971
Add missing methods to CancellableFormController: getCancelView, show…
Copilot Dec 23, 2025
a070f7f
Add missing methods to CancellableFormController: referenceData, form…
Copilot Dec 23, 2025
7274ed8
Update dependencies to address security vulnerabilities
Copilot Dec 23, 2025
3706475
Restore Spring 4.x compatibility classes and add missing methods: set…
Copilot Dec 23, 2025
cb2d1b7
Complete Spring 4.x compatibility layer: fix type signatures, add mis…
Copilot Dec 23, 2025
54c015f
Fix OAI-PMH controller: add AbstractCommandController compatibility c…
Copilot Dec 23, 2025
09cb9f3
Migrate OAI-PMH test classes from Spring 2.x/3.x to Spring 4.x test f…
Copilot Dec 23, 2025
f95b367
Migrate OAI-PMH test suites from JUnit 3 to JUnit 4: use @Suite annot…
Copilot Dec 23, 2025
2003bb4
Fix OAI-PMH SLF4J compatibility: add SLF4J 2.0.16 and log4j-slf4j2-im…
Copilot Dec 23, 2025
d8f8754
Fix OAI-PMH SLF4J conflict: exclude transitive SLF4J dependencies fro…
Copilot Dec 23, 2025
e4d1eda
Fix OAI-PMH SLF4J: use explicit SLF4J 2.0.16 and log4j-slf4j2-impl 2.…
Copilot Dec 23, 2025
e65a86a
Fix OAI-PMH SLF4J conflict: exclude old SLF4J versions from struts-me…
Copilot Dec 23, 2025
ab3b202
Fix OAI-PMH ApplicationContext error: add Apache Velocity 1.7 depende…
Copilot Dec 23, 2025
49c7531
Add validator property to AbstractCommandController for Spring 3.x co…
Copilot Dec 23, 2025
5359a99
Fix OAI-PMH ANTLR version conflict: exclude ANTLR 2.7.2 from struts, …
Copilot Dec 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 56 additions & 1 deletion oai-pmh_data_provider/data_provider_web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@
<groupId>struts</groupId>
<artifactId>struts</artifactId>
<version>1.2.9</version>
<exclusions>
<!-- Exclude old ANTLR 2.7.2 - Hibernate 5 requires 2.7.7 -->
<exclusion>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>opensymphony</groupId>
Expand All @@ -134,6 +141,21 @@
<groupId>displaytag</groupId>
<artifactId>displaytag</artifactId>
<version>1.1.1</version>
<exclusions>
<!-- Exclude old SLF4J versions -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl104-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>struts-menu</groupId>
Expand All @@ -160,7 +182,20 @@
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</exclusion>
</exclusion>
<!-- Exclude old SLF4J versions -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl104-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down Expand Up @@ -244,6 +279,12 @@
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
</dependency>
<!-- Velocity 1.7 compatible with Spring 4.x -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>velocity-tools</groupId>
Expand All @@ -265,6 +306,20 @@
<artifactId>treebase-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

<!-- SLF4J 2.0.16 for compatibility with Log4j 2.24.3 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.16</version>
</dependency>

<!-- Log4j 2.x SLF4J binding -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.24.3</version>
</dependency>

</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
package org.cipres.treebase.web.compat;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.validation.Validator;
import org.springframework.web.bind.ServletRequestDataBinder;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

/**
* Compatibility class to bridge Spring 3.x AbstractCommandController to Spring 4.x
* This class provides a similar API to the removed Spring 3.x AbstractCommandController
* by extending AbstractController and implementing command binding manually
*/
public abstract class AbstractCommandController extends AbstractController {

private Class<?> commandClass;
private String commandName = "command";
private Validator validator;

public void setCommandClass(Class<?> commandClass) {
this.commandClass = commandClass;
}

public Class<?> getCommandClass() {
return commandClass;
}

public void setCommandName(String commandName) {
this.commandName = commandName;
}

public String getCommandName() {
return commandName;
}

public void setValidator(Validator validator) {
this.validator = validator;
}

public Validator getValidator() {
return validator;
}

@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
Object command = createCommand();
ServletRequestDataBinder binder = createBinder(request, command);
binder.bind(request);
org.springframework.validation.BindException errors = new org.springframework.validation.BindException(binder.getBindingResult());

// Validate if validator is set
if (validator != null) {
validator.validate(command, errors);
}

return handle(request, response, command, errors);
}

protected Object createCommand() throws Exception {
if (commandClass != null) {
return commandClass.newInstance();
}
return new Object();
}

protected ServletRequestDataBinder createBinder(HttpServletRequest request, Object command) throws Exception {
ServletRequestDataBinder binder = new ServletRequestDataBinder(command, getCommandName());
initBinder(request, binder);
return binder;
}

protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
// Override to customize binder
}

/**
* Template method for handling the command.
* Subclasses must override this method to process the bound command object.
* This version includes binding errors for validation.
*/
protected ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object command, org.springframework.validation.BindException errors) throws Exception {
// Default implementation calls the 3-parameter version for backwards compatibility
return handle(request, response, command);
}

/**
* Template method for handling the command.
* Subclasses can override this method to process the bound command object.
* Override the 4-parameter version if you need access to binding errors.
*/
protected ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object command) throws Exception {
throw new UnsupportedOperationException("Subclasses must override either handle(request, response, command) or handle(request, response, command, errors)");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractCommandController;
import org.cipres.treebase.web.compat.AbstractCommandController;
import org.treebase.oai.web.command.Identify;
import org.treebase.oai.web.command.OAIPMHCommand;
import org.treebase.oai.web.util.IdentifyUtil;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
package org.treebase.oai;

import junit.framework.Test;
import junit.framework.TestSuite;


import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses({
org.treebase.oai.web.PackageTestSuite.class
})
public class PackageTestSuite {


public static void main(String[] args) {
junit.textui.TestRunner.run(suite());
}


public static Test suite() {
TestSuite suite = new TestSuite("Tests in package " + PackageTestSuite.class.getName());

suite.addTest(org.treebase.oai.web.PackageTestSuite.suite());

return suite;
}
// JUnit 4 suite - test classes are specified in @SuiteClasses annotation
}

Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
package org.treebase.oai.web;

import junit.framework.Test;
import junit.framework.TestSuite;


import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses({
org.treebase.oai.web.command.PackageTestSuite.class,
org.treebase.oai.web.controller.PackageTestSuite.class,
org.treebase.oai.web.util.PackageTestSuite.class
})
public class PackageTestSuite {


public static void main(String[] args) {
junit.textui.TestRunner.run(suite());
}


public static Test suite() {
TestSuite suite = new TestSuite("Tests in package " + PackageTestSuite.class.getName());

//suite.addTestSuite(ContextManagerTest.class);
//suite.addTestSuite(RangeExpressionTest.class);
//suite.addTestSuite(TreebaseIDStringTest.class);
//suite.addTestSuite(TreebaseUtilTest.class);

suite.addTest(org.treebase.oai.web.command.PackageTestSuite.suite());
suite.addTest(org.treebase.oai.web.controller.PackageTestSuite.suite());
suite.addTest(org.treebase.oai.web.util.PackageTestSuite.suite());

return suite;
}
// JUnit 4 suite - test classes are specified in @SuiteClasses annotation
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,24 @@

import java.util.Date;

import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import static org.junit.Assert.assertNotNull;

public class IdentifyTest extends AbstractDependencyInjectionSpringContextTests {
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext.xml"})
public class IdentifyTest {

@Autowired
private Identify identify;

public void setIdentify(Identify identify) {
this.identify = identify;
}

@Override
protected String[] getConfigLocations() {
return new String[]{"applicationContext.xml"};
}

@Test
public void testLoadIdentify() {

this.assertNotNull(identify);

assertNotNull(identify);
}


}
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
package org.treebase.oai.web.command;

import junit.framework.Test;
import junit.framework.TestSuite;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses({
IdentifyTest.class
})
public class PackageTestSuite {

public static Test suite() {
TestSuite suite = new TestSuite("Test for org.cipres.treebase.auxdata");

suite.addTestSuite(IdentifyTest.class);



return suite;
}

// JUnit 4 suite - test classes are specified in @SuiteClasses annotation
}
Loading