Could [1] simply use oak:Resource if it was available and nt:resource otherwise? That would require no client code changes as is IMO a sensible default.
Regards, Justin On Fri, Jul 15, 2016 at 3:47 AM Chetan Mehrotra <[email protected]> wrote: > In most cases where code uses JcrUtils.putFile [1] it leads to > creation of below content structure > > + foo.jpg (nt:file) > + jcr:content (nt:resource) > - jcr:data > > Due to usage of nt:resource each nt:file node creates a entry in uuid > index as nt:resource is referenceable [2]. So if a system has 1M > nt:file nodes then we would have 1M entries in /oak:index/uuid as in > most cases the files are created via [1] and hence all such files are > referenceable > > The nodetype defn for nt:file [3] does not mandate that the > requirement for jcr:content being nt:resource. > > So should we register a new oak:Resource nodetype which is same as > nt:resource but not referenceable. This would be similar to > oak:Unstructured. > > Also what should we do for [1]. Should we provide an overloaded method > which also accepts a nodetype for jcr:content node as it cannot use > oak:Resource > > Chetan Mehrotra > [1] > https://github.com/apache/jackrabbit/blob/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java#L1062 > > [2] > [nt:resource] > mix:lastModified, mix:mimeType, mix:referenceable > primaryitem jcr:data > - jcr:data (binary) mandatory > > [3] > > [nt:file] > nt:hierarchyNode > primaryitem jcr:content > + jcr:content (nt:base) mandatory >
