Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #305

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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'])
Expand Down
11 changes: 5 additions & 6 deletions modules/core/src/com/haulmont/reports/ReportImportExport.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);

Expand All @@ -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);
Expand Down Expand Up @@ -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();
Expand All @@ -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());
Expand Down
5 changes: 2 additions & 3 deletions modules/core/src/com/haulmont/reports/ReportingBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
Expand All @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion modules/global/src/com/haulmont/reports/bom.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down