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

Navigation - Harvested file landing page? #4288

Closed
mheppler opened this issue Nov 17, 2017 · 7 comments
Closed

Navigation - Harvested file landing page? #4288

mheppler opened this issue Nov 17, 2017 · 7 comments
Assignees
Labels
Type: Bug a defect

Comments

@mheppler
Copy link
Contributor

mheppler commented Nov 17, 2017

From a dataverse results card for harvested files, you can navigate to a file landing page for a harvest file by clicking on the file name link. This was found on production.

Because it is harvested and not local, this link should point to the external file pg, or if that doesn't exist, the external dataset pg.

screen shot 2017-11-17 at 11 42 22 am

screen shot 2017-11-17 at 11 39 16 am

@mheppler mheppler added the Type: Bug a defect label Nov 17, 2017
@mheppler
Copy link
Contributor Author

There is also a minor UI styling inconsistency between the harvested message on the file results card and the dataset results card.

screen shot 2017-11-17 at 11 45 04 am

@djbrooke
Copy link
Contributor

Thanks, good details. Moving to backlog for estimation and possible inclusion in a future sprint.

@jggautier
Copy link
Contributor

jggautier commented Nov 17, 2017

Issue related to this: The files of more recently harvested datasets are in an unpublished state, but the files of datasets harvested in April 2015 were "published". This is inflating miniverses "published" uploaded files count.

Edit: Or, if we mean to count file uploads of harvested datasets, then the counts have been suppressed.

@pdurbin
Copy link
Member

pdurbin commented Nov 17, 2017

Because it is harvested and not local, this link should point to the external file pg, or if that doesn't exist, the external dataset pg.

I agree that this is a bug (good catch, @mheppler ) and that the link the in search card should not keep the user on the installation of the Dataverse that has done the harvesting, but I suspect that it will be difficult to know if the remote harvested file has a file landing page or not so we should probably just link to the dataset landing page of the remote dataset. That is to say, it's possible to harvest from non-Dataverse systems that may not have a file landing page. Every system should have a dataset landing page.

@djbrooke djbrooke changed the title Navigation - Harvested file landing page? Navigation - Harvested file landing page Jan 3, 2018
@djbrooke djbrooke changed the title Navigation - Harvested file landing page Navigation - Harvested file landing page? Jan 3, 2018
@pdurbin
Copy link
Member

pdurbin commented Jun 22, 2018

Related (as @mheppler pointed out): #4771

@landreev
Copy link
Contributor

landreev commented Jun 27, 2018

Here's what's going on - please bear with me :)

I was assuming this was being fixed on the card level; i.e. by modifying the search card so that it doesn't try to send the user to the file page. But as I was working on the file page for the ids-for-files branch, I figured I would add a redirect there, just in case somebody tries to open the file landing page for a harvested file. The code I added there (see below) is 100% copy-and-pasted from the dataset page; where it's working just fine. I have no idea why it's resulting in an error. But yeah, since the card is still not fixed, we now have even more spectacular errors, when people try to click on the cards for harvested files.

The fix should be very straightforward though. Note that for harvested files we still redirect to the remote dataset-level url; (since most harvested files are not going to have dedicated file-specific pages on the original end). So all we need to do in the xhtml of the search fragment, is modify it so that it clicking on the file name does the same thing it's already doing when clicking on the dataset name...

Here's the code I copy-and-pasted from datasetPage.java and into filePage.java; if anyone knows why it's working in the former, but bombing in the latter - I'd be curious to know:

// Is the Dataset harvested?
            if (file.getOwner().isHarvested()) {
                // if so, we'll simply forward to the remote URL for the original
                // source of this harvested dataset:
                String originalSourceURL = file.getOwner().getRemoteArchiveURL();
                if (originalSourceURL != null && !originalSourceURL.equals("")) {
                    logger.fine("redirecting to "+originalSourceURL);
                    try {
                        FacesContext.getCurrentInstance().getExternalContext().redirect(originalSourceURL);
                    } catch (IOException ioex) {
                        // must be a bad URL...
                        // we don't need to do anything special here - we'll redirect
                        // to the local 404 page, below.
                        logger.warning("failed to issue a redirect to "+originalSourceURL);
                    }
                }

                return permissionsWrapper.notFound();
            }

landreev added a commit that referenced this issue Jun 27, 2018
…ry to send the user to the file page; it should always redirect to the dataset-level remote page at the original source of the harvested object. (#4288)
@landreev
Copy link
Contributor

@mheppler
Since I was already there, and the fix was only 2 xhtml lines - I went ahead and made a PR (#4787). I'm leaving it up to the team to decide what to do with it.

Also, since it was just one xhtml file, I took the liberty to just patch it in prod. Since those broken pages were kind of annoying. If that's a problem for whatever reason - it's just one file to un-patch: domain1/applications/dataverse-4.9/search-include-fragment.xhtml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug a defect
Projects
None yet
Development

No branches or pull requests

6 participants