[ 
https://issues.apache.org/jira/browse/SLING-6090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15940455#comment-15940455
 ] 

Konrad Windszus edited comment on SLING-6090 at 3/24/17 2:44 PM:
-----------------------------------------------------------------

Just for the reference:  A nodetype definition for Sling could then look like 
this
{code}
/**
 * This node type may be used to represent the content of a file. This should be
 * preferred over nt:resource if non referenceable nt:file nodes are required
 *
 */
[sling:Resource] > mix:mimeType, mix:lastModified
   primaryitem jcr:data
   - jcr:data (BINARY) mandatory
{code}

but {{sling:Resource}} is already a mixin, being defined in 
https://github.com/apache/sling/blob/d316f91f0305a27e0033e477199aac9d2197ef7f/bundles/jcr/resource/src/main/resources/SLING-INF/nodetypes/resource.cnd.


was (Author: kwin):
Just for the reference:  A nodetype definition for Sling could then look like 
this
{code}
/**
 * This node type may be used to represent the content of a file. This should be
 * preferred over nt:resource if non referenceable nt:file nodes are required
 *
 */
[sling:Resource] > mix:mimeType, mix:lastModified
   primaryitem jcr:data
   - jcr:data (BINARY) mandatory
{code}

> Avoid using nt:resource while creating file nodes via SlingPostServlet
> ----------------------------------------------------------------------
>
>                 Key: SLING-6090
>                 URL: https://issues.apache.org/jira/browse/SLING-6090
>             Project: Sling
>          Issue Type: Improvement
>          Components: Servlets
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>             Fix For: Servlets Post 2.3.16
>
>
> Currently Sling uses {{nt:resource}} nodetype while creating file nodes in 
> {{SlingFileUploadHandler}} and {{StreamedChunk}}. 
> As discussed in OAK-4567 and also in best practices at [1] it would be better 
> to avoid using a referenceable nodetype and instead use another nodetype like 
> {{oak:Resource}} 
> Mail thread on DL
> [1] 
> https://adapt.to/2016/en/schedule/let_s-run-the-whole-web-on-apache-sling-and-oak-.html
> [2] http://markmail.org/thread/77xvjxtx42euhss4
> [3] http://markmail.org/thread/tnqbcegadnyaflw4



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to