AtlasOfLivingAustralia / dashboard

Atlas Dashboard
https://dashboard.ala.org.au
3 stars 13 forks source link

Project setup: /data/dashboard/data.json file #84

Open reupost opened 6 years ago

reupost commented 6 years ago

This is probably not a bug, so apologies for posting this here.

I'm trying to set up the project, but I'm getting the following error when it runs: INFO --- [nio-8080-exec-1] g.a.s.au.org.ala.dashboard.CacheService : loading static data from file ERROR --- [nio-8080-exec-1] g.a.s.au.org.ala.dashboard.CacheService : There was a problem retrieving the dashboard data for key info: /data/dashboard/data.json (No such file or directory) INFO --- [nio-8080-exec-1] g.a.s.a.o.ala.dashboard.MetadataService : looking up duplicate_status, URL: https://records-ws.nbnatlas.org/occurrences/search?q=*:*&pageSize=0&fsort=count&facets=duplicate_status ERROR --- [nio-8080-exec-1] g.a.s.au.org.ala.dashboard.CacheService : There was a problem retrieving the dashboard data for key duplicate_status: Cannot get property 'count' on null object ERROR --- [nio-8080-exec-1] .a.c.c.C.[.[.[.[grailsDispatcherServlet] : Servlet.service() for servlet grailsDispatcherServlet threw exception

Is there a data.json file I need to create, and if so what format would it have? As you can see, I've tweaked the configuration to point to our version of biocache, and this seems to return the right content for e.g. duplicate_status.

Thanks for any help.

mbohun commented 6 years ago

an example of that file used to be at resources/data.json: https://github.com/AtlasOfLivingAustralia/dashboard/blob/5c18529651a4c8aaad876560fceec65062a8acf6/resources/data.json

reupost commented 6 years ago

Thanks, that did help - but I'm still a bit stuck :/. I think we may be on a different version of the biocache service, because the results for duplicate_status don't include the D and R facets, which MetadataService.getTotalAndDuplicates() doesn't like. So I still get an error, but not if I point it at the ALA biocache service.

This works fine: https://biocache.ala.org.au/ws/occurrences/search?q=*:*&pageSize=0&fsort=count&facets=duplicate_status

But this breaks: https://records-ws.nbnatlas.org/occurrences/search?q=*:*&pageSize=0&fsort=count&facets=duplicate_status

I'll try to figure things out a bit more and open a separate issue if needs be.

reupost commented 6 years ago

Is there an easy way to figure out how to add terms to the data.json file so that more data is cached? At the moment I have the project running but its very slow since its using the ALA APIs to pull down statistics, but not putting them in the cache, so it gets them from scratch each time. The only things that are cached are the items already listed in the data.json file, i.e. taxaCounts, collections, bhlCounts, boldCounts, identifyLife and volunteerPortalCounts. I've added empty keys for e.g. basisOfRecord to the data.json file, but they don't get populated, and I don't what specific subkeys they might need to be recognised.