GeoNode / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
https://geonode.org/
Other
1.44k stars 1.13k forks source link

Implement the ResourceHandler concept #12456

Open giohappy opened 2 months ago

giohappy commented 2 months ago

Overview In GeoNode we're getting more and more resources that need specific handling based on several traits (the underlying model, the subtype, the source, etc.). The current approach where the resource logic is coupled to the underlying Django model is falling short.

We want to delegate more to the ResourceManager through a new ResourceHandler concept, similar to the handlers already implemented inside the importer and for assets.

Dispatching actions and requests to the ResourceHandler will be implemented using the same approach as the importer: an ordered list of ResourceHandlers will be iterated by the ResourceManager to elect the handler for the current resource. The first wins, so handlers must be ordered by decreasing specificity. For example, a handler for a Vector Datasetmust come first of the handler for a generic Dataset.

The first use case for ResourceHandlers will be delegating the calculation of download URLs and processing the download response. At the moment we have the following:

With ResourceHandlers