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 2008/01/02 15:37:46 UTC

Utility code for filtering and packaging trees [JCR-1259]

Hi,

I've created a package with new utility code for filtering and packaging
trees in a repository [1]

A tree can be traversed by the provided tree walker. During the
traversal configurable filters can be applied. The filters have
influence on the traversal, like skipping nodes or properties.
Included filters test the node name, node type etc. Custom filters are
possible as well.
A tree walker notifies a tree walker listener (interface) whenever it
traverses an item.

The second utility code is able to package a whole tree (through a
description) and export this in some way - the exporter is an interface
and could e.g. be an exporter serializing the tree into a zip archiv etc.

What do you think about adding this code "somehow" to the jackrabbit
code base?

Carsten

[1] https://issues.apache.org/jira/browse/JCR-1259
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Utility code for filtering and packaging trees [JCR-1259]

Posted by Carsten Ziegeler <cz...@apache.org>.
I've updated package and class names and added the new patch against 
jackrabbit trunk to the issue.

Carsten


-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Utility code for filtering and packaging trees [JCR-1259]

Posted by Carsten Ziegeler <cz...@apache.org>.
Jukka Zitting wrote:
> Looks better, thanks.
> 
:)

> I was thinking of including the code to jackrabbit-jcr-commons. Would
> you care to do a patch against the latest trunk (I'll take care of
> merging it to 1.4)?
> 
> Also, I think it would be better to rename the filtering packages and
> classes as follows:
> 
>     org.apache.jackrabbit.commons.predicate
>         NamePredicate
>         IsNodePredicate
>         ...
>     org.apache.jackrabbit.commons.visitor
>         FilteringItemVisitor
> 
> I would also turn the DepthItemFilter base class into a standalone
> DepthPredicate that could be combined (composition over inheritance)
> with other predicates.
> 
> If you agree, I can also take care of these changes.
> 
Oh, yes, I forgot to change the package names :(
I think the only problem with directly putting it into jcr commons is
the junit test which starts the repository for testing. But apart from
that, I'm +1 on your suggestion :)

Now, it would be great if you could do this - if not, I'll come up with
a new patch next week.

Many thanks
Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Utility code for filtering and packaging trees [JCR-1259]

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Jan 4, 2008 9:40 AM, Carsten Ziegeler <cz...@apache.org> wrote:
> I've updated the patch according to your suggestions.
>
> WDYT?

Looks better, thanks.

I was thinking of including the code to jackrabbit-jcr-commons. Would
you care to do a patch against the latest trunk (I'll take care of
merging it to 1.4)?

Also, I think it would be better to rename the filtering packages and
classes as follows:

    org.apache.jackrabbit.commons.predicate
        NamePredicate
        IsNodePredicate
        ...
    org.apache.jackrabbit.commons.visitor
        FilteringItemVisitor

I would also turn the DepthItemFilter base class into a standalone
DepthPredicate that could be combined (composition over inheritance)
with other predicates.

If you agree, I can also take care of these changes.

BR,

Jukka Zitting

Re: Utility code for filtering and packaging trees [JCR-1259]

Posted by Carsten Ziegeler <cz...@apache.org>.
I've updated the patch according to your suggestions.

WDYT?

Carsten

Carsten Ziegeler wrote:
> Jukka Zitting wrote:
>> Hi,
>>
>> On Jan 2, 2008 4:37 PM, Carsten Ziegeler <cz...@apache.org> wrote:
>>> I've created a package with new utility code for filtering and packaging
>>> trees in a repository [1]
>>> [...]
>>> What do you think about adding this code "somehow" to the jackrabbit
>>> code base?
>> Sure, I looked at the contribution before Christmas and already
>> thought about including it in jcr-commons for Jackrabbit 1.4, but then
>> I unfortunately forgot about it. :-(
>>
>> I'd definitely welcome the contribution in Jackrabbit, but I have some
>> comments on the design. Following up shortly in JCR-1259...
>>
> Sounds great - I looked at your comments and I'll have a closer look
> tomorrow. I think I considered using the ItemVisitor but then decided
> against it for some reason I currently can't remember... :)
> 
> 
> 
> Carsten


-- 
Carsten Ziegeler
cziegeler@apache.org


Re: Utility code for filtering and packaging trees [JCR-1259]

Posted by Carsten Ziegeler <cz...@apache.org>.
Jukka Zitting wrote:
> Hi,
> 
> On Jan 2, 2008 4:37 PM, Carsten Ziegeler <cz...@apache.org> wrote:
>> I've created a package with new utility code for filtering and packaging
>> trees in a repository [1]
>> [...]
>> What do you think about adding this code "somehow" to the jackrabbit
>> code base?
> 
> Sure, I looked at the contribution before Christmas and already
> thought about including it in jcr-commons for Jackrabbit 1.4, but then
> I unfortunately forgot about it. :-(
> 
> I'd definitely welcome the contribution in Jackrabbit, but I have some
> comments on the design. Following up shortly in JCR-1259...
> 
Sounds great - I looked at your comments and I'll have a closer look
tomorrow. I think I considered using the ItemVisitor but then decided
against it for some reason I currently can't remember... :)



Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Utility code for filtering and packaging trees [JCR-1259]

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Jan 2, 2008 4:37 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> I've created a package with new utility code for filtering and packaging
> trees in a repository [1]
> [...]
> What do you think about adding this code "somehow" to the jackrabbit
> code base?

Sure, I looked at the contribution before Christmas and already
thought about including it in jcr-commons for Jackrabbit 1.4, but then
I unfortunately forgot about it. :-(

I'd definitely welcome the contribution in Jackrabbit, but I have some
comments on the design. Following up shortly in JCR-1259...

BR,

Jukka Zitting