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

Tomasz Niedźwiedź edited comment on SLING-8255 at 2/11/19 8:42 AM:
-------------------------------------------------------------------

Looking at 
[{{UrlBuilder}}|https://github.com/apache/sling-org-apache-sling-dynamic-include/blob/master/src/main/java/org/apache/sling/dynamicinclude/impl/UrlBuilder.java]
 this isn't currently supported. 
{code:java}
private String buildUrl(Configuration config, SlingHttpServletRequest request) {
    final Resource resource = request.getResource();
    final boolean synthetic = 
ResourceUtil.isSyntheticResource(request.getResource());
    return UrlBuilder.buildUrl(config.getIncludeSelector(), 
resource.getResourceType(), synthetic, request.getRequestPathInfo());
}{code}
I think this could be useful on my project. It's not that much of an 
improvement when you use Server Side Includes as the type but could help hide 
the content structure for ESI and JS includes. Come to think of it, if someone 
wants to use rewritten paths on Apache, why not let them? A sensible way to 
configure this would need to be devised.

[~rombert], WDYT?


was (Author: tomasz.k.niedzwi...@gmail.com):
Looking at 
[{{UrlBuilder}}|https://github.com/apache/sling-org-apache-sling-dynamic-include/blob/master/src/main/java/org/apache/sling/dynamicinclude/impl/UrlBuilder.java]
 this isn't currently supported. 
{code:java}
private String buildUrl(Configuration config, SlingHttpServletRequest request) {
    final Resource resource = request.getResource();
    final boolean synthetic = 
ResourceUtil.isSyntheticResource(request.getResource());
    return UrlBuilder.buildUrl(config.getIncludeSelector(), 
resource.getResourceType(), synthetic, request.getRequestPathInfo());
}{code}
I think this could be useful on my project. It's not really useful when you use 
Server Side Includes as the type but could help hide the content structure for 
ESI and JS includes. Come to think of it, if someone wants to use rewritten 
paths on Apache, why not let them? A sensible way to configure this would need 
to be devised.

[~rombert], WDYT?

> Use of mappings in SDI
> ----------------------
>
>                 Key: SLING-8255
>                 URL: https://issues.apache.org/jira/browse/SLING-8255
>             Project: Sling
>          Issue Type: Improvement
>    Affects Versions: Dynamic Include 3.1.2
>            Reporter: Michał Tobiasz
>            Priority: Minor
>
> Hello,
> It would be great to consider using mappings for SDI. In our case, we would 
> like to configure mappings for snippets to use a different format (short 
> names).
>  
> [~rombert]  what do you think of using ResourceResolver#map when building URL.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to