Skip to content

Commit

Permalink
make citation servlet alt PID aware
Browse files Browse the repository at this point in the history
  • Loading branch information
qqmyers committed Feb 1, 2024
1 parent 8f0675c commit 6d4d394
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/CitationServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re

String persistentId = request.getParameter("persistentId");
if (persistentId != null) {
DvObject dob = dvObjectService.findByGlobalId(PidUtil.parseAsGlobalID(persistentId));
GlobalId pid = PidUtil.parseAsGlobalID(persistentId);
DvObject dob = dvObjectService.findByGlobalId(pid);
if (dob == null) {
dob = dvObjectService.findByAltGlobalId(pid, DvObject.DType.Dataset);
if (dob == null) {
dob = dvObjectService.findByAltGlobalId(pid, DvObject.DType.DataFile);
}
}
if (dob != null) {
if (dob instanceof Dataset) {
response.sendRedirect("dataset.xhtml?persistentId=" + persistentId);
Expand Down

0 comments on commit 6d4d394

Please sign in to comment.