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 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) or src/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.thumbnailfile_id is null, run the automatic thumbnail selection logic and persist the value of the file id to thumbnailfile_id. Progress in a66fce2.~ We decided not to to this after all.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 on imageDataBase64 and save them to disk. Use dataset_logo.thumb48 as the filename. Fixed in e7a429c.<h:graphicImage value=" to `<h:graphicImage url=" on dataset page. Fixed in ebfe4da.QUESTIONS
Out of scope:
image_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 on url="/api/datasets/#{result.entityId}/thumbnail" returning null in h: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 and dataset_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...thumbnailfile_id field from dataset table?~ We decided against this.getThumbnail logic, always copy the chose thumbnail to a consistent location, such as dataset_thumb48.png. For example, if DataFile 10.5072/FK2/MHWMM8/15ab8bd180d-a3cde4ffa854.thumb48 is selected, copy it to 10.5072/FK2/MHWMM8/dataset_thumb48.png. If a dataset logo 10.5072/FK2/MHWMM8/dataset_logo.thumb48 is selected, copy it to 10.5072/FK2/MHWMM8/dataset_thumb48.png.~ We decided against this.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.
We can quickly create mockups to get this ready for development by looking at the Theme + Widgets page for a dataverse, and applying that to this new workflow for a dataset.

I just mentioned to @pameyer that I would expect the image_url field in the Search API to continue to be populated for datasets that have the new alternative thumbnail (once it's developed). Here's how it looks:
"image_url":"https://demo.dataverse.org/api/access/dsCardImage/2"
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:

@mheppler I added some wireframes in 9c9025a but I could use some help cleaning up the UI as well as thinking about all the implications on the bundle properties and the names of xhtml files. Here's a screeshot of what I have so far. The branch is "3559-dataset-thumbnail".

First some terminology:
After standup yesterday, @scolapasta @landreev @mheppler @kcondon and I met and decided the following:
altthumbnail field on the dataset table idea I've been demoing, we'll store multiple resolutions of the dataset logo on the filesystem under, for example, /usr/local/glassfish4/glassfish/domains/domain1/files/10.5072/FK2/ZQJXKL in multiple resolutions with filenames like this:dataset_logo_thumbnail.jpgdataset_logo_thumbnail.jpg.thumb48dataset_logo_thumbnail.jpg.thumb64dataset_logo_thumbnail.jpg.thumb400In 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 https://github.com/IQSS/dataverse/issues/3559#issuecomment-277040204
Here's how the existing "Set Dataset Thumbnail" looks on the "Edit Files" page:

Mockup for new Select Dataset Thumbnail popup.

This morning I demo'ed the code as of 6911217 to @mheppler @pameyer @scolapasta @dlmurphy @landreev @jggautier and @sekmiller and here's the UI/UX stuff I'm going to work on next.
Once we get the UI/UX the way we want, @scolapasta @landreev and I plan to talk more back end implications including upgrade scenarios.
In b49388b I exposed the existing concept of a "Automatically Selected Thumbnail". Here's a screenshot:

@landreev and I agreed that a useGenericThumbnail might make sense to add. It's a way to tell Dataverse, "I don't want any of the automatic thumbnails from files in my dataset. Just give me a generic dataset icon."
@mheppler and I just talked through some rules we want:
I haven't implemented any of this stuff yet.
I just deployed d4bbcff to the dev1 server and gave @dlmurphy a walk through of the changes:
Next I plan to work on the concept of staging so that the Cancel button allows you to actually back out of changes. As of this writing the "Save Changes" button tells you you've updated the thumbnail but in truth it has already happened because the changes are not currently staged. I also added a boatload of API tests and all functionality is available via the API as well. I'm not sure if staging makes sense for the API or not.
Next I plan to work on the concept of staging so that the Cancel button allows you to actually back out of changes. As of this writing the "Save Changes" button tells you you've updated the thumbnail but in truth it has already happened because the changes are not currently staged.
This should be fixed as of 0e84f81. I still need to circle back to the "Edit Files" page mentioned above.
There's also more backend refactoring I'd like to do. For example, there are unsecured API endpoints that I'd like to have respect permissionsWrapper.canIssueCommand(dataset, UpdateDatasetCommand.class) like the dataset thumbnails page. Or I could hide these API endpoints behind the "admin" API if we don't think people will ever want to use them.
We just noticed a couple things from usability testing:
Update 2017-03-10: This list has been moved to the description above to avoid having to scroll around to find it. -- @pdurbin
Do we need to also add "changed dataset thumbnail" to the Dataset Version Differences summary and details?
@sekmiller not unless it is something that is saved in the metadata and versioned, which it is not at this time.
The biggest advantage of SVG (for this type of use) is resolution independence; my take is that this is less of an issue targeting desktop browsers than mobile browsers.
Usability testing recommendations from UX team:
Update: Just met with Mike and Julian. We've decided to table the recommendation on changing the "Edit Dataset" button (and other Edit buttons) for now due to some potential downsides to the change. We'll go over it again once Tania's in the office next week.
I just made pull request #3703 and put this issue in Code Review at https://waffle.io/IQSS/dataverse
Post-pull request To Do list:
<span class="icon-dataset text-info" logic is back, get REST Assured tests in SearchIT working again. Done in b587491@scolapasta @sekmiller @landreev and I discussed the code in pull request #3703 on Friday.
I believe the only thing left is that @landreev said he's like to get on the branch and look at how for datasets I removed the use of dvobjectThumbnailsMap and dvobjectViewMap.
I removed @sekmiller and myself from this issue. If there are any more changes required from either of us, please let us know. With or without the proposed change above, we are ready to advance this issue to QA.
Please note that the main entry point for QA should be the new "Thumbnails + Widgets" section of the Dataset + File Management page in the User Guide: https://github.com/IQSS/dataverse/blob/82b662f50614c86ecf04914ef3342911643b4d37/doc/sphinx-guides/source/user/dataset-management.rst#thumbnails--widgets
Updated todo list from @scolapasta after @sekmiller and I met with him just now:
Discussed:
@sekmiller
I'm done with the review (submitted it in the PR)
@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: UnirestException caught attempting to GET https://dataverse-internal.iq.harvard.edu/api/datasets/336/thumbnail and exception was: com.mashape.unirest.http.exceptions.UnirestException: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
When the error above is thrown, thumbnails do not appear on any methods that call DatasetUtil.getThumbnailImageString (search cards and dataset page).
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: