[jira] [Commented] (SLING-7621) Regex path matching in Sling Dynamic Include

2018-05-15 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz commented on SLING-7621:


I found some time and started the release vote, for release 3.1.0 as you 
suggested, makes sense as this is new functionality.

I'll close the vote this Friday, it's at

https://lists.apache.org/thread.html/50490391b05988374767caee28d02327e450d9e95b3f0394d13042d5@%3Cdev.sling.apache.org%3E

> 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
>Assignee: Bertrand Delacretaz
>Priority: Major
> Fix For: Dynamic Include 3.1.0
>
>
> 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)


[jira] [Commented] (SLING-7621) Regex path matching in Sling Dynamic Include

2018-05-15 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz commented on SLING-7621:


Sorry, I meant to start this release last week but this fell through the 
cracks...it's on back my list for this week.

> 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
>Assignee: Bertrand Delacretaz
>Priority: Major
> Fix For: Dynamic Include 3.0.2
>
>
> 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)


[jira] [Commented] (SLING-7621) Regex path matching in Sling Dynamic Include

2018-05-15 Thread Marek Krokosinski (JIRA)

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

Marek Krokosinski commented on SLING-7621:
--

Hi [~bdelacretaz] 

Do you have any information about the status of the release of this ticket? 
Information saying that it won't happen soon would be useful too. Thanks.

 

> 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
>Assignee: Bertrand Delacretaz
>Priority: Major
> Fix For: Dynamic Include 3.0.2
>
>
> 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)


[jira] [Commented] (SLING-7621) Regex path matching in Sling Dynamic Include

2018-05-08 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz commented on SLING-7621:


I shall be able to start the release later today. Note that Apache releases 
require a 72 hours voting period, but the Git tag will be created as soon a I 
prepare the release.

> 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
>Assignee: Bertrand Delacretaz
>Priority: Major
> Fix For: Dynamic Include 3.0.2
>
>
> 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)


[jira] [Commented] (SLING-7621) Regex path matching in Sling Dynamic Include

2018-05-03 Thread Marek Krokosinski (JIRA)

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

Marek Krokosinski commented on SLING-7621:
--

That's great to hear that. 

Thanks for the fixes, and about the whitespaces, sorry, I couldn't find the 
proper formatting rules.

Do you know when it will be available on some maven repository as released 
version? I see that the fix version was set to 3.0.2.

> 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
>Assignee: Bertrand Delacretaz
>Priority: Major
> Fix For: Dynamic Include 3.0.2
>
>
> 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)


[jira] [Commented] (SLING-7621) Regex path matching in Sling Dynamic Include

2018-04-30 Thread Marek Krokosinski (JIRA)

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

Marek Krokosinski commented on SLING-7621:
--

Hi [~bdelacretaz] I have just updated the pull request.

Currently supported configurations for path:
 * /content - 'startWith' matching
 * ^/content - regex matching

Tests and docs have been updated.

> 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)


[jira] [Commented] (SLING-7621) Regex path matching in Sling Dynamic Include

2018-04-27 Thread Marek Krokosinski (JIRA)

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

Marek Krokosinski commented on SLING-7621:
--

Sure, I will update in soon.

> 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)


[jira] [Commented] (SLING-7621) Regex path matching in Sling Dynamic Include

2018-04-27 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)


[jira] [Commented] (SLING-7621) Regex path matching in Sling Dynamic Include

2018-04-27 Thread Marek Krokosinski (JIRA)

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

Marek Krokosinski commented on SLING-7621:
--

I wanted to check ^ & $ as by default, {{^}} and {{$}} match the start- and 
end-of-input respectively. If you think that checking one of them is enough, 
then that is ok for me. I can check only for ^ at the begin of the input value.

> 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)


[jira] [Commented] (SLING-7621) Regex path matching in Sling Dynamic Include

2018-04-27 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz commented on SLING-7621:


Ah ok, got it now, your plan is that if the path starts with ^ and ends with $ 
you consider it a regexp, otherwise it's just a startsWith expression.

I think that works but maybe you can have just one of those conditions? A 
regexp must either start with ^ or end with $, otherwise it's considered a 
startsWith expression - that can make writing them easier. And log a the DEBUG 
level which variant you select, of course.

> 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)


[jira] [Commented] (SLING-7621) Regex path matching in Sling Dynamic Include

2018-04-27 Thread Marek Krokosinski (JIRA)

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

Marek Krokosinski commented on SLING-7621:
--

Hi [~bdelacretaz]

Your undestanding is correct.

However you can check my comment (probably you haven't seen it).Implementing it 
in a way which I have described in the comment will preserve the old way of 
configuring path, and will allow to configure the regex.

> 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)


[jira] [Commented] (SLING-7621) Regex path matching in Sling Dynamic Include

2018-04-27 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz commented on SLING-7621:


I haven't used SDI myself but what you suggest looks useful, thanks for this 
contribution!

How about backwards compatibility? IIUC with your changes an existing 
`include-filter.config.path` configuration property is processed as a regexp, 
so will not match anything unless a `.*` is appended to it.

If I'm correct, I think that would break backwards compatibility. One way to 
avoid this is to define the path regexp as a new property, recommend that it's 
used before the old parameter, and complain if both are defined. Or maybe you 
have a better suggestion? Assuming my understanding is correct.

> 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)


[jira] [Commented] (SLING-7621) Regex path matching in Sling Dynamic Include

2018-04-27 Thread Marek Krokosinski (JIRA)

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

Marek Krokosinski commented on SLING-7621:
--

Additionally, I was thinking if we can keep the old way of path checking 
(namely by matching path with 'startsWith'). I'm not sure if it's needed.

In Configuration class we could, instead of returning Pattern, return a 
PathValidator. There would be two PathValidators, one for path prefix matching, 
second for matching path with regular expression.  

The correct validator would be instantiated based on the value in the 
configuration. If path would start with ^ and end with $, the 
RegexPathValidator would be instantiated, otherwise PrefixPathValidator would 
be instantiated.

What do you think ?

> 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)