[MGNLDAM-503] option to get url for an asset in dam Created: 20/Aug/14  Updated: 23/Aug/22

Status: Open
Project: Magnolia DAM Module
Component/s: None
Affects Version/s: 2.0.2
Fix Version/s: None

Type: New Feature Priority: Neutral
Reporter: Tomáš Gregovský Assignee: Antti Hietala
Resolution: Unresolved Votes: 1
Labels: blocked
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File copy-url-action.png    
Issue Links:
dependency
Template:
Acceptance criteria:
Empty
Date of First Response:
Epic Link: Align references and links implementations
Story Points: 5
Team: AuthorX

 Description   

Requirement: get the public URL to an asset (image, document) in DAM.

Use cases:

  • Use an image in external page such as in an email.
  • Feed document URLs to a search engine to index the document content.
  • Feed a DAM folder URL to a search engine to index the content of documents in that folder.

Obstacles today:

  • Today there is no easy way to get link to an asset. I want to do this directly in the Assets app. There should be a way to copy the asset link to the clipboard when browsing assets and when previewing an asset.
  • Even if you remove ".imaging/portrait", cache extension and add "jcr:" in front of uuid in the current URL you cannot get a link because the uuid is different.
  • The Download asset action is not a button you could right-click and copy the link. It's just a <span> probably handled by Vaadin. The image preview in Edit asset dialog is something else with a different URL which includes "...APP/connector..."

To work around the requirement I had to create new page and put there download links to my asset and then copy URLs from this page. I don't think so that this is most user friendly option :/

Only to be able copy link from "download asset" button will be enough
thnx



 Comments   
Comment by Mikaël Geljić [ 16/Mar/17 ]

From DamDownloadServlet Javadoc:

This servlet supports the following link patterns:

  • /dam/jcr:7ecd4045-45a0-4c81-b2b6-f4c4b0cd24ad/<whatever, this is ignored anyway>
  • /dam/static:7ecd4045-45a0-4c81-b2b6-f4c4b0cd24ad (compatible with dms)
  • /dam/foo/bar/lol.pdf (compatible with dam 1.x)
  • /dam/jcr/foo/bar/lol.pdf (so /dam/<provider-id>/<path>.ext: we ignore .ext and ensure that the corresponding provider is a PathAwareProvider

The latter might be of interest to you tgregovsky Is it perhaps a problem of documentation or are there any shortcomings with that?

While we're at it (cc pmundt, ejervidalo), I just realized the DamDownloadServlet is mapped to /dam, which got me curious about URI2Repo mappings... Turns out the dam one is still there (also mapped to /dam fwiw), but it will simply never be called.
Ever since DAM 2.0, the servlet is the way to go, as it's provider-agnostic, but we should decommission the DamURI2RepositoryMapping then.

Comment by Tomáš Gregovský [ 23/Mar/17 ]

originally I just wanted to see a direct url of an asset (in dam) which I can copy paste without having to write (copy paste parts of it and build) url by myself... I can do it, but editors can't in case they need direct link to an asset.

(maybe optionally only if asset is published and with prefix to public instance - so I will have full public url)

But on suggestion above I am fan of third one ('/dam/foo/bar/lol.pdf') ...

Comment by Antti Hietala [ 23/Mar/17 ]

Let's start by providing a user action to copy the relative asset path in a human-readable format. Getting an absolute public URL requires knowing the defaultBaseUrl of the relevant public instance, which might be difficult to impossible to resolve in a multisite setup that has multiple public instances and various domains. The author who wants to copy the asset URL is typically working on an author instance that has a different defaultBaseUrl.

Next steps:

  • In Assets browser subapp:
    • Add a new "Copy asset URL" action in the action bar.
    • Place the action below the "Download asset" action.
    • Use the icon-link icon for the action.
    • When the user clicks the action, resolve a relative path to the selected asset such as /dam/jcr/foo/bar/lol.pdf using the DamDownloadServlet.
    • The action should only be available for single selection, not multiple assets.
    • Copy the URL to the clipboard.
  • In Assets detail subapp:
    • Add a new field "URL" in the asset details, above the Identifier field.
    • Display the relative path in the field.
    • Help text: "A relative path to the asset. To get a public URL, add the address of your public instance at the beginning of the path."
  • Validate UX.
  • Validate language.
Generated at Mon Feb 12 05:00:29 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.