Skip to content
Snippets Groups Projects
Commit ada05c9e authored by srosse's avatar srosse
Browse files

OO-1611: update pdfbox, springframework, hibernate, apache poi... exclude...

OO-1611: update pdfbox, springframework, hibernate, apache poi... exclude jgroups, bootstrap framework from .war
parent 80213ff1
No related branches found
No related tags found
No related merge requests found
...@@ -48,8 +48,12 @@ junit and integration tests in OpenOLAT 8 ...@@ -48,8 +48,12 @@ junit and integration tests in OpenOLAT 8
- junit integration tests that load the framework to execute (execution time ca. 10m) - junit integration tests that load the framework to execute (execution time ca. 10m)
- MySQL - MySQL
mvn clean test -Dwith-mysql -Ptomcat mvn clean test -Dwith-mysql -Ptomcat
- PostgreSQL - PostgreSQL
mvn clean test -Dwith-postgresql -Ptomcat mvn clean test -Dwith-postgresql -Ptomcat
or if you want to specify the password:
mvn clean test -Dwith-postgresql -Dtest.env.db.postgresql.pass=serial -Ptomcat
- Oracle - Oracle
The support of Oracle is still EXPERIMENTAL The support of Oracle is still EXPERIMENTAL
- you need a clean database as the maven process doesn't create a new one (every time) - you need a clean database as the maven process doesn't create a new one (every time)
......
...@@ -64,11 +64,11 @@ ...@@ -64,11 +64,11 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<targetJdk>1.7</targetJdk> <targetJdk>1.7</targetJdk>
<org.springframework.version>3.2.13.RELEASE</org.springframework.version> <org.springframework.version>3.2.14.RELEASE</org.springframework.version>
<org.hibernate.version>4.3.9.Final</org.hibernate.version> <org.hibernate.version>4.3.10.Final</org.hibernate.version>
<com.sun.jersey.version>1.17.1</com.sun.jersey.version> <com.sun.jersey.version>1.17.1</com.sun.jersey.version>
<jackson.version>1.9.2</jackson.version> <jackson.version>1.9.2</jackson.version>
<org.mysql.version>5.1.34</org.mysql.version> <org.mysql.version>5.1.36</org.mysql.version>
<org.postgresql.version>9.4-1201-jdbc41</org.postgresql.version> <org.postgresql.version>9.4-1201-jdbc41</org.postgresql.version>
<org.infinispan.version>6.0.2.Final</org.infinispan.version> <org.infinispan.version>6.0.2.Final</org.infinispan.version>
<lucene.version>4.8.0</lucene.version> <lucene.version>4.8.0</lucene.version>
...@@ -380,6 +380,10 @@ ...@@ -380,6 +380,10 @@
<groupId>org.rhq.helpers</groupId> <groupId>org.rhq.helpers</groupId>
<artifactId>rhq-pluginAnnotations</artifactId> <artifactId>rhq-pluginAnnotations</artifactId>
</exclusion> </exclusion>
<exclusion>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
...@@ -565,6 +569,10 @@ ...@@ -565,6 +569,10 @@
<groupId>org.rhq.helpers</groupId> <groupId>org.rhq.helpers</groupId>
<artifactId>rhq-pluginAnnotations</artifactId> <artifactId>rhq-pluginAnnotations</artifactId>
</exclusion> </exclusion>
<exclusion>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
...@@ -1152,6 +1160,7 @@ ...@@ -1152,6 +1160,7 @@
<exclude>**/*.odt</exclude> <exclude>**/*.odt</exclude>
<exclude>**/*.pdf</exclude> <exclude>**/*.pdf</exclude>
<exclude>**/*.graffle</exclude> <exclude>**/*.graffle</exclude>
<exclude>**/doc-files/**</exclude>
</excludes> </excludes>
</resource> </resource>
<resource> <resource>
...@@ -1322,7 +1331,7 @@ ...@@ -1322,7 +1331,7 @@
<Implementation-Build>${buildNumber}</Implementation-Build> <Implementation-Build>${buildNumber}</Implementation-Build>
</manifestEntries> </manifestEntries>
</archive> </archive>
<excludes>**/*.pxm, **/*.psd, **/*.scss, **/*.sh, **/*.README</excludes> <excludes>**/*.pxm, **/*.psd, **/*.scss, **/*.sh, static/bootstrap/**, **/*.README</excludes>
<webResources> <webResources>
<resource> <resource>
<directory>src/main/webapp</directory> <directory>src/main/webapp</directory>
...@@ -1714,21 +1723,20 @@ ...@@ -1714,21 +1723,20 @@
<artifactId>viterows</artifactId> <artifactId>viterows</artifactId>
<version>6.0</version> <version>6.0</version>
</dependency> </dependency>
<!-- docx4j need poi scratchpad version 3.8 -->
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId> <artifactId>poi</artifactId>
<version>3.8</version> <version>3.12</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId> <artifactId>poi-scratchpad</artifactId>
<version>3.8</version> <version>3.12</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.pdfbox</groupId> <groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId> <artifactId>pdfbox</artifactId>
<version>1.8.8</version> <version>1.8.9</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>commons-logging</groupId> <groupId>commons-logging</groupId>
...@@ -1979,6 +1987,10 @@ ...@@ -1979,6 +1987,10 @@
<groupId>org.rhq.helpers</groupId> <groupId>org.rhq.helpers</groupId>
<artifactId>rhq-pluginAnnotations</artifactId> <artifactId>rhq-pluginAnnotations</artifactId>
</exclusion> </exclusion>
<exclusion>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
...@@ -2035,7 +2047,7 @@ ...@@ -2035,7 +2047,7 @@
<dependency> <dependency>
<groupId>com.thoughtworks.xstream</groupId> <groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId> <artifactId>xstream</artifactId>
<version>1.4.7</version> <version>1.4.8</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>xerces</groupId> <groupId>xerces</groupId>
......
...@@ -69,18 +69,15 @@ public class ExcelDocument extends FileDocument { ...@@ -69,18 +69,15 @@ public class ExcelDocument extends FileDocument {
@Override @Override
protected FileContent readContent(VFSLeaf leaf) throws IOException, DocumentException { protected FileContent readContent(VFSLeaf leaf) throws IOException, DocumentException {
BufferedInputStream bis = null;
int cellNullCounter = 0; int cellNullCounter = 0;
int rowNullCounter = 0; int rowNullCounter = 0;
int sheetNullCounter = 0; int sheetNullCounter = 0;
try { try(BufferedInputStream bis = new BufferedInputStream(leaf.getInputStream());
bis = new BufferedInputStream(leaf.getInputStream()); HSSFWorkbook workbook = new HSSFWorkbook(new POIFSFileSystem(bis));) {
LimitedContentWriter content = new LimitedContentWriter(bis.available(), FileDocumentFactory.getMaxFileSize());
POIFSFileSystem fs = new POIFSFileSystem(bis);
HSSFWorkbook workbook = new HSSFWorkbook(fs);
LimitedContentWriter content = new LimitedContentWriter((int)leaf.getSize(), FileDocumentFactory.getMaxFileSize());
for (int sheetNumber = 0; sheetNumber < workbook.getNumberOfSheets(); sheetNumber++) { for (int sheetNumber = 0; sheetNumber < workbook.getNumberOfSheets(); sheetNumber++) {
HSSFSheet sheet = workbook.getSheetAt(sheetNumber); HSSFSheet sheet = workbook.getSheetAt(sheetNumber);
if (sheet != null) { if (sheet != null) {
...@@ -116,12 +113,7 @@ public class ExcelDocument extends FileDocument { ...@@ -116,12 +113,7 @@ public class ExcelDocument extends FileDocument {
content.close(); content.close();
return new FileContent(content.toString()); return new FileContent(content.toString());
} catch (Exception ex) { } catch (Exception ex) {
throw new DocumentException("Can not read XLS Content. File=" + leaf.getName()); throw new DocumentException("Can not read XLS Content. File=" + leaf.getName(), ex);
} finally {
if (bis != null) {
bis.close();
}
} }
} }
} }
...@@ -99,24 +99,11 @@ public class WordDocument extends FileDocument { ...@@ -99,24 +99,11 @@ public class WordDocument extends FileDocument {
} }
private void collectWordDocument(POIFSFileSystem filesystem, Writer sb) throws IOException { private void collectWordDocument(POIFSFileSystem filesystem, Writer sb) throws IOException {
WordExtractor extractor = new WordExtractor(filesystem); try(WordExtractor extractor = new WordExtractor(filesystem)) {
addTextIfAny(sb, extractor.getHeaderText()); addTextIfAny(sb, extractor.getTextFromPieces());
for (String paragraph : extractor.getParagraphText()) { } catch(Exception e) {
sb.append(paragraph).append(' '); log.error("", e);
} }
for (String paragraph : extractor.getFootnoteText()) {
sb.append(paragraph).append(' ');
}
for (String paragraph : extractor.getCommentsText()) {
sb.append(paragraph).append(' ');
}
for (String paragraph : extractor.getEndnoteText()) {
sb.append(paragraph).append(' ');
}
addTextIfAny(sb, extractor.getFooterText());
} }
private void addTextIfAny(Writer sb, String text) throws IOException { private void addTextIfAny(Writer sb, String text) throws IOException {
......
...@@ -32,7 +32,6 @@ import org.junit.Test; ...@@ -32,7 +32,6 @@ import org.junit.Test;
import org.olat.core.util.vfs.VFSLeaf; import org.olat.core.util.vfs.VFSLeaf;
import org.olat.test.OlatTestCase; import org.olat.test.OlatTestCase;
import org.olat.test.VFSJavaIOFile; import org.olat.test.VFSJavaIOFile;
import org.springframework.beans.factory.annotation.Autowired;
/** /**
* Test the low memory text extractor for OpenXML (Microsoft Office XML) * Test the low memory text extractor for OpenXML (Microsoft Office XML)
...@@ -42,9 +41,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -42,9 +41,6 @@ import org.springframework.beans.factory.annotation.Autowired;
*/ */
public class OfficeDocumentTest extends OlatTestCase { public class OfficeDocumentTest extends OlatTestCase {
@Autowired
private FileDocumentFactory fileDocumentFactory;
@Test @Test
public void testWordOpenXMLDocument() throws IOException, DocumentException, DocumentAccessException, URISyntaxException { public void testWordOpenXMLDocument() throws IOException, DocumentException, DocumentAccessException, URISyntaxException {
URL docUrl = OfficeDocumentTest.class.getResource("Test_word_indexing.docx"); URL docUrl = OfficeDocumentTest.class.getResource("Test_word_indexing.docx");
...@@ -91,7 +87,8 @@ public class OfficeDocumentTest extends OlatTestCase { ...@@ -91,7 +87,8 @@ public class OfficeDocumentTest extends OlatTestCase {
FileContent content = document.readContent(doc); FileContent content = document.readContent(doc);
Assert.assertNotNull(content); Assert.assertNotNull(content);
String body = content.getContent(); String body = content.getContent();
Assert.assertTrue(body.contains("Lorem ipsum dolor sit amet")); Assert.assertTrue(body.contains("Lorem ipsum dolor sit amet"));//content
Assert.assertTrue(body.contains("Rue (domicile)"));//footer
} }
@Test @Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment