Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,20 @@ protected MarkupContainer createRegularFrame() {
return createShallowRegularFrame();
}

val scalarModel = scalarModel();
val attributeModel = scalarModel();

val regularFrame = new WebMarkupContainer(ID_SCALAR_IF_REGULAR);

var documentUrl = urlFor(
new ListenerRequestHandler(
new PageAndComponentProvider(getPage(), this)))
// adds a hash to the URL, such that browser caching works as desired
+ "&md5=" + blob.md5Hex();
val pdfJsConfig =
scalarModel.getMetaModel().lookupFacet(PdfJsViewerFacet.class)
attributeModel.getMetaModel().lookupFacet(PdfJsViewerFacet.class)
.map(pdfJsViewerFacet->pdfJsViewerFacet.configFor(buildKey()))
.orElseGet(PdfJsConfig::new)
.withDocumentUrl(urlFor(
new ListenerRequestHandler(
new PageAndComponentProvider(getPage(), this))));
.withDocumentUrl(documentUrl);

val pdfJsPanel = new PdfJsPanel(ID_SCALAR_VALUE, pdfJsConfig);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import java.io.File;
import java.io.Serializable;
import java.time.Duration;
import java.util.List;
import java.util.Optional;
import java.util.OptionalInt;
Expand Down Expand Up @@ -651,6 +652,7 @@ public void fileDownloadClickHandler(final IModel<File> model, final CommonMimeT
RequestCycle.get().scheduleRequestHandlerAfterCurrent(
Wkt.fileResourceStreamRequestHandler(file, mime)
.setFileName(fileName)
.setCacheDuration(Duration.ZERO)
.setContentDisposition(ContentDisposition.ATTACHMENT));
}

Expand Down