You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Felix Meschberger <fm...@gmail.com> on 2008/09/19 11:23:59 UTC

sling:Folder vs. nt:unstructured

Hi all,

Until SLING-663 [1] the sling:Folder node type was turned into an
extension of nt:folder. This is basically good.

The consequence of this is more restrictions on child nodes: Before
SLING-663 a sling:Folder a child node of any type, most notably
nt:unstructured. With the changes brought by SLING-663, nt:unstructured
cannot be used as a child node of a sling:Folder node any more.

As a "fix" I have basically three options :

(1) Use sling:Folder instead of nt:unstructured
(2) Change sling:Folder such that the required primary
     type is nt:base instead of nt:hierarchyNode
(3) Create a node type sling:Unstructured extending
     from nt:hierarchyNode and nt:unstructured.

(1) works perfectly, but is kind of strange: Creating a folder just to
store some unsrtuctured properties looks weird.

(2) might not work because an extended node type might not be allowed to
change the required primary type over overwritten child node definitions
(though overwriting the default primary type seems to work sling:Folder
shows).

(3) sounds like a good workaround if (2) would not work.

I quickly tested solution (2) and it seems to work.

WDYT ?

Regards
Felix

[1] https://issues.apache.org/jira/browse/SLING-663

Re: sling:Folder vs. nt:unstructured

Posted by Tobias Bocanegra <to...@day.com>.
On 9/19/08, Felix Meschberger <fm...@gmail.com> wrote:
> Hi all,
>
>  Until SLING-663 [1] the sling:Folder node type was turned into an
>  extension of nt:folder. This is basically good.
>
>  The consequence of this is more restrictions on child nodes: Before
>  SLING-663 a sling:Folder a child node of any type, most notably
>  nt:unstructured. With the changes brought by SLING-663, nt:unstructured
>  cannot be used as a child node of a sling:Folder node any more.
>
>  As a "fix" I have basically three options :
>
>  (1) Use sling:Folder instead of nt:unstructured
>  (2) Change sling:Folder such that the required primary
>      type is nt:base instead of nt:hierarchyNode
>  (3) Create a node type sling:Unstructured extending
>      from nt:hierarchyNode and nt:unstructured.
>
>  (1) works perfectly, but is kind of strange: Creating a folder just to
>  store some unsrtuctured properties looks weird.
>
>  (2) might not work because an extended node type might not be allowed to
>  change the required primary type over overwritten child node definitions
>  (though overwriting the default primary type seems to work sling:Folder
>  shows).
>
>  (3) sounds like a good workaround if (2) would not work.
>
>  I quickly tested solution (2) and it seems to work.

hi,
i think (2) makes sense.

regards, toby