Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3
    • Component/s: JCR
    • Labels:
      None

      Description

      As discussed on the dev-list [1], resource type inheritance for script/servlet resolution should be implemented as follows:

      • define an optional property sling:resourceSuperType which may take a resource type used as
        the super type of a resource type. This property is stored at the node where the scripts
        are located for the resource type or at the node itself. (see below)
      • the resourceSuperType of a property resource is the resourceSuperType of the parent node
        plus the property name.
      • define a sling:ResourceSuperType mixin node type, which defines the sling:resourceType
        property for it to be attachable to any node.
      • Add Resource.getResourceSuperType() returning the super type of the resource type or
        null if no such super type exists.
      • Add support to the Servlet Resolver to resolve scripts not just for the resource type but also
        for the super type (if defined). This super type resolution takes place before falling back
        default scripts !

      Sample:

      /
      +--- types
      +--- type1
      +--- type2
      +--- sling:resourceSuperType = type1
      +--- type3
      +--- content
      +--- en
      +--- sling:resourceType = type2
      +--- en
      +--- sling:resourceType = type2
      +--- sling:resourceSuperType = type3

      The resource super types are defined as follows:
      /types/type1 --> no super type
      /types/type2 --> type1, due to sling:resoureSuperType property
      /content/en --> type1, due to sling:resourceSuperType property in types/type2
      /conent/de --> type3, due to sling:resourceSuperType property

      [1] http://www.mail-archive.com/sling-dev@incubator.apache.org/msg02365.html

        Activity

        Gavin made changes -
        Workflow re-open possible,doc-test-required [ 12788877 ] no-reopen-closed,doc-test-required [ 12793071 ]
        Gavin made changes -
        Workflow no-reopen-closed,doc-test-required [ 12765577 ] re-open possible,doc-test-required [ 12788877 ]
        Gavin made changes -
        Workflow Copy of no-reopen-closed,doc-test-required [ 12763597 ] no-reopen-closed,doc-test-required [ 12765577 ]
        Gavin made changes -
        Workflow no-reopen-closed,doc-test-required [ 12475233 ] Copy of no-reopen-closed,doc-test-required [ 12763597 ]
        Felix Meschberger made changes -
        Component/s JCR [ 12311946 ]
        Component/s JCR Resource [ 12311941 ]
        Component/s Servlets Resolver [ 12312086 ]
        Felix Meschberger made changes -
        Workflow jira [ 12424478 ] no-reopen-closed,doc-test-required [ 12475233 ]
        Felix Meschberger made changes -
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        Hide
        Felix Meschberger added a comment -

        Everything is in place and works. So I close this issue.

        Show
        Felix Meschberger added a comment - Everything is in place and works. So I close this issue.
        Hide
        Felix Meschberger added a comment -

        In Rev. 631604:

        • Added ServletResource.getResourceSuperType() method
        • Enhanced script/servlet search to include resource super types before looking for default servlets
        Show
        Felix Meschberger added a comment - In Rev. 631604: Added ServletResource.getResourceSuperType() method Enhanced script/servlet search to include resource super types before looking for default servlets
        Hide
        Felix Meschberger added a comment -

        In Rev. 631601:

        • Resource.getResourceSuperType() implementation for JCR based Resources
        • mixin node type to be able to set the sling:resourceSuperType property
        • constant for the sling:resourceSuperType property
        • utility method to retrieve the super type of a given resource type
          (JcrResourceUtil.getResourceSuperType())
        • unit tests
        Show
        Felix Meschberger added a comment - In Rev. 631601: Resource.getResourceSuperType() implementation for JCR based Resources mixin node type to be able to set the sling:resourceSuperType property constant for the sling:resourceSuperType property utility method to retrieve the super type of a given resource type (JcrResourceUtil.getResourceSuperType()) unit tests
        Hide
        Felix Meschberger added a comment -

        Extended the Sling API with the new Resource.getResourceSuperType method in Rev. 631599.

        Show
        Felix Meschberger added a comment - Extended the Sling API with the new Resource.getResourceSuperType method in Rev. 631599.
        Felix Meschberger made changes -
        Description As discussed on the dev-list [1], resource type inheritance for script/servlet resolution should be implemented as follows:

           * define an optional property sling:resourceSuperType which may take a resource type used as
                the super type of a resource type. This property is stored at the node where the scripts
                located for the resource type. (see below)

           * if the sling:resourceSuperType is not set for a given resource type, any non-mixin base type
                of the primary node type of the resource node may be selected.

           * the resourceSuperType of a property resource is the resourceSuperType of the parent node
                plus the property name.

           * define a sling:ResourceSuperType mixin node type, which defines the sling:resourceType
                property for it to be attachable to any node.

           * Add Resource.getResourceSuperType() returning the super type of the resource type or
                null if no such super type exists.

           * Add support to the Servlet Resolver to resolve scripts not just for the resource type but also
                for the super type (if defined). This super type resolution takes place before falling back
                default scripts !


        [1] http://www.mail-archive.com/sling-dev@incubator.apache.org/msg02365.html
        As discussed on the dev-list [1], resource type inheritance for script/servlet resolution should be implemented as follows:

           * define an optional property sling:resourceSuperType which may take a resource type used as
                the super type of a resource type. This property is stored at the node where the scripts
                are located for the resource type or at the node itself. (see below)

           * the resourceSuperType of a property resource is the resourceSuperType of the parent node
                plus the property name.

           * define a sling:ResourceSuperType mixin node type, which defines the sling:resourceType
                property for it to be attachable to any node.

           * Add Resource.getResourceSuperType() returning the super type of the resource type or
                null if no such super type exists.

           * Add support to the Servlet Resolver to resolve scripts not just for the resource type but also
                for the super type (if defined). This super type resolution takes place before falling back
                default scripts !


        Sample:

            /
            +--- types
                        +--- type1
                        +--- type2
                                     +--- sling:resourceSuperType = type1
                        +--- type3
            +--- content
                         +--- en
                                     +--- sling:resourceType = type2
                         +--- en
                                     +--- sling:resourceType = type2
                                     +--- sling:resourceSuperType = type3

        The resource super types are defined as follows:
             /types/type1 --> no super type
             /types/type2 --> type1, due to sling:resoureSuperType property
             /content/en --> type1, due to sling:resourceSuperType property in types/type2
             /conent/de --> type3, due to sling:resourceSuperType property


        [1] http://www.mail-archive.com/sling-dev@incubator.apache.org/msg02365.html
        Hide
        Felix Meschberger added a comment -
        • Remove fall back to JCR node type hierarchy. This is confusing as it mixes two concepts switching back and forth.
        • Add example use of sling:resourceSuperType settings
        Show
        Felix Meschberger added a comment - Remove fall back to JCR node type hierarchy. This is confusing as it mixes two concepts switching back and forth. Add example use of sling:resourceSuperType settings
        Felix Meschberger made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Felix Meschberger created issue -

          People

          • Assignee:
            Felix Meschberger
            Reporter:
            Felix Meschberger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development