You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Cris Rockwell <cm...@umich.edu> on 2019/03/29 14:47:44 UTC

Re: Can Suffix be used in the Sling Filter Pattern?

Hi all

I want to follow up with a question I sent the group last year about using a suffix patterns when defining Sling Filters. 
http://apache-sling.73963.n3.nabble.com/Can-Suffix-be-used-in-the-Sling-Filter-Pattern-td4084561.html <http://apache-sling.73963.n3.nabble.com/Can-Suffix-be-used-in-the-Sling-Filter-Pattern-td4084561.html>

The email response at the time was that Suffix patterns cannot be used to define a filter, and the advice was to check the suffix within the filter itself. If this is the case, then why does the documentation describe sling.filter.suffix.pattern as "Restrict the filter to requests with suffix that match the supplied regular expression. Requires Sling Engine 2.6.14.”

https://sling.apache.org/documentation/the-sling-engine/filters.html <https://sling.apache.org/documentation/the-sling-engine/filters.html>
Using org.apache.sling.engine 2.6.16, I have not had any luck configuring sling.filter.suffix.pattern. If this feature is not available or not working, I would recommend updating docs and removing it. Also, I would like to review the source code to see how the sling.filter.suffix.pattern was intended to be used, but I cannot find it. Please send a link if you can.

Thanks!
Cris


> On Jul 11, 2018, at 4:45 AM, Nicolas Peltier <np...@adobe.com.INVALID> wrote:
> 
> Hi Cris,
> 
> Not there is not, you have to test the suffix in the filter itself. 
> 
> Nicolas
> 
> On 11/07/2018 03:26, "Cris Rockwell" <cm...@umich.edu> wrote:
> 
>    Hi all
> 
>    Was trying to register a filter by including the path, extension and suffix. 
>    	EngineConstants.SLING_FILTER_PATTERN + "=/content/site/getting-started.html/callback/.*”
> 
>    Its not working. Doing internet searches I found https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fissues.apache.org%2Fjira%2Fbrowse%2FSLING-7759&amp;data=02%7C01%7Cnpeltier%40adobe.com%7Cb7cfc82d66b5462c7d9708d5e6cd4c43%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636668691772904210&amp;sdata=lSSkbjS5MnMK2IiwewwsJ3Rgh4vPPvZy%2BtkBBHTdnmk%3D&amp;reserved=0 <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fissues.apache.org%2Fjira%2Fbrowse%2FSLING-7759&amp;data=02%7C01%7Cnpeltier%40adobe.com%7Cb7cfc82d66b5462c7d9708d5e6cd4c43%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636668691772904210&amp;sdata=lSSkbjS5MnMK2IiwewwsJ3Rgh4vPPvZy%2BtkBBHTdnmk%3D&amp;reserved=0>
>    So as of now, there is no way to include a suffix in a Servlet Filter pattern?
> 
>    Thanks
>    Cris Rockwell
> 
> 
> 
> 
> 


Re: Can Suffix be used in the Sling Filter Pattern?

Posted by Justin Edelson <ju...@justinedelson.com>.
Anything is possible, but in general when Adobe provides an Adobe-generated
release of a Sling bundle in AEM, it is denoted with a timestamp and (since
the move to git) a git hash. For example, in AEM 6.4, I see
version 1.4.7-T20180205124646-b0647a3 for org.apache.sling.models.impl.

It would be very weird for you to see a release (even) version of a Sling
bundle in AEM which didn't come from Sling.

On Mon, Apr 1, 2019 at 6:21 PM Cris Rockwell <cm...@umich.edu> wrote:

> Thanks for the reply, but I doubt it. Many other EngineConstants work, but
> SLING_FILTER_SUFFIX_PATTERN is not there. This is in aem64 and suspect
> Adobe compiled their own sling engine bundle, because I see this bundle
> importing Adobe packages.
>
>
> On Mon, Apr 1, 2019, 4:49 PM Robert Munteanu <ro...@apache.org> wrote:
>
> > On Fri, 2019-03-29 at 14:27 -0400, Cris Rockwell wrote:
> > > Ok. Thanks. It must be a version thing, because
> > > org.apache.sling.engine.EngineConstants.SLING_FILTER_SUFFIX_PATTERN
> > > is not found in my local maven repository or IDE.
> >
> > Maybe it is not found due to the java compiler inlining constants?
> >
> > > It’s odd because the bundle (org.apache.sling.engine) says is 2.6.16
> > > (using /system/console/bundles). When I expand the bundle details, I
> > > see lower versions.
> > >
> > > Bundle Location       launchpad:resources/install/0/org.apache.sling.
> > > engine-2.6.6.jar
> > > Exported Packages     org.apache.sling.engine,version=2.3.0
> >
> > You are most likely using 2.6.16. The bundle location is (IIRC) set to
> > the first version of the bundle _or_ the first version of the bundle
> > present when a configuration is defined for a component belonging to
> > that bundle.
> >
> > Robert
> >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > > On Mar 29, 2019, at 12:07 PM, Robert Munteanu <ro...@apache.org>
> > > > wrote:
> > > >
> > > > On Fri, 2019-03-29 at 10:47 -0400, Cris Rockwell wrote:
> > > > > Hi all
> > > > >
> > > > > I want to follow up with a question I sent the group last year
> > > > > about
> > > > > using a suffix patterns when defining Sling Filters.
> > > > >
> >
> http://apache-sling.73963.n3.nabble.com/Can-Suffix-be-used-in-the-Sling-Filter-Pattern-td4084561.html
> > > > > <
> > > > > http://apache-sling.73963.n3.nabble.com/Can-Suffix-be-used-in-the
> > > > > -
> > > > > Sling-Filter-Pattern-td4084561.html>
> > > > >
> > > > > The email response at the time was that Suffix patterns cannot be
> > > > > used to define a filter, and the advice was to check the suffix
> > > > > within the filter itself. If this is the case, then why does the
> > > > > documentation describe sling.filter.suffix.pattern as "Restrict
> > > > > the
> > > > > filter to requests with suffix that match the supplied regular
> > > > > expression. Requires Sling Engine 2.6.14.”
> > > > >
> > > > >
> https://sling.apache.org/documentation/the-sling-engine/filters.html
> > > > > <https://sling.apache.org/documentation/the-sling-
> > > > > engine/filters.html>
> > > > > Using org.apache.sling.engine 2.6.16, I have not had any luck
> > > > > configuring sling.filter.suffix.pattern. If this feature is not
> > > > > available or not working, I would recommend updating docs and
> > > > > removing it. Also, I would like to review the source code to see
> > > > > how
> > > > > the sling.filter.suffix.pattern was intended to be used, but I
> > > > > cannot
> > > > > find it. Please send a link if you can.
> > > >
> > > > Hi Cris,
> > > >
> > > > I think this is used at
> > > >
> > > >
> > > >
> >
> https://github.com/apache/sling-org-apache-sling-engine/blob/f2ddb41a68551e6d27a143bca00fb267d7af2230/src/main/java/org/apache/sling/engine/impl/filter/FilterPredicate.java#L67
> > > >
> > > > Robert
> > > >
> >
> >
>

Re: Can Suffix be used in the Sling Filter Pattern?

Posted by Cris Rockwell <cm...@umich.edu>.
Thanks for the reply, but I doubt it. Many other EngineConstants work, but
SLING_FILTER_SUFFIX_PATTERN is not there. This is in aem64 and suspect
Adobe compiled their own sling engine bundle, because I see this bundle
importing Adobe packages.


On Mon, Apr 1, 2019, 4:49 PM Robert Munteanu <ro...@apache.org> wrote:

> On Fri, 2019-03-29 at 14:27 -0400, Cris Rockwell wrote:
> > Ok. Thanks. It must be a version thing, because
> > org.apache.sling.engine.EngineConstants.SLING_FILTER_SUFFIX_PATTERN
> > is not found in my local maven repository or IDE.
>
> Maybe it is not found due to the java compiler inlining constants?
>
> > It’s odd because the bundle (org.apache.sling.engine) says is 2.6.16
> > (using /system/console/bundles). When I expand the bundle details, I
> > see lower versions.
> >
> > Bundle Location       launchpad:resources/install/0/org.apache.sling.
> > engine-2.6.6.jar
> > Exported Packages     org.apache.sling.engine,version=2.3.0
>
> You are most likely using 2.6.16. The bundle location is (IIRC) set to
> the first version of the bundle _or_ the first version of the bundle
> present when a configuration is defined for a component belonging to
> that bundle.
>
> Robert
>
> >
> >
> >
> >
> >
> >
> >
> > > On Mar 29, 2019, at 12:07 PM, Robert Munteanu <ro...@apache.org>
> > > wrote:
> > >
> > > On Fri, 2019-03-29 at 10:47 -0400, Cris Rockwell wrote:
> > > > Hi all
> > > >
> > > > I want to follow up with a question I sent the group last year
> > > > about
> > > > using a suffix patterns when defining Sling Filters.
> > > >
> http://apache-sling.73963.n3.nabble.com/Can-Suffix-be-used-in-the-Sling-Filter-Pattern-td4084561.html
> > > > <
> > > > http://apache-sling.73963.n3.nabble.com/Can-Suffix-be-used-in-the
> > > > -
> > > > Sling-Filter-Pattern-td4084561.html>
> > > >
> > > > The email response at the time was that Suffix patterns cannot be
> > > > used to define a filter, and the advice was to check the suffix
> > > > within the filter itself. If this is the case, then why does the
> > > > documentation describe sling.filter.suffix.pattern as "Restrict
> > > > the
> > > > filter to requests with suffix that match the supplied regular
> > > > expression. Requires Sling Engine 2.6.14.”
> > > >
> > > > https://sling.apache.org/documentation/the-sling-engine/filters.html
> > > > <https://sling.apache.org/documentation/the-sling-
> > > > engine/filters.html>
> > > > Using org.apache.sling.engine 2.6.16, I have not had any luck
> > > > configuring sling.filter.suffix.pattern. If this feature is not
> > > > available or not working, I would recommend updating docs and
> > > > removing it. Also, I would like to review the source code to see
> > > > how
> > > > the sling.filter.suffix.pattern was intended to be used, but I
> > > > cannot
> > > > find it. Please send a link if you can.
> > >
> > > Hi Cris,
> > >
> > > I think this is used at
> > >
> > >
> > >
> https://github.com/apache/sling-org-apache-sling-engine/blob/f2ddb41a68551e6d27a143bca00fb267d7af2230/src/main/java/org/apache/sling/engine/impl/filter/FilterPredicate.java#L67
> > >
> > > Robert
> > >
>
>

Re: Can Suffix be used in the Sling Filter Pattern?

Posted by Robert Munteanu <ro...@apache.org>.
On Fri, 2019-03-29 at 14:27 -0400, Cris Rockwell wrote:
> Ok. Thanks. It must be a version thing, because
> org.apache.sling.engine.EngineConstants.SLING_FILTER_SUFFIX_PATTERN
> is not found in my local maven repository or IDE.

Maybe it is not found due to the java compiler inlining constants?

> It’s odd because the bundle (org.apache.sling.engine) says is 2.6.16
> (using /system/console/bundles). When I expand the bundle details, I
> see lower versions.
> 
> Bundle Location	launchpad:resources/install/0/org.apache.sling.
> engine-2.6.6.jar
> Exported Packages	org.apache.sling.engine,version=2.3.0

You are most likely using 2.6.16. The bundle location is (IIRC) set to
the first version of the bundle _or_ the first version of the bundle
present when a configuration is defined for a component belonging to
that bundle.

Robert

> 
> 
> 
> 
> 
> 
> 
> > On Mar 29, 2019, at 12:07 PM, Robert Munteanu <ro...@apache.org>
> > wrote:
> > 
> > On Fri, 2019-03-29 at 10:47 -0400, Cris Rockwell wrote:
> > > Hi all
> > > 
> > > I want to follow up with a question I sent the group last year
> > > about
> > > using a suffix patterns when defining Sling Filters. 
> > > http://apache-sling.73963.n3.nabble.com/Can-Suffix-be-used-in-the-Sling-Filter-Pattern-td4084561.html
> > > <
> > > http://apache-sling.73963.n3.nabble.com/Can-Suffix-be-used-in-the
> > > -
> > > Sling-Filter-Pattern-td4084561.html>
> > > 
> > > The email response at the time was that Suffix patterns cannot be
> > > used to define a filter, and the advice was to check the suffix
> > > within the filter itself. If this is the case, then why does the
> > > documentation describe sling.filter.suffix.pattern as "Restrict
> > > the
> > > filter to requests with suffix that match the supplied regular
> > > expression. Requires Sling Engine 2.6.14.”
> > > 
> > > https://sling.apache.org/documentation/the-sling-engine/filters.html
> > > <https://sling.apache.org/documentation/the-sling-
> > > engine/filters.html>
> > > Using org.apache.sling.engine 2.6.16, I have not had any luck
> > > configuring sling.filter.suffix.pattern. If this feature is not
> > > available or not working, I would recommend updating docs and
> > > removing it. Also, I would like to review the source code to see
> > > how
> > > the sling.filter.suffix.pattern was intended to be used, but I
> > > cannot
> > > find it. Please send a link if you can.
> > 
> > Hi Cris,
> > 
> > I think this is used at
> > 
> >  
> > https://github.com/apache/sling-org-apache-sling-engine/blob/f2ddb41a68551e6d27a143bca00fb267d7af2230/src/main/java/org/apache/sling/engine/impl/filter/FilterPredicate.java#L67
> > 
> > Robert
> > 


Re: Can Suffix be used in the Sling Filter Pattern?

Posted by Cris Rockwell <cm...@umich.edu>.
Ok. Thanks. It must be a version thing, because org.apache.sling.engine.EngineConstants.SLING_FILTER_SUFFIX_PATTERN is not found in my local maven repository or IDE. It’s odd because the bundle (org.apache.sling.engine) says is 2.6.16 (using /system/console/bundles). When I expand the bundle details, I see lower versions.

Bundle Location	launchpad:resources/install/0/org.apache.sling.engine-2.6.6.jar
Exported Packages	org.apache.sling.engine,version=2.3.0







> On Mar 29, 2019, at 12:07 PM, Robert Munteanu <ro...@apache.org> wrote:
> 
> On Fri, 2019-03-29 at 10:47 -0400, Cris Rockwell wrote:
>> Hi all
>> 
>> I want to follow up with a question I sent the group last year about
>> using a suffix patterns when defining Sling Filters. 
>> http://apache-sling.73963.n3.nabble.com/Can-Suffix-be-used-in-the-Sling-Filter-Pattern-td4084561.html
>> <http://apache-sling.73963.n3.nabble.com/Can-Suffix-be-used-in-the-
>> Sling-Filter-Pattern-td4084561.html>
>> 
>> The email response at the time was that Suffix patterns cannot be
>> used to define a filter, and the advice was to check the suffix
>> within the filter itself. If this is the case, then why does the
>> documentation describe sling.filter.suffix.pattern as "Restrict the
>> filter to requests with suffix that match the supplied regular
>> expression. Requires Sling Engine 2.6.14.”
>> 
>> https://sling.apache.org/documentation/the-sling-engine/filters.html
>> <https://sling.apache.org/documentation/the-sling-
>> engine/filters.html>
>> Using org.apache.sling.engine 2.6.16, I have not had any luck
>> configuring sling.filter.suffix.pattern. If this feature is not
>> available or not working, I would recommend updating docs and
>> removing it. Also, I would like to review the source code to see how
>> the sling.filter.suffix.pattern was intended to be used, but I cannot
>> find it. Please send a link if you can.
> 
> Hi Cris,
> 
> I think this is used at
> 
>  https://github.com/apache/sling-org-apache-sling-engine/blob/f2ddb41a68551e6d27a143bca00fb267d7af2230/src/main/java/org/apache/sling/engine/impl/filter/FilterPredicate.java#L67
> 
> Robert
> 


Re: Can Suffix be used in the Sling Filter Pattern?

Posted by Robert Munteanu <ro...@apache.org>.
On Fri, 2019-03-29 at 10:47 -0400, Cris Rockwell wrote:
> Hi all
> 
> I want to follow up with a question I sent the group last year about
> using a suffix patterns when defining Sling Filters. 
> http://apache-sling.73963.n3.nabble.com/Can-Suffix-be-used-in-the-Sling-Filter-Pattern-td4084561.html
> <http://apache-sling.73963.n3.nabble.com/Can-Suffix-be-used-in-the-
> Sling-Filter-Pattern-td4084561.html>
> 
> The email response at the time was that Suffix patterns cannot be
> used to define a filter, and the advice was to check the suffix
> within the filter itself. If this is the case, then why does the
> documentation describe sling.filter.suffix.pattern as "Restrict the
> filter to requests with suffix that match the supplied regular
> expression. Requires Sling Engine 2.6.14.”
> 
> https://sling.apache.org/documentation/the-sling-engine/filters.html
> <https://sling.apache.org/documentation/the-sling-
> engine/filters.html>
> Using org.apache.sling.engine 2.6.16, I have not had any luck
> configuring sling.filter.suffix.pattern. If this feature is not
> available or not working, I would recommend updating docs and
> removing it. Also, I would like to review the source code to see how
> the sling.filter.suffix.pattern was intended to be used, but I cannot
> find it. Please send a link if you can.

Hi Cris,

I think this is used at

  https://github.com/apache/sling-org-apache-sling-engine/blob/f2ddb41a68551e6d27a143bca00fb267d7af2230/src/main/java/org/apache/sling/engine/impl/filter/FilterPredicate.java#L67

Robert