-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[Draft] Upgrade a GeoNode 4 to 5
mattiagiupponi edited this page Oct 22, 2024
·
2 revisions
- The importer has been merged inside GeoNode core, For geonode-projects the depencency with the geonode-importer must be removed
With the issue #12657 a new configuration for serving the configuration for the client is changed, this required some refactor on the handlers in detail:
- The internal
ACTIONS
attribute of the handler (the one which lists the tasks to be followed) is renamed intoTASKS
- The upload endpoint now requires an
action
parameter (previously source) which is used to get the tasks list - The
source
parameter of theExecutionRequest
is dropped - If the handler can manage the
replace
oroverwrite_existing_data
the keyreplace
must be available in theTASKS
list - The
IMPORT
key in theTASKS
has been renamed intoUPLOAD
So the expecting tasks list for an handler is something similar to this:
TASKS = {
exa.UPLOAD.value: (
"start_import",
"geonode.upload.import_resource",
"geonode.upload.publish_resource",
"geonode.upload.create_geonode_resource",
),
exa.COPY.value: (
"start_copy",
"geonode.upload.copy_dynamic_model",
"geonode.upload.copy_geonode_data_table",
"geonode.upload.publish_resource",
"geonode.upload.copy_geonode_resource",
),
ira.ROLLBACK.value: (
"start_rollback",
"geonode.upload.rollback",
),
ira.REPLACE.value: (
"start_import",
"geonode.upload.import_resource",
"geonode.upload.publish_resource",
"geonode.upload.create_geonode_resource",
),
}
- The
supported_file_extension_config
now expects a new format which must be follow. The keyext
andoptional
are dropped - New key named
formats
has been added, is a list of dictionary with three keys:label
(the label to be displayed in UI),required_ext
which rappresent the mandatory extension for the FE andoptional_ext
. - New
actions
key is added, contains all the ACTIONS available for the selected handler -
format
has been renamed intotype
For example:
Before:
@property
def supported_file_extension_config(self):
return {
"id": "geojson",
"label": "GeoJSON",
"format": "vector",
"ext": ["json", "geojson"],
"optional": ["xml", "sld"],
}
After:
@property
def supported_file_extension_config(self):
return {
"id": "geojson",
"formats": [
{
"label": "GeoJSON",
"required_ext": ["geojson"],
"optional_ext": ["sld", "xml"],
},
{
"label": "GeoJSON",
"required_ext": ["json"],
"optional_ext": ["sld", "xml"],
},
],
"actions": list(self.TASKS.keys()),
"type": "vector",
}
- (Formats configurations...)