You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Carsten Ziegeler <cz...@apache.org> on 2016/10/18 13:20:02 UTC

Glob filtering of JCR events?

Hi,

I'm wondering if it is possible to register a JCR event listener with a
glob filter through some Jackrabbit/Oak API?
I already found JackrabbitEventFilter but that does not seem to support
globbing.

Regards
Carsten
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: Glob filtering of JCR events?

Posted by Stefan Egli <st...@apache.org>.
Hi Carsten,

<non-authorative answer disclaimer/>

Was assuming this is supported since I saw the FilterBuilder does support
this ([0]).

But it looks like the NamePathMapper ([1]) complains when it wants to map
a path containing * or **...

So not sure what the official state of glob support is..

Cheers,
Stefan
--
[0] - 
https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/
org/apache/jackrabbit/oak/plugins/observation/filter/FilterBuilder.java#L47
1
[1] - 
https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/
org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java#L80

On 18/10/16 15:20, "Carsten Ziegeler" <cz...@apache.org> wrote:

>Hi,
>
>I'm wondering if it is possible to register a JCR event listener with a
>glob filter through some Jackrabbit/Oak API?
>I already found JackrabbitEventFilter but that does not seem to support
>globbing.
>
>Regards
>Carsten
>-- 
>Carsten Ziegeler
>Adobe Research Switzerland
>cziegeler@apache.org



Re: Glob filtering of JCR events?

Posted by Chetan Mehrotra <ch...@gmail.com>.
I think this can be exposed that. Given we also need to expose support
for propertyName based filter and few other new filtering criteria its
time we have JackrabbitEventFilter updated for that
Chetan Mehrotra


On Tue, Oct 18, 2016 at 8:33 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> Stefan Egli wrote
>> On 18/10/16 16:44, "Michael Dürig" <md...@apache.org> wrote:
>>
>>> On 18.10.16 4:39 , Stefan Egli wrote:
>>>> On 18/10/16 16:09, "Michael Dürig" <md...@apache.org> wrote:
>>>>
>>>>> Oak has some support for glob filters. An official API has yet to be
>>>>> built though.
>>>>
>>>> What API changes were you thinking of? This sounds like implying that we
>>>> can't declare the current JackrabbitEventFilter to now support glob
>>>> filters?
>>>
>>> The glob support we have in Oak is currently not exposed through an
>>> official API.
>>>
>>> I'm not implying that it cannot be exposed in any way. Neither am I
>>> implying that it is the right kind of glob support for Sling's use case
>>> nor anything else ;-)
>>
>> Sure. Taking the 'imply' part back then ;)
>>
>> My 'implied' assumption though was that it would be possible to support
>> glob filtering through the JackrabbitEventFilter's already existing
>> properties, namely the (include) paths. So atm we don't support glob for
>> those paths. But to add support could perhaps be done by 'just' changing
>> the javadoc (and of course the underlying implementation - but not the
>> interface itself). But perhaps I'm missing some parts of the picture here.
>> There might then of course be some question as to what and where exactly
>> glob wildcards are supported (and does that match what Sling needs).
>>
> I think the requirement is easy: glob support which afaik are well
> defined patterns, e.g.
> documented at
> https://jackrabbit.apache.org/oak/docs/apidocs/org/apache/jackrabbit/oak/plugins/observation/filter/GlobbingPathFilter.html
>
> In Sling we use that definition for observation paths. SO if an
> observation path matches that pattern, the listener gets the event
> (respecting change type of course)
>
> Regards
>
>  Carsten
>
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziegeler@apache.org
>

Re: Glob filtering of JCR events?

Posted by Carsten Ziegeler <cz...@apache.org>.
Stefan Egli wrote
> On 18/10/16 16:44, "Michael Drig" <md...@apache.org> wrote:
> 
>> On 18.10.16 4:39 , Stefan Egli wrote:
>>> On 18/10/16 16:09, "Michael Drig" <md...@apache.org> wrote:
>>>
>>>> Oak has some support for glob filters. An official API has yet to be
>>>> built though.
>>>
>>> What API changes were you thinking of? This sounds like implying that we
>>> can't declare the current JackrabbitEventFilter to now support glob
>>> filters?
>>
>> The glob support we have in Oak is currently not exposed through an
>> official API.
>>
>> I'm not implying that it cannot be exposed in any way. Neither am I
>> implying that it is the right kind of glob support for Sling's use case
>> nor anything else ;-)
> 
> Sure. Taking the 'imply' part back then ;)
> 
> My 'implied' assumption though was that it would be possible to support
> glob filtering through the JackrabbitEventFilter's already existing
> properties, namely the (include) paths. So atm we don't support glob for
> those paths. But to add support could perhaps be done by 'just' changing
> the javadoc (and of course the underlying implementation - but not the
> interface itself). But perhaps I'm missing some parts of the picture here.
> There might then of course be some question as to what and where exactly
> glob wildcards are supported (and does that match what Sling needs).
> 
I think the requirement is easy: glob support which afaik are well
defined patterns, e.g.
documented at
https://jackrabbit.apache.org/oak/docs/apidocs/org/apache/jackrabbit/oak/plugins/observation/filter/GlobbingPathFilter.html

In Sling we use that definition for observation paths. SO if an
observation path matches that pattern, the listener gets the event
(respecting change type of course)

Regards

 Carsten

-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org


Re: Glob filtering of JCR events?

Posted by Stefan Egli <st...@apache.org>.
On 18/10/16 16:44, "Michael Dürig" <md...@apache.org> wrote:

>On 18.10.16 4:39 , Stefan Egli wrote:
>> On 18/10/16 16:09, "Michael Dürig" <md...@apache.org> wrote:
>>
>>> Oak has some support for glob filters. An official API has yet to be
>>> built though.
>>
>> What API changes were you thinking of? This sounds like implying that we
>> can't declare the current JackrabbitEventFilter to now support glob
>> filters?
>
>The glob support we have in Oak is currently not exposed through an
>official API.
>
>I'm not implying that it cannot be exposed in any way. Neither am I
>implying that it is the right kind of glob support for Sling's use case
>nor anything else ;-)

Sure. Taking the 'imply' part back then ;)

My 'implied' assumption though was that it would be possible to support
glob filtering through the JackrabbitEventFilter's already existing
properties, namely the (include) paths. So atm we don't support glob for
those paths. But to add support could perhaps be done by 'just' changing
the javadoc (and of course the underlying implementation - but not the
interface itself). But perhaps I'm missing some parts of the picture here.
There might then of course be some question as to what and where exactly
glob wildcards are supported (and does that match what Sling needs).

Cheers,
Stefan



Re: Glob filtering of JCR events?

Posted by Michael Dürig <md...@apache.org>.

On 18.10.16 4:39 , Stefan Egli wrote:
> On 18/10/16 16:09, "Michael Drig" <md...@apache.org> wrote:
>
>> Oak has some support for glob filters. An official API has yet to be
>> built though.
>
> What API changes were you thinking of? This sounds like implying that we
> can't declare the current JackrabbitEventFilter to now support glob
> filters?

The glob support we have in Oak is currently not exposed through an 
official API.

I'm not implying that it cannot be exposed in any way. Neither am I 
implying that it is the right kind of glob support for Sling's use case 
nor anything else ;-)

Michael


>
> Cheers,
> Stefan
>
>

Re: Glob filtering of JCR events?

Posted by Stefan Egli <st...@apache.org>.
On 18/10/16 16:09, "Michael Dürig" <md...@apache.org> wrote:

>Oak has some support for glob filters. An official API has yet to be
>built though.

What API changes were you thinking of? This sounds like implying that we
can't declare the current JackrabbitEventFilter to now support glob
filters?

Cheers,
Stefan



Re: Glob filtering of JCR events?

Posted by Carsten Ziegeler <cz...@apache.org>.
Michael D�rig wrote
> 
> Hi,
> 
> Oak has some support for glob filters. An official API has yet to be
> built though.
> 
Ok, great, when can we expect the API?
Otherwise I guess we have to move back to an observer in Sling

 Carsten

-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org


Re: Glob filtering of JCR events?

Posted by Michael Dürig <md...@apache.org>.
Hi,

Oak has some support for glob filters. An official API has yet to be 
built though.

Michael

On 18.10.16 3:20 , Carsten Ziegeler wrote:
> Hi,
>
> I'm wondering if it is possible to register a JCR event listener with a
> glob filter through some Jackrabbit/Oak API?
> I already found JackrabbitEventFilter but that does not seem to support
> globbing.
>
> Regards
> Carsten
>