Skip to content

Implement document replacement for GeoNode #2616

Description

@dsuren1

Currently only datasets can be replaced.
We want to implement replacement also for documents.

  • Frontend:
    • Implement the Replace dialog for documents (fig.1)
    • Add "Update Document" entry to the Edit menu of Documents (fig.2)

fig.1:
Image

fig.2:
Image

API examples

document upload:

curl -u admin:admin -X POST "$SITEURL/uploads/upload" \
  -F "base_file=@report.pdf" \
  -F "action=document_upload"
# -> 201 {"execution_id": "<uuid>"}

remote document (doc_url, no file):

curl -u admin:admin -X POST "$SITEURL/uploads/upload" \
  -F "url=https://example.org/report.pdf" \
  -F "action=document_upload"

Replace

curl -u admin:admin -X POST "$SITEURL/uploads/upload" \
  -F "base_file=@report_v2.pdf" \
  -F "resource_pk=<doc_id>" \
  -F "action=document_replace"

Clone

curl -u admin:admin -X PUT "$SITEURL/api/v2/resources/<doc_id>/copy" \
  -H "Content-Type: application/json" \
  -d '{"action": "document_clone"}'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions