Uploaded image for project: 'Celum DAM Connector '
  1. Celum DAM Connector
  2. CELUM-51

Make parent folder lazy loaded when instantiating a CelumAsset

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 1.0.5
    • 1.0.4
    • None

      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

              rfalvo Raphael Falvo
              rfalvo Raphael Falvo
              Services
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:
                Work Started: