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

Chetan Mehrotra commented on SLING-6090:
----------------------------------------

To fix this I see following options

# Switch to {{oak:Resource}} by default- This assumes that 
{{org.apache.sling.servlets.post}} is being used with newer Oak builds which 
provide this nodetype
# Detect if running in a repository which provides {{oak:Resource}} and then 
use the right nodetype - Detecting this would require access to JCR API which 
is not possible in this bundle
# Define a new nodetype in Sling namespace like {{sling:Resource}} - This 
nodetype would be similar to {{oak:Resource}} just defined in Sling namespace. 
This would ensure that we can use new nodetype safely with any version of Oak.  
{{sling:Resource}} might cause some confusion with Sling Resource API so may be 
we name it differently

For now #3 looks the safest

> 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}} 
> [1] 
> https://adapt.to/2016/en/schedule/let_s-run-the-whole-web-on-apache-sling-and-oak-.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to