Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-2782

Try to use sling:resourceType as a node type for node creation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • JCR Resource 2.2.4
    • JCR Resource 2.2.6, API 2.4.0
    • JCR
    • None

    Description

      Right now, creating resources through the resource API (ResourceResolver#create) still requires some knowledge about the underlying storage especially in the case of JCR - in many cases you need to provide the primary node type.
      We could relax this and use the sling:resourceType as the node - but only if jcr:primaryType is not specified and sling:resourceType contains a valid node type name.
      This is in line with the implementation of the resource type handling for jcr resources: if the node does not have a sling:resourceType, the node type is returned.
      In addition, we defined that e.g. for files all resource providers should return nt:file as the resource type and nt:folder for folders. So making this work the other way round, fits into this.

      Attachments

        Activity

          People

            cziegeler Carsten Ziegeler
            cziegeler Carsten Ziegeler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: