This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch SLING-848-documentation
in repository https://gitbox.apache.org/repos/asf/sling-site.git

commit 263372dfd34426bcb26f8ac129ce9d1d4c521a26
Author: Konrad Windszus <[email protected]>
AuthorDate: Thu Aug 6 10:00:58 2020 +0200

    SLING-848 document request path parameter support
---
 src/main/jbake/content/documentation/the-sling-engine/resources.md | 7 +++++++
 .../content/documentation/the-sling-engine/url-decomposition.md    | 7 +++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/main/jbake/content/documentation/the-sling-engine/resources.md 
b/src/main/jbake/content/documentation/the-sling-engine/resources.md
index 44586e4..f7eccd0 100644
--- a/src/main/jbake/content/documentation/the-sling-engine/resources.md
+++ b/src/main/jbake/content/documentation/the-sling-engine/resources.md
@@ -138,6 +138,13 @@ These are the authenticationInfo keys (which can be used 
with [`ResourceResolver
 | `user.name` | 
[`ResourceResolverFcatory.AUTHENTICATION_INFO_CREDENTIALS`](https://sling.apache.org/apidocs/sling11/org/apache/sling/api/resource/ResourceResolverFactory.html#USER)
 | String | Optionally used with `user.password` to create simple credentials 
from which the Session is being created.
 | `user.impersonation` | 
[`ResourceResolverFcatory.USER_IMPERSONATION`](https://sling.apache.org/apidocs/sling11/org/apache/sling/api/resource/ResourceResolverFactory.html#USER_IMPERSONATION)
 | String | User ID which should be used for impersonation via 
`javax.jcr.Session.impersonate(...)`. Must be combined with one of the other 
authentication info keys.
 
+There is support for the following [path parameters](url-decomposition.html):
+
+Path Parameter | Example Value | Description | Since 
+ --- | --- | --- | ---
+| `v` | `1.0` | Retrieves the underlying JCR node from the [version 
history](https://docs.adobe.com/docs/en/spec/jcr/2.0/15_Versioning.html) 
leveraging the version label given in the value. | 
[SLING-848](https://issues.apache.org/jira/browse/SLING-848)
+
+
 ### Bundle-based Resources
 
 Resources may by provided by OSGi bundles. Providing bundles have a Bundle 
manifest header `Sling-Bundle-Resources` containing a list of absolute paths 
provided by the bundle. The path are separated by comma or whitespace (SP, TAB, 
VTAB, CR, LF).
diff --git 
a/src/main/jbake/content/documentation/the-sling-engine/url-decomposition.md 
b/src/main/jbake/content/documentation/the-sling-engine/url-decomposition.md
index cd4e674..00292ec 100644
--- a/src/main/jbake/content/documentation/the-sling-engine/url-decomposition.md
+++ b/src/main/jbake/content/documentation/the-sling-engine/url-decomposition.md
@@ -10,12 +10,15 @@ tags=core,urls
 During the *Resource Resolution* step, the client request URI (as being 
returned by 
[HttpServletRequest.getRequestURI()](http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getRequestURI()))
 is decomposed into the following parts (in exactly this order):
 
 1. **Resource Path** - For existing resources the resource path is the longest 
match (also considering its 
[mappings](/documentation/the-sling-engine/mappings-for-resource-resolution.html))
 pointing to a resource where the next character is either a dot (`.`) or it is 
the full request URI.
-Otherwise (for a path not matching any existing resource) the resource path 
ends at the *first dot (`.`)* in the request url. The exact logic for 
retrieving the resource path is implemented at 
[ResourceResolver.resolve(HttpServletRequest,String)](https://sling.apache.org/apidocs/sling7/org/apache/sling/api/resource/ResourceResolver.html#resolve-javax.servlet.http.HttpServletRequest-java.lang.String-).
 *It is impossible to tell from just looking at the request URI where the 
resource path  [...]
+Otherwise (for a path not matching any existing resource) the resource path 
ends at the *first dot (`.`)* in the request url. The exact logic for 
retrieving the resource path is implemented at 
[ResourceResolver.resolve(HttpServletRequest)](https://sling.apache.org/apidocs/sling11/org/apache/sling/api/resource/ResourceResolver.html#resolve-javax.servlet.http.HttpServletRequest-java.lang.String-)
  called from `org.apache.sling.engine.impl.request.RequestData.initResource()` 
with the 2nd ar [...]
 1. **Selectors** - If the first character in the request URL after the 
resource path is a dot  (`.`), the string after the dot up to but not including 
the last dot before the next slash character or the end of the request URL 
comprises the selectors. If the resource path spans the complete request URL no 
selectors exist. If only one dot follows the resource path before the end of 
the request URL or the next slash, also no selectors exist.
 1. **Extension** - The string after the last dot after the resource path in 
the request URL but before the end of the request URL or the next slash after 
the resource path in the request URL is the extension. 
 1. **Suffix** - If the request URL contains a slash character after the 
resource path and optional selectors and extension, the path starting with the 
slash up to the end of the request URL is the suffix path. Otherwise, the 
suffix path is empty. Note, that after the resource path at least a dot must be 
in the URL to let Sling detect the suffix.
 
-Those decomposed parts can be accessed through the `RequestPathInfo` object, 
which is retrieved via 
[SlingHttpServletRequest.getPathInfo()](https://sling.apache.org/apidocs/sling7/org/apache/sling/api/SlingHttpServletRequest.html#getRequestPathInfo--).
+In addition since [SLING-848](https://issues.apache.org/jira/browse/SLING-848) 
there may be one or multiple **request path parameters**  passed in the form 
`;<key>='<value>'`. Those request path parameters are only supported directly 
after the *Resource Path* or after the *Extension*. The value needs to be 
enclosed in `'` if it contains a `.` and is not located after the extension.
+It is up to the [Resource Provider](resource.html#providing-resources-1) to 
decide for what those parameters are being used.
+
+The decomposed parts can be accessed through the `RequestPathInfo` object, 
which is retrieved via 
[SlingHttpServletRequest.getPathInfo()](https://sling.apache.org/apidocs/sling7/org/apache/sling/api/SlingHttpServletRequest.html#getRequestPathInfo--).
 
 There's a cheat sheet in Adobe's AEM documentation at 
[https://docs.adobe.com/docs/en/aem/6-2/develop/platform/sling-cheatsheet.html](https://docs.adobe.com/docs/en/aem/6-2/develop/platform/sling-cheatsheet.html)
 available to get you familiar with the URL decomposition of Sling.
 

Reply via email to