You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Martin Perez <mp...@gmail.com> on 2006/04/09 11:15:31 UTC

Importing workspaces, content handler.

Hi.

The biggest issued that I'm currently facing with Jackrabbit is being able
to migrate workspaces from one version to another. For example, I have on
the recent version of my nodetypes hierarchy I have removed two properties.
This removal forces me to be able to migrate workspaces from previous
versions using some SAX parsing algorithm.

So my approach is:
  - read the exported workspace file
  - Filter the content through SAX handlers
  - Import the content on the new workspace.

So my first question is do  you know about better alternatives than this
approach?

And then I would also want to raise discussion about having the possibility
of setting the import content handler on Jackrabbit. If I could extend the
current import content handler and set that customized import content
handler on the repository then it would be easier for me to perform the
migration. I think that this is also something very reasonable, to be able
to customize the import algorithm on your repositories.

What do you think? Can I open a JIRA improvement?

Martin

Re: Importing workspaces, content handler.

Posted by Martin Perez <mp...@gmail.com>.
Yes. I have done exactly that and works fine, but I think that be able to
set or extend the Jackrabbit content handler programatically would be a good
thing.

If we could set it, then we could create wrapper content handlers around the
current Jackrabbit content handler, and so filtering will be trivial.

If we could extend it then we could implement the filter with something like
template methods.

Martin



On 4/10/06, Stefan Guggisberg <st...@gmail.com> wrote:
>
> hi martin
>
> On 4/9/06, Martin Perez <mp...@gmail.com> wrote:
> > Hi.
> >
> > The biggest issued that I'm currently facing with Jackrabbit is being
> able
> > to migrate workspaces from one version to another. For example, I have
> on
> > the recent version of my nodetypes hierarchy I have removed two
> properties.
> > This removal forces me to be able to migrate workspaces from previous
> > versions using some SAX parsing algorithm.
> >
> > So my approach is:
> >   - read the exported workspace file
> >   - Filter the content through SAX handlers
> >   - Import the content on the new workspace.
> >
> > So my first question is do  you know about better alternatives than this
> > approach?
> >
> > And then I would also want to raise discussion about having the
> possibility
> > of setting the import content handler on Jackrabbit. If I could extend
> the
> > current import content handler and set that customized import content
> > handler on the repository then it would be easier for me to perform the
> > migration. I think that this is also something very reasonable, to be
> able
> > to customize the import algorithm on your repositories.
> >
> > What do you think? Can I open a JIRA improvement?
>
> the current 'import' implementation is quite complex as it has to deal
> with a lot of 'under-the-hood' details. for that reason i would rather not
> make it pluggable.
>
> you could e.g. write your own sax event handler that does some custom
> filtering before delegating to the handler returned by
> Workspace#getImportContentHandler.
>
> cheers
> stefan
>
> >
> > Martin
> >
> >
>

Re: Importing workspaces, content handler.

Posted by Stefan Guggisberg <st...@gmail.com>.
hi martin

On 4/9/06, Martin Perez <mp...@gmail.com> wrote:
> Hi.
>
> The biggest issued that I'm currently facing with Jackrabbit is being able
> to migrate workspaces from one version to another. For example, I have on
> the recent version of my nodetypes hierarchy I have removed two properties.
> This removal forces me to be able to migrate workspaces from previous
> versions using some SAX parsing algorithm.
>
> So my approach is:
>   - read the exported workspace file
>   - Filter the content through SAX handlers
>   - Import the content on the new workspace.
>
> So my first question is do  you know about better alternatives than this
> approach?
>
> And then I would also want to raise discussion about having the possibility
> of setting the import content handler on Jackrabbit. If I could extend the
> current import content handler and set that customized import content
> handler on the repository then it would be easier for me to perform the
> migration. I think that this is also something very reasonable, to be able
> to customize the import algorithm on your repositories.
>
> What do you think? Can I open a JIRA improvement?

the current 'import' implementation is quite complex as it has to deal
with a lot of 'under-the-hood' details. for that reason i would rather not
make it pluggable.

you could e.g. write your own sax event handler that does some custom
filtering before delegating to the handler returned by
Workspace#getImportContentHandler.

cheers
stefan

>
> Martin
>
>