Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-11504

BundleResource fallback sling:resourceType should be consistent with JcrNodeResource

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • Bundle Resource 2.3.4
    • None
    • None
    • None

    Description

      Background:

      We work on Sling based CMS - https://www.websight.io . One of our current goals is to move /apps and /libs folders into bundle resources and get rid of JCR based sling scripting and configurations (JCR Installer). This is an alternative approach to CompositeNodeStore usage in order to support containerized environments, blue-green deployments, and separation of code, configuration, and data.

      To achieve this, we move components (and dialogs) definitions from JCR into bundles and make them work with the same APIs (like Sling Resource Merger).

       

      The problem:

      JcrNodeResource and BundleResource use different mechanisms for calculating fallback sling:resourceType

      It results in a different contract, in particular, it’s impossible to declare BundleResource with no sling:resorurceType property. The result can be observed in the following Groovy Script execution, where both nodes have no sling:resourceTypes declared:

      Incompatible BundleResource and JCRNodeResource contracts requires workarounds in multiple APIs (our internal APIs / SlingResource Merger API) or to do workarounds at the data level.

       

      Proposed solution:

      I can reimplement BundleResource, so that sling:resourceType is calculated in the getter. This will result in a valid getResourceType() method contract with the possibility of having null sling:resourceType resource property.

      Attachments

        1. Screenshot 2022-07-29 at 17.35.04.png
          830 kB
          Michal Cukierman
        2. image-2022-07-29-16-47-41-320.png
          107 kB
          Michal Cukierman

        Issue Links

          Activity

            People

              Unassigned Unassigned
              michalcukierman Michal Cukierman
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m