-
Improvement
-
Resolution: Fixed
-
Neutral
-
1.0.4
-
None
-
-
Empty show more show less
Message from Stefan on slack union-investment-collab channel, march 24th 2023:
How can we make use of the publicURL without a celum connection? Currently, as soon as you access a CelumAsset a connection is established and without it, no access to the PublicURL via the asset interface.
I got this code reference of us, where we call getAsset(), which is doing the celum call
public Optional<String> createAssetLink(final String itemKey) { final Predicate<String> isNotAnUrl = string -> !UrlValidator.getInstance().isValid(string); return Optional.ofNullable(itemKey) .filter(StringUtils::isNotBlank) // The isNotAnUrl Predicate is an ugly hack for the hotfix. It's needed because Magnolia's // ItemKey::isValid says, that an URL is a valid ItemKey, which is actually wrong. // A support ticket has been created at Magnolia: SUPPORT-16075 .filter(isNotAnUrl) .filter(ItemKey::isValid) .map(this.damTemplatingFunctions::getAsset) .map(Asset::getLink); }
Main problem is when we do get asset we always check to set the parent folder, we need to find a clean way for this implementation
Let's try making it lazy loaded, only call Celum to fetch the parent when parent is really needed.
Acceptance criteria
- relates to
-
CELUM-56 getWidth throws NullPointerException when Celum can't be reached or the celum id is invalid
- Closed