-
Notifications
You must be signed in to change notification settings - Fork 500
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
Allow users to upload a file to use as a dataset thumbnail #3559
Comments
Is there background info for this request? |
@TaniaSchlatter yes! This came out of a meeting yesterday with @pameyer @djbrooke @scolapasta and myself. Notes are at https://docs.google.com/document/d/1Cp0myGJKAMWQLIT8wHE8JLitUOsySUM0S7yQ_rx4Cgw/edit?usp=sharing and this specific item appears as "dataset logo" at https://docs.google.com/a/hkl.hms.harvard.edu/document/d/1idgIT_BOOGDuhR5j9RSOi-3NdrPhRS60N2O953LvzVM/edit?usp=sharing |
Disciplines that will be supported as part of the SBGrid grant require that the collections of files in a dataset remain intact and untouched by any process. If a structural biologist wants to add a cool thumbnail to show off the nature of her dataset, she's currently not able to do so because adding that file for thumbnail purposes would change the nature of the dataset. |
I just mentioned to @pameyer that I would expect the
That's from http://guides.dataverse.org/en/4.6/api/search.html#advanced-search-example |
Some tasks we identified in sprint planning today:
|
Discuss this feature quickly with @pdurbin and @pameyer to review a mocked up workflow (see attached) that is based off how we upload logos for a dataverse. Here are some decisions we've come to about it.
Question to be answered:
|
First some terminology:
After standup yesterday, @scolapasta @landreev @mheppler @kcondon and I met and decided the following:
In addition, Mike and I have been talking about wanting something along these lines:
I've already uploaded a screenshot of a early "Dataset Thumbnail + Widgets" prototype at #3559 (comment) Here's how the existing "Set Dataset Thumbnail" looks on the "Edit Files" page: |
…humbnail popup on the Thumbnail + Widgets pg. [ref #3559]
@sekmiller |
@kcondon heads up that I just opened #3671 with @sekmiller looking over my shoulder as I took screenshots and added it to the description of this issue as out of scope. |
I added some more logging in c7aba71 to DatasetUtil and now I'm seeing this error on dataverse-internal: When the error above is thrown, thumbnails do not appear on any methods that call DatasetUtil.getThumbnailImageString (search cards and dataset page). |
Avoid "UnirestException: javax.net.ssl.SSLHandshakeException" by not using Unirest (or any Java HTTP client) from any backing beans.
After discussing with @scolapasta in 9ddd0a4 I went ahead and ripped out the slightly-odd concept of having backing beans call new Dataverse API. No more Unirest, so no more UnirestException. I doubt @sekmiller will have a problem with this since he and I already discussed how we already have the dataset in our hands on the dataset page. Likewise, @landreev and I talked about how there's already a lookup of a dataset happening in the new thumbnail API, so in that last commit we are moving that lookup to the SearchServiceBean. @scolapasta points out that there's the potential for a performance hit in adding the lookup to the SearchServiceBean in the sense that around 4.2 we introduced a multi-phase/multi-pass approach to showing thumbnails and now the dataset thumbnails will have the expense of looking up the dataset in phase 1 rather than phase 2. I suspect the performance will be good enough but we can revisit if necessary. @kcondon I already ran a build on dataverse-internal. Thanks for finding that bug. Dataset thumbnails no longer care about "siteUrl" as of this fix I just made. |
Found a couple issues:
|
Also document that the following config options are in bytes: - dataverse.dataAccess.thumbnail.image.limit - dataverse.dataAccess.thumbnail.pdf.limit
Return quickly to decide to render the "Select Available File" button.
Currently, users can select one of the files in a dataset to serve as a thumbnail for a dataset. This is selected by editing the metadata for a file.
Instead of selecting a file that's part of the dataset, allow a user to upload a file to serve as the thumbnail.
To do list
To anyone who picks up items on the to do list below, please ensure that all the tests in SearchIT.java continue to pass. The code is in the
3559-dataset-thumbnail
branch.src/main/java/edu/harvard/iq/dataverse/dataaccess/DataFileConverter.java
(existing) orsrc/main/java/edu/harvard/iq/dataverse/DataFileConverter.java
(new in this branch) because this is a code smell: http://stackoverflow.com/questions/6647510/bad-practice-to-have-two-classes-of-the-same-name-in-different-packages/6647540#6647540 . Renamed in 36e359f.WhenWe decided not to to this after all.thumbnailfile_id
is null, run the automatic thumbnail selection logic and persist the value of the file id tothumbnailfile_id
. Progress in a66fce2.sizeLimit="500000"
from UI to a method on SystemConfig and write a failing test in SearchIT to exercise it.save
logic in DatasetWidgetsPage in command similar to UpdateDataverseThemeCommand or in a service bean to be re-used by the API. Done in db1c03e."data:image/png;base64," + imageDataBase64
on the fly, generate thumbnails based onimageDataBase64
and save them to disk. Usedataset_logo.thumb48
as the filename. Fixed in e7a429c.image_url
from Search API results no longer yields a downloadable image #3616 was opened to address it some day). Started in 56c33cf. Will be secured as part of an item below. It's only for datasets, not dataverses or files.<h:graphicImage value="
to `<h:graphicImage url=" and use the new API endpoint for datasets that returns the thumbnail. Fixed in 671bb9b.Save original uploaded resolution, respecting the file size limit. This is for someday supporting more than just the 48x48 resolution.(We decided not to do this.) Currently it becomes a zero byte file after it's converted to a thumbnail. Either delete the file or save the original properly (doesn't matter). Dataset logo (original file uploaded) is being deleted after a thumbnail has been created as of 74fba36.permissionsWrapper.canIssueCommand(dataset, UpdateDatasetCommand.class)
). Write tests to ensure security. Done as of b043eb8.<h:graphicImage value="
to<h:graphicImage url="
on dataset page. Fixed in ebfe4da.QUESTIONS
Add functionality to allow SVG file types Dataverse Theme + Widgets - Support SVG upload for Logo Image #2843Out of scope for this issue.Out of scope:
image_url
from Search API results no longer yields a downloadable image #3616image_url
from Search API results no longer yields a downloadable image<span class="icon-dataset text-info"
for on search-include-fragment and datasets.xhtml. Figure out how to implement a render based onurl="/api/datasets/#{result.entityId}/thumbnail"
returning null inh:graphicImage
. Try http://stackoverflow.com/questions/25570159/how-to-render-pgraphicimage-conditionally-depending-on-if-the-resource-exists/25570339#25570339 .dataset_logo_thumbnail.png.thumb64
anddataset_logo_thumbnail.png.thumb400
versions for future use. @TaniaSchlatter has some thoughts on placement of the thumbnail on the dataset page (make consistent with search cards) but didn't mention wanting a larger thumbnail.useGenericThumbnail
boolean or not?This is probably due the the dev1 server not having the Weld patch applied...
(Usability testing recommendations TBD)(see Allow users to upload a file to use as a dataset thumbnail #3559 (comment) )Remove existingWe decided against this.thumbnailfile_id
field fromdataset
table?SUGGESTION: In order to simply theWe decided against this.getThumbnail
logic, always copy the chose thumbnail to a consistent location, such asdataset_thumb48.png
. For example, if DataFile10.5072/FK2/MHWMM8/15ab8bd180d-a3cde4ffa854.thumb48
is selected, copy it to10.5072/FK2/MHWMM8/dataset_thumb48.png
. If a dataset logo10.5072/FK2/MHWMM8/dataset_logo.thumb48
is selected, copy it to10.5072/FK2/MHWMM8/dataset_thumb48.png
.The text was updated successfully, but these errors were encountered: