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 (JIRA)" <ji...@apache.org> on 2012/05/09 21:33:48 UTC

[jira] [Created] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Felix Meschberger created SLING-2467:
----------------------------------------

             Summary: Define Document-like node type with jcr:content child and default handling servlet
                 Key: SLING-2467
                 URL: https://issues.apache.org/jira/browse/SLING-2467
             Project: Sling
          Issue Type: New Feature
          Components: JCR
            Reporter: Felix Meschberger


The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.

The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).

Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.

We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.

So I propose the following node types:

[sling:Document] > nt:hierarchyNode, sling:Resource
  - sling:resourcetype (String) = "sling/document" auto mandatory
  - * (undefined)
  - * (undefined) multiple
  + jcr:content (nt:base) = nt:unstructured mandatory
  + * (nt:base) = granite:Document version

[sling:OrderedDocument] > sling:Document
     orderable
  + * (nt:base) = sling:OrderedDocument version

In addition we create default GET servlet for handling the sling/document resource type:

  if the resource has a jcr:content child
      then include jcr:content
      else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434866#comment-13434866 ] 

Felix Meschberger commented on SLING-2467:
------------------------------------------

bq. nesting documents/pages

Ah ! That was the reason for not extending nt:file: files don't nest.

So we are probably back to my initial proposal ;-)
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Jeff Young (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13272254#comment-13272254 ] 

Jeff Young commented on SLING-2467:
-----------------------------------

How about sling:Container?
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434847#comment-13434847 ] 

Felix Meschberger commented on SLING-2467:
------------------------------------------

I agree with Tobias.

Also sling:Document would not be the root of the file system but the file itself where the jcr:content node actually takes the file's content.

sling:Container and sling:Component are of no use and just overcomplicate things
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434861#comment-13434861 ] 

Felix Meschberger commented on SLING-2467:
------------------------------------------

bq. so sling:File would be the most logical name

Sooo right ;-)

So we would have sling:File. I don't think we need an "orderable" variant because this relates to the child nodes, right ?
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Damien Antipa (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434242#comment-13434242 ] 

Damien Antipa commented on SLING-2467:
--------------------------------------

Container would be a Folder which can contains other Container or Components.

Component might not be the right name for the Sling level. Probably resource would match that purpose.
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434866#comment-13434866 ] 

Felix Meschberger edited comment on SLING-2467 at 8/20/12 11:43 PM:
--------------------------------------------------------------------

> nesting documents/pages

Ah ! That was the reason for not extending nt:file: files don't nest.

So we are probably back to my initial proposal ;-)
                
      was (Author: fmeschbe):
    bq. nesting documents/pages

Ah ! That was the reason for not extending nt:file: files don't nest.

So we are probably back to my initial proposal ;-)
                  
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437997#comment-13437997 ] 

Tobias Bocanegra commented on SLING-2467:
-----------------------------------------

so back to a very generic name like: sling:Content ?
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434861#comment-13434861 ] 

Felix Meschberger edited comment on SLING-2467 at 8/15/12 6:33 PM:
-------------------------------------------------------------------

bq. so sling:File would be the most logical name

Sooo right ;-)

So we would have sling:File instead of sling:Document. I don't think we need an "orderable" variant because this relates to the child nodes, right ?
                
      was (Author: fmeschbe):
    bq. so sling:File would be the most logical name

Sooo right ;-)

So we would have sling:File. I don't think we need an "orderable" variant because this relates to the child nodes, right ?
                  
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13271748#comment-13271748 ] 

Tobias Bocanegra commented on SLING-2467:
-----------------------------------------

I don't think that the sling:resourceType should be mandatory or auto created. it is implied by the primary node type.
Same for jcr:content, leaving this optional allows for "empty" documents.
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = granite:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434847#comment-13434847 ] 

Felix Meschberger edited comment on SLING-2467 at 8/15/12 5:53 PM:
-------------------------------------------------------------------

I agree with Tobias.

Also sling:Document would not be the root of the file system but the file itself where the jcr:content node actually takes the file's content.

Hmm, this reminds me of David's model: a file is a file is a file [1] .... why not nt:file in the first place ? hmm...

sling:Container and sling:Component are of no use and just overcomplicate things

[1] http://wiki.apache.org/jackrabbit/DavidsModel#Rule_.236:_Files_are_Files_are_Files.
                
      was (Author: fmeschbe):
    I agree with Tobias.

Also sling:Document would not be the root of the file system but the file itself where the jcr:content node actually takes the file's content.

sling:Container and sling:Component are of no use and just overcomplicate things
                  
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434861#comment-13434861 ] 

Felix Meschberger edited comment on SLING-2467 at 8/20/12 11:43 PM:
--------------------------------------------------------------------

> so sling:File would be the most logical name

Sooo right ;-)

So we would have sling:File instead of sling:Document. I don't think we need an "orderable" variant because this relates to the child nodes, right ?
                
      was (Author: fmeschbe):
    bq. so sling:File would be the most logical name

Sooo right ;-)

So we would have sling:File instead of sling:Document. I don't think we need an "orderable" variant because this relates to the child nodes, right ?
                  
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Damien Antipa (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434199#comment-13434199 ] 

Damien Antipa commented on SLING-2467:
--------------------------------------

I propose the following elements:
sling:Document = Root entry 
sling:Container
sling:Component

This is very specific for my use case though I think a root entry node is necessary. In a file system paradigm the root would be the drive.  
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437766#comment-13437766 ] 

Alexander Klimetschek commented on SLING-2467:
----------------------------------------------

While I can follow the reasoning for sling:File (along sling:Folder & being very generic), I have the feeling that this term is a bit misleading: file makes you expect a single stream of binary or text content (as known from file systems), not really a nested fine-granular structure (like a page in a WCM). It might make sense to highlight the special nature of such items that is possible with JCR and not much else storage systems.
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434261#comment-13434261 ] 

Tobias Bocanegra commented on SLING-2467:
-----------------------------------------

I wouldn't try to overstructure the hierarchy. after all, jcr:content should stay unstructured.
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Justin Edelson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13271882#comment-13271882 ] 

Justin Edelson commented on SLING-2467:
---------------------------------------

I like this idea, but I'm concerned about using the term "Document". That feels too much like an application-specific type, rather than an expression of the generic concept described here. I've seen people get tripped up by cq:Page, which is roughly similar to this proposal. In other words, I don't want to create the impression that this is _just_ for DMS applications.

That said, I'm struggling to come up with an alternative. The best I can come up with is sling:Entity. Other thoughts: sling:Thing (sounds too much like a joke), sling:Content, sling:Node, and sling:ContentNode.
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434853#comment-13434853 ] 

Tobias Bocanegra commented on SLING-2467:
-----------------------------------------

> why not nt:file in the first place ? 
because nt:file does not allow other child nodes than jcr:content, which is mandatory.
so sling:File would be the most logical name (having already sling:Folder as a softer definition than nt:folder)
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13271932#comment-13271932 ] 

Tobias Bocanegra commented on SLING-2467:
-----------------------------------------

> The idea of the explicit resource type allows for better inheritance. 
I agree, but making property mandatory just uses more persistence space in 99% of the cases when it's not needed.

sling:Document indeed is a bit too domain specific. sling:Content is the best alternative so far. 
Other possible names: sling:HierarchyContent 
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13271818#comment-13271818 ] 

Felix Meschberger commented on SLING-2467:
------------------------------------------

The idea of the explicit resource type allows for better inheritance.

For example a sling:OrderedDocument extending sling:Document will have a resource type of sling:OrderedDocument which will be the sling/OrderedDocument path and will not be handled by sling:Document which is sling/Document and from the perspective of Sling sling/Document is not a resource super type to sling/OrderedDocument. Having a default resource type assigned would make it easier to use sling:Document or sling:OrderedDocument or even some extended node type.

I'm ok with allowing empty documents and jcr:content not being mandatory. In this case the default document GET servlet would probably be an OptingServlet which does not handle the request for an empty request thus allowing the default GET servlet to kick in.
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = granite:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bertrand Delacretaz updated SLING-2467:
---------------------------------------

    Description: 
The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.

The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).

Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.

We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.

So I propose the following node types:

[sling:Document] > nt:hierarchyNode, sling:Resource
  - sling:resourcetype (String) = "sling/document" auto mandatory
  - * (undefined)
  - * (undefined) multiple
  + jcr:content (nt:base) = nt:unstructured mandatory
  + * (nt:base) = sling:Document version

[sling:OrderedDocument] > sling:Document
     orderable
  + * (nt:base) = sling:OrderedDocument version

In addition we create default GET servlet for handling the sling/document resource type:

  if the resource has a jcr:content child
      then include jcr:content
      else sendError 404

  was:
The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.

The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).

Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.

We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.

So I propose the following node types:

[sling:Document] > nt:hierarchyNode, sling:Resource
  - sling:resourcetype (String) = "sling/document" auto mandatory
  - * (undefined)
  - * (undefined) multiple
  + jcr:content (nt:base) = nt:unstructured mandatory
  + * (nt:base) = granite:Document version

[sling:OrderedDocument] > sling:Document
     orderable
  + * (nt:base) = sling:OrderedDocument version

In addition we create default GET servlet for handling the sling/document resource type:

  if the resource has a jcr:content child
      then include jcr:content
      else sendError 404

    
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434215#comment-13434215 ] 

Tobias Bocanegra commented on SLING-2467:
-----------------------------------------

@damien: what would sling:Container and sling:Component be used for?
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2467) Define Document-like node type with jcr:content child and default handling servlet

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434864#comment-13434864 ] 

Tobias Bocanegra commented on SLING-2467:
-----------------------------------------

> I don't think we need an "orderable" variant because this relates to the child nodes, right ?
yes, I think we need this. For example in a WCM system, where you have nesting documents/pages (aka sling:Files), they might need a stable order.
                
> Define Document-like node type with jcr:content child and default handling servlet
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2467
>                 URL: https://issues.apache.org/jira/browse/SLING-2467
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR
>            Reporter: Felix Meschberger
>
> The JCR specification allows for nodes to have a dual nature: As part of a hierarchy containing documents (as a folder in a filesystem) and as a container for actual data (as a file in a filesystem). There are also two node types defined to reflect the filesystem notions: nt:folder for folders and nt:file for Files.
> The nt:file nodetype requries a child node "jcr:content" to provide the actual contents of the file. This child node defaults to be of type nt:resource but can actually be anything and as such provide structured data in addition to just plain binary data (in the jcr:data property).
> Yet, nt:file and nt:folder are just that: nt:file for file data not containing children and nt:file for folders but to not contain structured data.
> We should define a node type which can be used to really convey this dual nature as a data container (file) and document container (folder) at the same time.
> So I propose the following node types:
> [sling:Document] > nt:hierarchyNode, sling:Resource
>   - sling:resourcetype (String) = "sling/document" auto mandatory
>   - * (undefined)
>   - * (undefined) multiple
>   + jcr:content (nt:base) = nt:unstructured mandatory
>   + * (nt:base) = sling:Document version
> [sling:OrderedDocument] > sling:Document
>      orderable
>   + * (nt:base) = sling:OrderedDocument version
> In addition we create default GET servlet for handling the sling/document resource type:
>   if the resource has a jcr:content child
>       then include jcr:content
>       else sendError 404

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira