[
https://issues.apache.org/jira/browse/SLING-278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Felix Meschberger updated SLING-278:
------------------------------------
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/[email protected]/msg02365.html
was:
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/[email protected]/msg02365.html
* 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
> Add Resource Type inheritance
> -----------------------------
>
> Key: SLING-278
> URL: https://issues.apache.org/jira/browse/SLING-278
> Project: Sling
> Issue Type: New Feature
> Components: Resource, ServletResolver
> Reporter: Felix Meschberger
> Assignee: Felix Meschberger
> Fix For: 2.0.0
>
>
> 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/[email protected]/msg02365.html
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.