Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets: link generation #12341

Closed
etj opened this issue Jun 19, 2024 · 0 comments · Fixed by #12338
Closed

Assets: link generation #12341

etj opened this issue Jun 19, 2024 · 0 comments · Fixed by #12338
Assignees

Comments

@etj
Copy link
Contributor

etj commented Jun 19, 2024

According to #12226:

Note that http://server/api/v2/assets/10/link/myindex will return the same content as http://server/api/v2/assets/10/link

The current implementation will create the Asset link as http://server/api/v2/assets/10/link
In the general case, the backend is quite free to decide what to return (the current and simpler implementation is to return the first file in Asset.location. This is ok in the general case, but in case where the asset data is a directory, the returned file is usually an index file.
When using and index file the client usually splits the URL in BASE_PATH/INDEX_FILE, so that when the index file references a file "XYZ" the client builds the URL BASE_PATH/XYZ
This means that for these Assets the link should have the file explicitly in the URL.

In the AssetHandler we may implement a method to get a link generator handler which returns the specific way to create the link.
The initial implementation may have a simple registering mechanism that can be easily extended or configured in settings.

@etj etj self-assigned this Jun 19, 2024
etj added a commit that referenced this issue Jun 19, 2024
etj added a commit that referenced this issue Jun 19, 2024
mattiagiupponi added a commit that referenced this issue Jun 20, 2024
* [Fixes #12341] Download handler fix
* [Fixes #12341] Assets: link generation (#12342)
---------

Co-authored-by: Emanuele Tajariol <etj@geo-solutions.it>
@mattiagiupponi mattiagiupponi linked a pull request Jun 20, 2024 that will close this issue
12 tasks
giohappy pushed a commit that referenced this issue Jul 3, 2024
* [Fixes #12341] Download handler fix
* [Fixes #12341] Assets: link generation (#12342)
---------

Co-authored-by: Emanuele Tajariol <etj@geo-solutions.it>
giohappy pushed a commit that referenced this issue Sep 24, 2024
…2411)

* [Fixes #12124] GNIP 100: Assets (#12335)

* [Fixes #12124] GNIP 100: Assets
---------

Co-authored-by: etj <e.tajariol@gmail.com>

* [Fixes #12226] Directory assets (#12337)

[Fixes #12226] Directory assets
---------
Co-authored-by: etj <e.tajariol@gmail.com>

* [Fixes #12341] Asset download handler and link generator (#12343)

* [Fixes #12341] Download handler fix
* [Fixes #12341] Assets: link generation (#12342)
---------

Co-authored-by: Emanuele Tajariol <etj@geo-solutions.it>

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] rollback requirements

---------

Co-authored-by: etj <e.tajariol@gmail.com>
Co-authored-by: Emanuele Tajariol <etj@geo-solutions.it>
giohappy pushed a commit that referenced this issue Sep 24, 2024
…2411)

* [Fixes #12124] GNIP 100: Assets (#12335)

* [Fixes #12124] GNIP 100: Assets
---------

Co-authored-by: etj <e.tajariol@gmail.com>

* [Fixes #12226] Directory assets (#12337)

[Fixes #12226] Directory assets
---------
Co-authored-by: etj <e.tajariol@gmail.com>

* [Fixes #12341] Asset download handler and link generator (#12343)

* [Fixes #12341] Download handler fix
* [Fixes #12341] Assets: link generation (#12342)
---------

Co-authored-by: Emanuele Tajariol <etj@geo-solutions.it>

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] rollback requirements

---------

Co-authored-by: etj <e.tajariol@gmail.com>
Co-authored-by: Emanuele Tajariol <etj@geo-solutions.it>
giohappy added a commit that referenced this issue Sep 24, 2024
…2411) (#12611)

* [Fixes #12124] GNIP 100: Assets (#12335)

* [Fixes #12124] GNIP 100: Assets
---------



* [Fixes #12226] Directory assets (#12337)

[Fixes #12226] Directory assets
---------


* [Fixes #12341] Asset download handler and link generator (#12343)

* [Fixes #12341] Download handler fix
* [Fixes #12341] Assets: link generation (#12342)
---------



* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] rollback requirements

---------

Co-authored-by: mattiagiupponi <51856725+mattiagiupponi@users.noreply.github.com>
Co-authored-by: etj <e.tajariol@gmail.com>
Co-authored-by: Emanuele Tajariol <etj@geo-solutions.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant