sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bertrand Delacretaz (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SLING-7621) Regex path matching in Sling Dynamic Include
Date Fri, 27 Apr 2018 09:52:00 GMT

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

Bertrand Delacretaz commented on SLING-7621:
--------------------------------------------

> I can check only for ^ at the begin of the input value.

My suggestion was to check for either that or $ at end end - I think one of them clearly signals
a regexp, and by checking only one of them writing the regexp is more flexible.

> Regex path matching in Sling Dynamic Include
> --------------------------------------------
>
>                 Key: SLING-7621
>                 URL: https://issues.apache.org/jira/browse/SLING-7621
>             Project: Sling
>          Issue Type: New Feature
>    Affects Versions: Dynamic Include 3.0.0
>            Reporter: Marek Krokosinski
>            Priority: Major
>
> In some cases one might want to include external content to a page. Example of such external
content are AEM Experience Fragments or Content Fragments, or Zen Garden Snippets.
>  Sometimes such 3rd party content can be categorized into two categories:
>  * not included by SDI - content which should not be included separately (for example
when content requires page context)
>  * included by SDI - content which is static, so it can be cached because it does not
change often (header, footer), or because it changes once per week and we don't want to invalidate
whole cache.
> Example content structure:
>  * /content/my-site/my-micro-site/en_gl/content/fragments/
>  * /content/my-site/my-micro-site/en_gl/content/fragments/cacheable-fragments
> When content is specific to market (by market I mean for example British market, German
market etc.), and we would want to include that 3rd party content using SDI, we would have
to provide one Sling Dynamic Include configuration per market.
>  As you may know, one site can have 100 or more markets, it means at least 100 configuration
for such simple case (and usually, it's not the only one!).
> Solution for this problem is to change the way, how SDI performs check on the path.
>  Currently SDI checks if requested resource path starts from the configured path. 
>  Instead of simple check with startsWith, SDI should support regular expressions, which
are much more flexible.
> In the given scenario we would have one simple configuration with path configured to:
> ^/content/my-site/([a-zA-Z-_]+)/([a-z]{2}_[a-z]{2})/content/fragments/cacheable-fragments$
> I have created pull requests which also provides some unit tests for Configuration and
ConfigurationWhiteboard classes.
>  
> Pull request: https://github.com/apache/sling-org-apache-sling-dynamic-include/pull/3



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

Mime
View raw message