Skip to content

Conversation

@ridoo
Copy link
Contributor

@ridoo ridoo commented Feb 21, 2025

Relates to #286

@ridoo ridoo added the enhancement New feature or request label Feb 21, 2025
@ridoo ridoo requested a review from mattiagiupponi February 21, 2025 16:50
@ridoo ridoo linked an issue Feb 21, 2025 that may be closed by this pull request
@ridoo
Copy link
Contributor Author

ridoo commented Feb 21, 2025

end2end test fails because of 4.4.x branch not in sync with this feature. Merge upstream first: GeoNode/geonode#12929

@ridoo
Copy link
Contributor Author

ridoo commented Mar 14, 2025

@mattiagiupponi any updates here? To make GeoNode/geonode#12929 work, the importer has to parse and pass the custom data to the resource manager.

@mattiagiupponi
Copy link
Contributor

Hi @ridoo I'll review it today, sorry for the waiting

@ridoo
Copy link
Contributor Author

ridoo commented Mar 14, 2025

No problem :) Just wanted to connect the dots

@mattiagiupponi
Copy link
Contributor

mattiagiupponi commented Mar 14, 2025

tested with this simple CURL and it worked as expected (file path should be update accordingly)

curl --location 'http://localhost:8000/api/v2/uploads/upload' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--header 'Cookie: sessionid=kalmpi10p4ovpzrhjko6tljhnnhhebss' \
--form 'zip_file=@"/C:/Users/mattia/Desktop/gis_data/shapefile/arm_admbnda_adm0_2019.zip"' \
--form 'base_file=@"/C:/Users/mattia/Desktop/gis_data/shapefile/arm_admbnda_adm0_2019.zip"' \
--form 'custom="{\"edition\": \"edition via api\", \"attribution\": \"abc123\", \"title\": \"title via api\"}"'

I'll make a test on my local to see if the tests passes

@mattiagiupponi
Copy link
Contributor

tested on local by updating the docker and works as expected, all the tests passes:

Updated Dockerfile

FROM geonode/geonode-base:latest-ubuntu-22.04
RUN rm -rf /usr/src/geonode
RUN git clone https://github.com/52North/geonode.git /usr/src/geonode
RUN cd /usr/src/geonode && git fetch --all && git checkout feature/12862_allow-to-add-metadata-when-uploading-a-resource && cd -
RUN mkdir -p /usr/src/importer

RUN cd ..
COPY . /usr/src/importer/
WORKDIR /usr/src/importer

RUN pip install -r /usr/src/geonode/requirements.txt
RUN pip install --upgrade  -e /usr/src/importer/
RUN pip install coverage

test results:

Ran 236 tests in 182.250s
ok

@giohappy giohappy merged commit 5e9e535 into GeoNode:master Mar 14, 2025
2 of 3 checks passed
@ridoo
Copy link
Contributor Author

ridoo commented Mar 27, 2025

@mattiagiupponi we would need this feature to be available for v4.4.x. At the moment v4.4.x references master instead of v1.1.x. Do you mind to integrate this PR for v1.1.x, too?

I know this repo becomes outdated once we move to GeoNode v5, but versioning downstream projects would be made a bit simpler/clearer then.

@mattiagiupponi
Copy link
Contributor

Done: #291

giohappy added a commit that referenced this pull request Dec 4, 2025
* [Fixes #273] connect resource with execution request

* Update README.md

* Update README.md

* store spacial file always true for cloning

* store spacial file always true for cloning

* fix build

* [Fixes #12763] 3D tiles geometricError mandatory field should be on t… (#279)

* [Fixes #12763] 3D tiles geometricError mandatory field should be on tileset level

ref to GeoNode/geonode#12763

* fix tests

* Update tests.py

* Update test_end2end.py

* fix test

* [Fixes #12789] Improve 3dtiles filename handling (#281)

* Fix migrations for asset (#283)

* Fix migrations for create handlerinfo via asset

* Fix migrations for create handlerinfo via asset

* [Fixes #286] Allow to add metadata when uploading a resource (#287)

* [Fixes #12828] New remote datasets are not registered inside proxy allowed hosts when GeoNode runs asynchoronously (#282)

* [Fixes #255] Fix encoding for Shapefile uploads (#289)

Use SHAPE_ENCODING parameter to inform the ogr2ogr command of the encoding for the Shapefile so it can transform accordingly.

* [FIXIES 13044] Remote WMS dataset store is not correct if uploaded via importer (#292)

* Update remote.py

* [FIXIES 13044] Remote WMS dataset store is not correct if uploaded via importer

* [Fixes #13451] broken upload datasets when asset have duplicated name from different users (#296)

---------

Co-authored-by: Giovanni Allegri <[email protected]>
Co-authored-by: Henning Bredel <[email protected]>
Co-authored-by: Peter Marlow <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 1.1.x enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to add metadata when uploading a resource

3 participants