You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Tobias Bocanegra (JIRA)" <ji...@apache.org> on 2012/05/09 22:05:48 UTC

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

    [ 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