Skip to content

Commit

Permalink
Update dependencies cuba-platform/cuba#3307
Browse files Browse the repository at this point in the history
Gavrilov-Ivan authored Jan 14, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 174acf0 commit 7d25d68
Showing 5 changed files with 18 additions and 11 deletions.
8 changes: 7 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -208,6 +208,10 @@ configure(globalModule) {
compile(bom['com.haulmont.yarg:yarg-api']) {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
compile(bom['com.fasterxml.jackson.core:jackson-databind'])
compile(bom['com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'])
compile(bom['com.fasterxml.jackson.dataformat:jackson-dataformat-xml'])

if (!JavaVersion.current().isJava8()) {
runtime('javax.xml.bind:jaxb-api:2.3.1')
runtime('org.glassfish.jaxb:jaxb-runtime:2.3.1')
@@ -252,7 +256,9 @@ configure(coreModule) {
exclude group: 'commons-dbcp', module: 'commons-dbcp'
}
compile(bom['com.fasterxml.jackson.core:jackson-annotations']) // use the same version as BPM

compile(bom['com.fasterxml.jackson.core:jackson-databind'])
compile(bom['com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'])

testCompile(group: 'com.haulmont.cuba', name: 'cuba-core-tests', version: baseVersion)
testCompile(bom['org.apache.commons:commons-dbcp2'])
compileOnly(bom['javax.servlet:javax.servlet-api'])
11 changes: 5 additions & 6 deletions modules/core/src/com/haulmont/reports/ReportImportExport.java
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@
import com.haulmont.reports.entity.ReportImportResult;
import com.haulmont.reports.entity.ReportTemplate;
import com.haulmont.reports.exception.ReportingException;
import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
@@ -69,7 +68,7 @@ public byte[] exportReports(Collection<Report> reports) {
for (Report report : reports) {
try {
byte[] reportBytes = exportReport(report);
ArchiveEntry singleReportEntry = newStoredEntry(replaceForbiddenCharacters(report.getName()) + ".zip", reportBytes);
ZipArchiveEntry singleReportEntry = newStoredEntry(replaceForbiddenCharacters(report.getName()) + ".zip", reportBytes);
zipOutputStream.putArchiveEntry(singleReportEntry);
zipOutputStream.write(reportBytes);
zipOutputStream.closeArchiveEntry();
@@ -186,7 +185,7 @@ protected byte[] exportReport(Report report) throws IOException {

String xml = report.getXml();
byte[] xmlBytes = xml.getBytes(StandardCharsets.UTF_8);
ArchiveEntry zipEntryReportObject = newStoredEntry("report.structure", xmlBytes);
ZipArchiveEntry zipEntryReportObject = newStoredEntry("report.structure", xmlBytes);
zipOutputStream.putArchiveEntry(zipEntryReportObject);
zipOutputStream.write(xmlBytes);

@@ -203,7 +202,7 @@ protected byte[] exportReport(Report report) throws IOException {
}
if (template != null && template.getContent() != null) {
byte[] fileBytes = template.getContent();
ArchiveEntry zipEntryTemplate = newStoredEntry(
ZipArchiveEntry zipEntryTemplate = newStoredEntry(
"templates/" + i + "/" + template.getName(), fileBytes);
zipOutputStream.putArchiveEntry(zipEntryTemplate);
zipOutputStream.write(fileBytes);
@@ -340,7 +339,7 @@ protected byte[] zipContent(Map<String, Object> stringObjectMap) throws IOExcept

for (Map.Entry<String, Object> entry : stringObjectMap.entrySet()) {
byte[] data = (byte[]) entry.getValue();
ArchiveEntry archiveEntry = newStoredEntry(entry.getKey(), data);
ZipArchiveEntry archiveEntry = newStoredEntry(entry.getKey(), data);
zipOutputStream.putArchiveEntry(archiveEntry);
zipOutputStream.write(data);
zipOutputStream.closeArchiveEntry();
@@ -350,7 +349,7 @@ protected byte[] zipContent(Map<String, Object> stringObjectMap) throws IOExcept
return byteArrayOutputStream.toByteArray();
}

protected ArchiveEntry newStoredEntry(String name, byte[] data) {
protected ZipArchiveEntry newStoredEntry(String name, byte[] data) {
ZipArchiveEntry zipEntry = new ZipArchiveEntry(name);
zipEntry.setSize(data.length);
zipEntry.setCompressedSize(zipEntry.getSize());
5 changes: 2 additions & 3 deletions modules/core/src/com/haulmont/reports/ReportingBean.java
Original file line number Diff line number Diff line change
@@ -45,7 +45,6 @@
import com.haulmont.yarg.structure.ReportOutputType;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Predicate;
import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.lang3.StringUtils;
@@ -304,7 +303,7 @@ public ReportOutputDocument bulkPrint(Report report, String templateCode, com.ha
alreadyUsedNames.put(documentName, 1);
}

ArchiveEntry singleReportEntry = newStoredEntry(documentName, reportDocument.getContent());
ZipArchiveEntry singleReportEntry = newStoredEntry(documentName, reportDocument.getContent());
zipOutputStream.putArchiveEntry(singleReportEntry);
zipOutputStream.write(reportDocument.getContent());
}
@@ -321,7 +320,7 @@ public ReportOutputDocument bulkPrint(Report report, String templateCode, com.ha
}
}

protected ArchiveEntry newStoredEntry(String name, byte[] data) {
protected ZipArchiveEntry newStoredEntry(String name, byte[] data) {
ZipArchiveEntry zipEntry = new ZipArchiveEntry(name);
zipEntry.setSize(data.length);
zipEntry.setCompressedSize(zipEntry.getSize());
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@

package com.haulmont.reports.converter;

import com.haulmont.cuba.core.entity.Entity;
import com.haulmont.cuba.core.global.View;
import com.haulmont.cuba.core.global.ViewProperty;
import com.haulmont.cuba.core.sys.CubaXStream;
@@ -101,6 +102,8 @@ public boolean canConvert(Class type) {
xStream.aliasField("definedBy", ReportTemplate.class, "customDefinedBy");
xStream.aliasField("uuid", ReportValueFormat.class, "id");

xStream.allowTypeHierarchy(Entity.class);

return xStream;
}

2 changes: 1 addition & 1 deletion modules/global/src/com/haulmont/reports/bom.properties
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
# limitations under the License.
#

com.haulmont.yarg = 2.2.19
com.haulmont.yarg = 2.2.22
com.haulmont.yarg/yarg-api = ${com.haulmont.yarg}
com.haulmont.yarg/yarg = ${com.haulmont.yarg}

0 comments on commit 7d25d68

Please sign in to comment.