OneZoom / OZtree

OneZoom Tree of Life Explorer
Other
90 stars 20 forks source link

Rework tour DB schema #536

Closed lentinj closed 2 years ago

lentinj commented 2 years ago

There currently exists a DB schema and controllers using it, these should be considered dead.

There should be a minimal getter / setter for tour JSON documents, as illustrated by the example:

https://github.com/OneZoom/OZtree/blob/edcd6408065d5e2ba3bb25b1b735032c4844806b/OZprivate/rawJS/OZTreeModule/src/tour/Tour.js#L25-L154

The internal structure should allow for:

lentinj commented 2 years ago

Do we want to replace "update_class" with a server side templating engine, and return HTML chunks for tourstops? Lots of advantages:

...but OTOH means that the getter / setter API won't deal in identical documents; the output will have additional HTML you won't get to set.

EDIT: Server-side templating at least worth trying and seeing if it's got legs. Having templates stored on filesystem is a good way of gatekeeping the HTML that ends up on our site (anyone who wants to customise could just run their own docker image)

lentinj commented 2 years ago

What's a better way of handling translations?

  1. Tours have a native language, separate tours for each language. Use existing web2py translation engine to try and translate.
  2. Embedded translations in the tours, our own translation engine
  3. Make any phrases in user-generated tours available in the future Volunteer page for translations

I'm tempted to assume (1) for now, then hook into the volunteer translation engine when available to translate tours. When available we'd still need a native language for the tour anyway, so the data structures don't change.

EDIT: Me & James agree with the above. (2) is silly.

lentinj commented 2 years ago

What visibility controls do we need for a tour?

Are there more/less?

lentinj commented 2 years ago

Do we need to have provision for a thumbnail for a tour? Either of a species or custom image?

(if we did, where would we show it?)

lentinj commented 2 years ago
lentinj commented 2 years ago
lentinj commented 2 years ago

Image & A/V asset ownership / rights information:

Do we want to offer upload of images, at risk of moderation woes? Probably worth the risk, but a separate tool to upload and include a URL.

lentinj commented 2 years ago

What if a tour requires particular visulisation shape / colour scheme / etc settings?

Is it restricting (you only see that tour if that mode is set), or do you switch and switch back?

lentinj commented 2 years ago

We need a slot for highlighting colours, a la common ancestor highlighting.

We also need to show the highlights at start of transition as well as the start of a tourstop

lentinj commented 2 years ago

We already have "transition_in_visibility": "show_self" and other values, specifying at what point we show the TourStop

lentinj commented 2 years ago

pos: {xp:, yp:, zp:} doesn't seem to be used. As a result we'd like to ditch it.

We later on will want more flexible into_node-ness: #541

lentinj commented 2 years ago

Tours should have an image, whether it displays in search results or not, it will at least need to display something when a tour is used in popular places.

This should be a URL field, not just a pic_src/id, since there's no OTT image for a dinosaur, e.g.

See: https://github.com/OneZoom/OZtree/issues/545

jrosindell commented 2 years ago

Do we need to have provision for a thumbnail for a tour? Either of a species or custom image?

(if we did, where would we show it?)

I think we do need this yes and it would be used in the ribbon and (later) in the search results if we end up revamping the search to put icons for search results - we'll see what UX say about that. In any case I think it's good for the schema to allow for such a thumbnail as we may also use it to promote a tour through other channels.

I see @lentinj allows for a URL which is fine because the URL could be to an asset on our own server if we're doing it like that.

jrosindell commented 2 years ago

Do we want to offer upload of images, at risk of moderation woes? Probably worth the risk, but a separate tool to upload and include a URL.

I think yes and have commented on this in #601 - at present there are no third party tours and it's not part of the present project so moderation not yet a concern. What is a concern is knowing the tours we create ourselves can be reliably offered into the future because we have our own copies of all the necessary assets.

jrosindell commented 2 years ago

Probably I just have a poor memory but are the JSON instructions being dismantled and injected into the database then re-built when needed? If this is the case then should there be some simple script to validate a JSON before it gets put in the DB?

lentinj commented 2 years ago

are the JSON instructions being dismantled and injected into the database then re-built when needed?

Ish. All tour and tourstop fields are represented in the DB schema (and hence validated by it), however template_data is stored/restored as-is. Nothing will validate that these are structured as the template expects.

If this is the case then should there be some simple script to validate a JSON before it gets put in the DB?

I had been wondering about a JSON schema for the tours, both for validation and documentation of the format. However, this isn't something web2py includes support for.

We'd have to code it in python within controllers/tour, which wouldn't be the end of the world, but won't be as readily accessible as documentation.

lentinj commented 2 years ago

This ticket has grown unwieldy, so breaking out the remaining problems: