Skip to content

Implementation of a common ResourceManager base class for all resource types #14035

@sijandh35

Description

@sijandh35

Description

Currently in GeoNode, resource creation, update, and related lifecycle operations are handled in different places across the codebase.

Some resource types, especially datasets, already use ResourceManager, while other resource types still implement their creation/update logic directly inside REST API views, for example DocumentViewSet.perform_create and MapViewSet.perform_create.

This makes common logic duplicated across different parts of the codebase. If something common needs to be added it should be added in different parts currently.

Create/update/delete operations on the resource should be handled by Resource Managers. REST APIs should use these classes to perform such operations, instead of performing them directly; otherwise, these operations cannot be executed outside REST API calls.

Current situation

  • Datasets already use ResourceManager, especially through create and update
  • Other resource types still rely on create / update logic implemented directly in REST APIs.
  • In some cases, post_save() has been used as a workaround to run shared processing after creation, for example resourcebase_post_save(...).

Problems

  • If logic stays inside API views, it cannot be reused consistently from non-API code paths
  • Common logic is duplicated across different parts of the codebase
  • Any shared change must currently be repeated in multiple resource-specific implementations

Goal

Introduce a centralized resource management flow so that:

  • all resource types use manager-based handling
  • common logic is defined once and reused
  • APIs delegate to resource managers instead of implementing resource lifecycle directly
  • the same behavior is available consistently from API and non-API code paths

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions