[
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