Hello Eric,

please check whether the issue concerns _any_ logged-in users or just administrators.

The default citation page functionality in DSpace prevents showing the cover page to administrators:

https://github.com/DSpace/DSpace/blob/dspace-7_x/dspace-api/src/main/java/org/dspace/disseminate/CitationDocumentServiceImpl.java#L267

I have used the following patch (not yet in Github but it's just a one-line modification) in our system that adds a new configuration option to enable cover page for admins that might be useful here. Alter the corresponding line in your CitationDocumentServiceImpl.java as follows:

boolean adminUser = authorizeService.isAdmin(context) && !configurationService.getBooleanProperty("citation-page.enable_for_admins", false);


and then add to e.g. citation-page.cfg:

citation-page.enable_for_admins = true


Cheers,
Miika

On 20.3.2025 7:43, Eric Montague wrote:
I applied https://github.com/DSpace/DSpace/pull/10354 to Dspace 8.1 running on Windows.
This fixed on-the-fly Citation Cover Page generation for *anonymous *users.
But cover page generation does not occur for*logged-in* users,
and no errors appear in the browser or the dspace log.

The dspace log extracts below, indicate that the code paths for anonymous and logged-in users
are slightly different.

Is this a bug?

... PDF Cover Page is not generated when logged in.
... Download PDF from Simple item page ...
*... When anonymous, PDF Cover Page is generated*
2025-03-1920:52:50,258INFO8ac89edb-e2e2-4b1c- a1c2-91869284fd9ec9f38e6a-8357-46f7-9e62-2ebc34551229
org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
@ Before request [GET /server/api] originated from /items/591f4c44- a037-4f6d-8f96-4a88f85aaf9d
2025-03-1920:52:52,536INFO unknown 3b6d8895-5f87-4308-b108-c2eefe068bab
org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
@ Before request [GET /server/api/core/ bitstreams/4d7d123e-1ba4-41bd-9d8e-e5c0effd6836/content]
originated from http://localhost:4000/
2025-03-1920:52:52,548INFO unknown 3b6d8895-5f87-4308-b108-c2eefe068bab
org.dspace.usage.LoggerUsageEventListener
@ anonymous::view_bitstream:bitstream_id=4d7d123e-1ba4-41bd-9d8e- e5c0effd6836
... When logged in, PDF Cover Page is not generated
025-03-1920:58:20,340INFO8ac89edb-e2e2-4b1c-a1c2-91869284fd9e4e3e76fc- d952-49e1-a09e-99bbc3fa3c07
org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
@ Before request [GET /server/api] originated from /items/591f4c44- a037-4f6d-8f96-4a88f85aaf9d
... This [POST] does not occur when anonymous
2025-03-1920:58:22,551INFO8ac89edb-e2e2-4b1c-a1c2-91869284fd9e78c8b40f- fc32-4c24-801b-772937a74b03
org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
@ Before request [POST /server/api/authn/shortlivedtokens]
originated from /bitstreams/4d7d123e-1ba4-41bd-9d8e-e5c0effd6836/download
2025-03-1920:58:22,780INFO unknown b8d3bde6-74bd-4e14-b9e4-fd714079a289
org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
@ Before request [GET /server/api/core/ bitstreams/4d7d123e-1ba4-41bd-9d8e-e5c0effd6836/content]
originated from http://localhost:4000/
2025-03-1920:58:22,788INFO unknown b8d3bde6-74bd-4e14-b9e4-fd714079a289
org.dspace.usage.LoggerUsageEventListener
@ ericmon...@comcast.net::view_bitstream:bitstream_id=4d7d123e-1ba4-41bd-9d8e-e5c0effd6836

Regards,

- eric

On 2/23/2025 3:14 PM, Nurminen, Miika wrote:
Hello Johannes,

if the problem is related to showing PDF in browser, there is a known issue (present in DSpace 7 and newer versions as well) related to content-length calculation that renders files with coverpages unreadable in browsers, even though downloading the file as attachment should work.

More details on the issue
https://github.com/DSpace/DSpace/issues/9665

And fixes for DSpace 7.x and 8.x
https://github.com/DSpace/DSpace/pull/9895
https://github.com/DSpace/DSpace/pull/10354


Best regards,
Miika Nurminen

On 20.2.2025 17:49, schul...@effective-webwork.de wrote:
P.S. I just tried enabling the on the fly Citation Cover Page generation in a DSpace 8 installation, and the same error occurs.

schu...@effective-webwork.de schrieb am Donnerstag, 20. Februar 2025 um 09:29:13 UTC+1:

    Hello,

    we recently did an update for a project from a 7.6.1 based DSpace to
    version 7.6.3. Everything seems to work fine, except for the
    Citation Cover Page generation. We use the variant where the
    Citation Cover Pages are generated on the fly during download.
    Instead of downloading or displaying the PDF files, the browser (or
    tools like Postman) just show "Failed to load PDF file".

    There are no errors in the logs and debugging leads to no exceptions.

    Is this a known problem or does anyone know a fix?

    Regards
    Johannes

--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx <https:// www.lyrasis.org/about/Pages/Code-of-Conduct.aspx>
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech+unsubscr...@googlegroups.com <mailto:dspace- tech+unsubscr...@googlegroups.com>. To view this discussion visit https://groups.google.com/d/msgid/ dspace- tech/00eb0c56-feb7-40ce-abcc-f48ac7bbd878n%40googlegroups.com <https:// groups.google.com/d/msgid/dspace-tech/00eb0c56-feb7-40ce- abcc- f48ac7bbd878n%40googlegroups.com? utm_medium=email&utm_source=footer>.


--
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/dspace-tech/ade02629-6d76-4d90-8dab-351edd1eb464%40gmail.com.

Reply via email to