[
https://issues.apache.org/jira/browse/SLING-12300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17840065#comment-17840065
]
Radu Cotescu commented on SLING-12300:
--------------------------------------
Let's compare the three options we have:
||1. Augmenting the JCR Resource Provider - {{/jcr:id/}}||2. Creating a new
Resource Provider for ID addressing||3. Extending the Resource API||
|Pros:
* simple, low effort implementation
* can be implemented behind a configuration toggle|Pros:
* isolates providers and allows for separate configurations
* since a provider has a mount path, the root for ID addressing is
configurable|Pros:
* brings the IDs as first class citizens to the Resource API
* allows resource retrieval by ID or path without providing any special
prefixes|
|Cons:
* adds a path prefix into the resource tree
* might require setting explicit authentication configurations to not allow
any HTTP browsing under {{/jcr:id}} for unauthenticated users|Cons:
* adds a path prefix into the resource tree (via its mount path)
* might require setting explicit authentication configurations to not allow
any HTTP browsing under its root
* duplicates functionality, since this would also be a JCR provider|Cons:
* must ensure ID uniqueness across Resource Providers
* difficult to implement since the Resource API has a large footprint|
This shows clearly that 2 is not really a different option compared to 1. 3 is
interesting, but I don't think we can solve the uniqueness requirement.
> Provide a way to retrieve a JCR backed resource by its node identifier
> ----------------------------------------------------------------------
>
> Key: SLING-12300
> URL: https://issues.apache.org/jira/browse/SLING-12300
> Project: Sling
> Issue Type: New Feature
> Components: JCR
> Reporter: Radu Cotescu
> Assignee: Radu Cotescu
> Priority: Major
> Fix For: JCR Resource 3.3.0
>
>
> Since all {{javax.jcr.Nodes}} have an identifier [0], a useful feature would
> be {{Resource}} retrieval by node id, which could be its {{jcr:uuid}}
> property for referenceable nodes or the path. In systems that would like to
> use UUID addressing, this would reduce the need for executing JCR queries for
> resource retrieval and would avoid double-reads via the JCR and then Sling
> API to obtain the resource.
> In order to provide a unified behaviour, paths starting with the {{/jcr:id/}}
> prefix should use the resource retrieval by node identifier.
> [0] -
> https://javadoc.io/static/javax.jcr/jcr/2.0/javax/jcr/Node.html#getIdentifier()
--
This message was sent by Atlassian Jira
(v8.20.10#820010)