Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-8381

Link conversion logic should be moved elsewhere

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Do
    • Neutral
    • None
    • None
    • None
    • None

    Description

      info.magnolia.jcr.util.ContentMap.getNodeProperty(String) method contains a conversion logic for those values matching an UUID pattern:

      info.magnolia.jcr.util.ContentMap (221)
      else if (LinkUtil.UUID_PATTERN.matcher(prop.getString()).find()) {
                          try {
                              return info.magnolia.link.LinkUtil.convertLinksFromUUIDPattern(prop.getString());
                          } catch (LinkException e) {
                              log.warn("Failed to parse links with from {}", prop.getName(), e);
                          }
      }
      

      It would be good to separate this specific logic to another class whose purpose would be link management instead of having it in ContentMap.

      When JcrAssetProvider is customized/extended, it results in a wrong links as info.magnolia.jcr.util.ContentMap.getNodeProperty(String) method contains a conversion logic for those values matching an UUID pattern. Therefore, it will be needed moving this conversion logic outside info.magnolia.jcr.util.ContentMap or configurable so it can be disabled.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                sang.ngo Sang Ngo Huu
                jayala Jonathan Ayala
                Nucleus
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Task DoD