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
- junit integration tests that load the framework to execute (execution time ca. 10m)
- MySQL
mvn clean test -Dwith-mysql -Ptomcat
- PostgreSQL
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
The support of Oracle is still EXPERIMENTAL
- you need a clean database as the maven process doesn't create a new one (every time)
......
......@@ -64,11 +64,11 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<targetJdk>1.7</targetJdk>
<org.springframework.version>3.2.13.RELEASE</org.springframework.version>
<org.hibernate.version>4.3.9.Final</org.hibernate.version>
<org.springframework.version>3.2.14.RELEASE</org.springframework.version>
<org.hibernate.version>4.3.10.Final</org.hibernate.version>
<com.sun.jersey.version>1.17.1</com.sun.jersey.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.infinispan.version>6.0.2.Final</org.infinispan.version>
<lucene.version>4.8.0</lucene.version>
......@@ -380,6 +380,10 @@
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-pluginAnnotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
</exclusion>
</exclusions>
</dependency>
......@@ -565,6 +569,10 @@
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-pluginAnnotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
</exclusion>
</exclusions>
</dependency>
......@@ -1152,6 +1160,7 @@
<exclude>**/*.odt</exclude>
<exclude>**/*.pdf</exclude>
<exclude>**/*.graffle</exclude>
<exclude>**/doc-files/**</exclude>
</excludes>
</resource>
<resource>
......@@ -1322,7 +1331,7 @@
<Implementation-Build>${buildNumber}</Implementation-Build>
</manifestEntries>
</archive>
<excludes>**/*.pxm, **/*.psd, **/*.scss, **/*.sh, **/*.README</excludes>
<excludes>**/*.pxm, **/*.psd, **/*.scss, **/*.sh, static/bootstrap/**, **/*.README</excludes>
<webResources>
<resource>
<directory>src/main/webapp</directory>
......@@ -1714,21 +1723,20 @@
<artifactId>viterows</artifactId>
<version>6.0</version>
</dependency>
<!-- docx4j need poi scratchpad version 3.8 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.8</version>
<version>3.12</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.8</version>
<version>3.12</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>1.8.8</version>
<version>1.8.9</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
......@@ -1979,6 +1987,10 @@
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-pluginAnnotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
......@@ -2035,7 +2047,7 @@
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.7</version>
<version>1.4.8</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
......
......@@ -69,18 +69,15 @@ public class ExcelDocument extends FileDocument {
@Override
protected FileContent readContent(VFSLeaf leaf) throws IOException, DocumentException {
BufferedInputStream bis = null;
int cellNullCounter = 0;
int rowNullCounter = 0;
int sheetNullCounter = 0;
try {
bis = new BufferedInputStream(leaf.getInputStream());
LimitedContentWriter content = new LimitedContentWriter(bis.available(), FileDocumentFactory.getMaxFileSize());
POIFSFileSystem fs = new POIFSFileSystem(bis);
HSSFWorkbook workbook = new HSSFWorkbook(fs);
try(BufferedInputStream bis = new BufferedInputStream(leaf.getInputStream());
HSSFWorkbook workbook = new HSSFWorkbook(new POIFSFileSystem(bis));) {
LimitedContentWriter content = new LimitedContentWriter((int)leaf.getSize(), FileDocumentFactory.getMaxFileSize());
for (int sheetNumber = 0; sheetNumber < workbook.getNumberOfSheets(); sheetNumber++) {
HSSFSheet sheet = workbook.getSheetAt(sheetNumber);
if (sheet != null) {
......@@ -116,12 +113,7 @@ public class ExcelDocument extends FileDocument {
content.close();
return new FileContent(content.toString());
} catch (Exception ex) {
throw new DocumentException("Can not read XLS Content. File=" + leaf.getName());
} finally {
if (bis != null) {
bis.close();
}
throw new DocumentException("Can not read XLS Content. File=" + leaf.getName(), ex);
}
}
}
......@@ -99,24 +99,11 @@ public class WordDocument extends FileDocument {
}
private void collectWordDocument(POIFSFileSystem filesystem, Writer sb) throws IOException {
WordExtractor extractor = new WordExtractor(filesystem);
addTextIfAny(sb, extractor.getHeaderText());
for (String paragraph : extractor.getParagraphText()) {
sb.append(paragraph).append(' ');
try(WordExtractor extractor = new WordExtractor(filesystem)) {
addTextIfAny(sb, extractor.getTextFromPieces());
} catch(Exception e) {
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 {
......
......@@ -32,7 +32,6 @@ import org.junit.Test;
import org.olat.core.util.vfs.VFSLeaf;
import org.olat.test.OlatTestCase;
import org.olat.test.VFSJavaIOFile;
import org.springframework.beans.factory.annotation.Autowired;
/**
* Test the low memory text extractor for OpenXML (Microsoft Office XML)
......@@ -42,9 +41,6 @@ import org.springframework.beans.factory.annotation.Autowired;
*/
public class OfficeDocumentTest extends OlatTestCase {
@Autowired
private FileDocumentFactory fileDocumentFactory;
@Test
public void testWordOpenXMLDocument() throws IOException, DocumentException, DocumentAccessException, URISyntaxException {
URL docUrl = OfficeDocumentTest.class.getResource("Test_word_indexing.docx");
......@@ -91,7 +87,8 @@ public class OfficeDocumentTest extends OlatTestCase {
FileContent content = document.readContent(doc);
Assert.assertNotNull(content);
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
......
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