You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Nicolas <nt...@gmail.com> on 2006/08/06 20:59:36 UTC

Issue when restoring the Node version history

Hi,

I have encountered an issue when restoring the node version history. As you
know it is part of the shared subtree /jcr:system. All the versioning is
contained within /jcr:system/jcr:versionStorage. All those nodes are
protected. I have backupped the data by using the exportXML method of
Session.

I encounter a problem to restore it since those node is protected. I have
found quite a few different approach to restore them. I need your feedback
and your ideas on this please to know which one is the best.

1/ Modify temporarily the NodeDefinition of jcr:storage so it is not
protected.
This approach would modify the NodeDefinition of the protected nodes so they
can be unprotected. I would restore the data using import and then restore
the protection and reload the repository. This way seems the easiest to
achieve restore.

2/ Redefine InternalAddChild in NodeImpl so I can bypass protection. This
method is protected. I would need to add a public method in NodeImpl which
would not check any protection. I would then be able to import the data
using importXML.

3/ Add to the VersionManagerImpl a public import method heavily based on the
SessionImpl one. This solution seems the most elegant but might not be the
easiest.

4/ Change the storage format (right now the sysView) in order to get an
easier restore (using for instance Java serialization).

What do you think?

Nico
my blog! http://www.deviant-abstraction.net !!

RE: Issue when restoring the Node version history

Posted by Miro Walker <mi...@cognifide.com>.
Hi Stefan,

Just out of curiosity, under what circumstances could it be useful to
backup/restore the repository without the version storage? If you're
using versionable nodes, then if you lose the version history you end up
in a right old mess. Is there a usage scenario I'm missing here?

miro



-----Original Message-----
From: Stefan Guggisberg [mailto:stefan.guggisberg@gmail.com] 
Sent: 09 August 2006 09:43
To: dev@jackrabbit.apache.org
Subject: Re: Issue when restoring the Node version history

On 8/8/06, Nicolas <nt...@gmail.com> wrote:
> Hi Tobias,
>
> The issue I have is nothing allow
>
> It's really simpler for me to update all protected nodes, restore the
> version history and then switch back to the protection. However to do
so, I
> don't see any other option than adding a method reregisterBuiltIn in
the
> NodeTypeManager... I am not sure if it's a wise decision.

it's not, -1 for reregisterBuiltIn

importXML is not suitable for restoring system managed data.
restoring version data (whether that's a good idea is another question)
should definitely be handled by the VersionManager.

cheers
stefan

> Besides when I
> try  commenting those check, the import is false. I think some
reference are
> out of date...
>
> So unless you have a better idea, I have to implement an importXML
method
> for the Versioning. This method will have to be in core and would
import any
> /jcr:system/jcr:versionStorage of Jackrabbit.
>
> What do you think of this solution? Do you have a better idea?
>
> Nico
>
> On 8/7/06, Nicolas <nt...@gmail.com> wrote:
> >
> >
> >
> > ---------- Forwarded message ----------
> > From: Nicolas < ntoper@gmail.com>
> > Date: Aug 7, 2006 11:33 AM
> > Subject: Re: Issue when restoring the Node version history
> > To: tobias.bocanegra@day.com
> >
> > Yes that's why I thought :)
> >
> > I do think however, adding an import method to the VersionManager is
way
> > more elegant. Do you agree?
> >
> >
> > On 8/7/06, Tobias Bocanegra <to...@day.com> wrote:
> > >
> > > > Why wouldn't it work if we bypass the VersionManager?
> > >
> > > you would need to flush all the caches. but since you probably
restart
> > > the repo anyways after restore, this might not be a problem.
> > >
> > > regards, toby
> > > --
> > > -----------------------------------------<
tobias.bocanegra@day.com >---
> > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001
Basel
> > > T +41 61 226 98 98, F +41 61 226 98 97
> > > -----------------------------------------------<
http://www.day.com >---
> > >
> >
> >
> >
> > --
> > a+
> >
> > Nico
> > my blog! http://www.deviant-abstraction.net !!
> >
> >
> > --
> > a+
> > Nico
> > my blog! http://www.deviant-abstraction.net !!
> >
>
>
>
> --
> a+
> Nico
> my blog! http://www.deviant-abstraction.net !!
>
>

Re: Issue when restoring the Node version history

Posted by Stefan Guggisberg <st...@gmail.com>.
On 8/8/06, Nicolas <nt...@gmail.com> wrote:
> Hi Tobias,
>
> The issue I have is nothing allow
>
> It's really simpler for me to update all protected nodes, restore the
> version history and then switch back to the protection. However to do so, I
> don't see any other option than adding a method reregisterBuiltIn in the
> NodeTypeManager... I am not sure if it's a wise decision.

it's not, -1 for reregisterBuiltIn

importXML is not suitable for restoring system managed data.
restoring version data (whether that's a good idea is another question)
should definitely be handled by the VersionManager.

cheers
stefan

> Besides when I
> try  commenting those check, the import is false. I think some reference are
> out of date...
>
> So unless you have a better idea, I have to implement an importXML method
> for the Versioning. This method will have to be in core and would import any
> /jcr:system/jcr:versionStorage of Jackrabbit.
>
> What do you think of this solution? Do you have a better idea?
>
> Nico
>
> On 8/7/06, Nicolas <nt...@gmail.com> wrote:
> >
> >
> >
> > ---------- Forwarded message ----------
> > From: Nicolas < ntoper@gmail.com>
> > Date: Aug 7, 2006 11:33 AM
> > Subject: Re: Issue when restoring the Node version history
> > To: tobias.bocanegra@day.com
> >
> > Yes that's why I thought :)
> >
> > I do think however, adding an import method to the VersionManager is way
> > more elegant. Do you agree?
> >
> >
> > On 8/7/06, Tobias Bocanegra <to...@day.com> wrote:
> > >
> > > > Why wouldn't it work if we bypass the VersionManager?
> > >
> > > you would need to flush all the caches. but since you probably restart
> > > the repo anyways after restore, this might not be a problem.
> > >
> > > regards, toby
> > > --
> > > -----------------------------------------< tobias.bocanegra@day.com >---
> > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> > > T +41 61 226 98 98, F +41 61 226 98 97
> > > -----------------------------------------------< http://www.day.com >---
> > >
> >
> >
> >
> > --
> > a+
> >
> > Nico
> > my blog! http://www.deviant-abstraction.net !!
> >
> >
> > --
> > a+
> > Nico
> > my blog! http://www.deviant-abstraction.net !!
> >
>
>
>
> --
> a+
> Nico
> my blog! http://www.deviant-abstraction.net !!
>
>

Re: Issue when restoring the Node version history

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

On 8/12/06, Nicolas <nt...@gmail.com> wrote:
> Thanks for your help. Not really, it is about the issue of childNode with
> autocreated node. I think I have solved it, but now I have this exception:
>
> Unable to resolve path for item: 1f4dc460-88b4-4dea-9310-4558e3486848:
> Unable to resolve path for item: 1f4dc460-88b4-4dea-9310-4558e3486848
>
> Of course, this item is NOT in my history.xml file.

Any context on when this error occurs? While processing some specific
node? When you bypass the protection checks like you do in the custom
importer, you might trip Jackrabbit to assuming something incorrect.

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

Re: Issue when restoring the Node version history

Posted by Nicolas <nt...@gmail.com>.
Hi Jukka,

Thanks for your help. Not really, it is about the issue of childNode with
autocreated node. I think I have solved it, but now I have this exception:

Unable to resolve path for item: 1f4dc460-88b4-4dea-9310-4558e3486848:
Unable to resolve path for item: 1f4dc460-88b4-4dea-9310-4558e3486848

Of course, this item is NOT in my history.xml file.

Any idea on this please?

Nico

On 8/11/06, Jukka Zitting <ju...@gmail.com> wrote:
>
> Hi,
>
> On 8/11/06, Nicolas <nt...@gmail.com> wrote:
> > It's not. It's a versionStorage... But I don't see why. Do you have an
> idea?
>
> Keep track of the parents stack. I think it gets out of sync at some
> point.
>
> BR,
>
> Jukka Zitting
>
> --
> Yukatan - http://yukatan.fi/ - info@yukatan.fi
> Software craftsmanship, JCR consulting, and Java development
>



-- 
a+
Nico
my blog! http://www.deviant-abstraction.net !!

Re: Issue when restoring the Node version history

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

On 8/11/06, Nicolas <nt...@gmail.com> wrote:
> It's not. It's a versionStorage... But I don't see why. Do you have an idea?

Keep track of the parents stack. I think it gets out of sync at some point.

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

Re: Issue when restoring the Node version history

Posted by Nicolas <nt...@gmail.com>.
Hi,
It's not. It's a versionStorage... But I don't see why. Do you have an idea?

BR
Nico
my blog! http://www.deviant-abstraction.net !!

Re: Issue when restoring the Node version history

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

On 8/11/06, Nicolas <nt...@gmail.com> wrote:
> no matching child node definition found for
> {http://www.jcp.org/jcr/1.0}rootVersion

Can you verify that the parent node under which you are importing
jcr:rootVersion node is actually a nt:versionHistory node? Could the
parents stack get out of sync at some point?

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

Re: Issue when restoring the Node version history

Posted by Nicolas <nt...@gmail.com>.
Sure, here it is. It is a working copy so some things are stupid (they are
there only for me to test a few things).

Enclosed you will find the relevant sysView.xml

Here is the complete exception stack:

Exception in thread "main" javax.jcr.nodetype.ConstraintViolationException:
no matching child node definition found for {
http://www.jcp.org/jcr/1.0}rootVersion
    at
org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicableChildNodeDef
(EffectiveNodeType.java:737)
    at
org.apache.jackrabbit.core.BatchedItemOperations.findApplicableNodeDefinition
(BatchedItemOperations.java:881)
    at org.apache.jackrabbit.core.BatchedItemOperations.createNodeState(
BatchedItemOperations.java:975)
    at org.apache.jackrabbit.backup.RestoreNodeVersionImporter.startNode(
RestoreNodeVersionImporter.java:180)
    at org.apache.jackrabbit.core.xml.SysViewImportHandler.processNode(
SysViewImportHandler.java:86)
    at org.apache.jackrabbit.core.xml.SysViewImportHandler.startElement(
SysViewImportHandler.java:131)
    at org.apache.jackrabbit.core.xml.ImportHandler.startElement(
ImportHandler.java:192)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
    at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.jackrabbit.backup.NodeVersionHistoriesBackup.importXML(
NodeVersionHistoriesBackup.java:121)
    at org.apache.jackrabbit.backup.NodeVersionHistoriesBackup.restore(
NodeVersionHistoriesBackup.java:95)
    at org.apache.jackrabbit.backup.BackupManager.restore(BackupManager.java
:138)
    at org.apache.jackrabbit.backup.LaunchBackup.restore(LaunchBackup.java
:298)
    at org.apache.jackrabbit.backup.LaunchBackup.main(LaunchBackup.java:169)
    at org.apache.jackrabbit.backup.BackupTest.main(BackupTest.java:154)

Thanks for the help
Nico


On 8/11/06, Jukka Zitting <ju...@gmail.com> wrote:
>
> Hi,
>
> On 8/11/06, Nicolas <nt...@gmail.com> wrote:
> > Exception in thread "main"
> javax.jcr.nodetype.ConstraintViolationException:
> > no mat)hing child node definition found for {
> > http://www.jcp.org/jcr/1.0}rootVersion
> >
> > This exception is raised when I call getEffectiveNodeType...
>
> Could you send your piece of code and the relevant system view XML
> snippet that causes this exception?
>
> BR,
>
> Jukka Zitting
>
> --
> Yukatan - http://yukatan.fi/ - info@yukatan.fi
> Software craftsmanship, JCR consulting, and Java development
>



-- 
a+
Nico
my blog! http://www.deviant-abstraction.net !!

Re: Issue when restoring the Node version history

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

On 8/11/06, Nicolas <nt...@gmail.com> wrote:
> Exception in thread "main" javax.jcr.nodetype.ConstraintViolationException:
> no matching child node definition found for {
> http://www.jcp.org/jcr/1.0}rootVersion
>
> This exception is raised when I call getEffectiveNodeType...

Could you send your piece of code and the relevant system view XML
snippet that causes this exception?

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

Re: Issue when restoring the Node version history

Posted by Nicolas <nt...@gmail.com>.
Actually, I have followed you advice and Jukka's one about writing a custom
importer based on WorkspaceImporter. However, after deleting all checks and
rewriting some part of the code, I have this exception:

Exception in thread "main" javax.jcr.nodetype.ConstraintViolationException:
no matching child node definition found for {
http://www.jcp.org/jcr/1.0}rootVersion

This exception is raised when I call getEffectiveNodeType...

Where does this could come from? I really don't see.

Nico

On 8/9/06, Nicolas <nt...@gmail.com> wrote:
>
> No I am writing this importer and wondering if there is a better way :)
>
> On 8/9/06, Tobias Bocanegra <tobias.bocanegra@day.com > wrote:
>
> > you've written an importer that operates directly on the local item
> > state manager of the versioning virtual workspace?
> >
> >
> > --
> > -----------------------------------------< tobias.bocanegra@day.com >---
> > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> > T +41 61 226 98 98, F +41 61 226 98 97
> > -----------------------------------------------< http://www.day.com >---
> >
>
>
>
> --
> a+
>
> Nico
> my blog! http://www.deviant-abstraction.net !!
>



-- 
a+
Nico
my blog! http://www.deviant-abstraction.net !!

Re: Issue when restoring the Node version history

Posted by Nicolas <nt...@gmail.com>.
No I am writing this importer and wondering if there is a better way :)

On 8/9/06, Tobias Bocanegra <to...@day.com> wrote:
>
> you've written an importer that operates directly on the local item
> state manager of the versioning virtual workspace?
>
>
> --
> -----------------------------------------< tobias.bocanegra@day.com >---
> Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> T +41 61 226 98 98, F +41 61 226 98 97
> -----------------------------------------------< http://www.day.com >---
>



-- 
a+
Nico
my blog! http://www.deviant-abstraction.net !!

Re: Issue when restoring the Node version history

Posted by Tobias Bocanegra <to...@day.com>.
> On 8/9/06, Tobias Bocanegra <to...@day.com> wrote:
> > > Hi Tobias,
> > >
> > > The issue I have is nothing allow
> > >
> > > It's really simpler for me to update all protected nodes, restore the
> > > version history and then switch back to the protection. However to do
> so, I
> > > don't see any other option than adding a method reregisterBuiltIn in the
> > > NodeTypeManager... I am not sure if it's a wise decision. Besides when I
> > > try  commenting those check, the import is false. I think some reference
> are
> > > out of date...
> > >
> > > So unless you have a better idea, I have to implement an importXML
> method
> > > for the Versioning. This method will have to be in core and would import
> any
> > > /jcr:system/jcr:versionStorage of Jackrabbit.
> > >
> > > What do you think of this solution? Do you have a better idea?
> > i would write an own
> org.apache.jackrabbit.core.xml.Importer that does
> > not check the protected states, and then use this one for the version
> > workspace. i would even setup an own fake workspace for the version
> > storage and not go via the normal one.
> >
> Are you sure no modifications are done (update of the UUID for instance)? I
> have tried the way you described and it didn't seem to work properly. I had
> no error but when I reexport the subtree, its weight was half on the
> original.
>
> I had add a look at the JSR170 spec on this and it seems some kind of
> treatment must apply to the nodes reimported...
>
> Am I misunderstanding something please?

you've written an importer that operates directly on the local item
state manager of the versioning virtual workspace?


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: Issue when restoring the Node version history

Posted by Nicolas <nt...@gmail.com>.
Tobias,

Are you sure no modifications are done (update of the UUID for instance)? I
have tried the way you described and it didn't seem to work properly. I had
no error but when I reexport the subtree, its weight was half on the
original.

I had add a look at the JSR170 spec on this and it seems some kind of
treatment must apply to the nodes reimported...

Am I misunderstanding something please?

Nico
my blog! http://www.deviant-abstraction.net !!

On 8/9/06, Tobias Bocanegra <to...@day.com> wrote:
>
> > Hi Tobias,
> >
> > The issue I have is nothing allow
> >
> > It's really simpler for me to update all protected nodes, restore the
> > version history and then switch back to the protection. However to do
> so, I
> > don't see any other option than adding a method reregisterBuiltIn in the
> > NodeTypeManager... I am not sure if it's a wise decision. Besides when I
> > try  commenting those check, the import is false. I think some reference
> are
> > out of date...
> >
> > So unless you have a better idea, I have to implement an importXML
> method
> > for the Versioning. This method will have to be in core and would import
> any
> > /jcr:system/jcr:versionStorage of Jackrabbit.
> >
> > What do you think of this solution? Do you have a better idea?
> i would write an own org.apache.jackrabbit.core.xml.Importer that does
> not check the protected states, and then use this one for the version
> workspace. i would even setup an own fake workspace for the version
> storage and not go via the normal one.
>
> regards, toby
> --
> -----------------------------------------< tobias.bocanegra@day.com >---
> Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> T +41 61 226 98 98, F +41 61 226 98 97
> -----------------------------------------------< http://www.day.com >---
>

Re: Issue when restoring the Node version history

Posted by Tobias Bocanegra <to...@day.com>.
> Hi Tobias,
>
> The issue I have is nothing allow
>
> It's really simpler for me to update all protected nodes, restore the
> version history and then switch back to the protection. However to do so, I
> don't see any other option than adding a method reregisterBuiltIn in the
> NodeTypeManager... I am not sure if it's a wise decision. Besides when I
> try  commenting those check, the import is false. I think some reference are
> out of date...
>
> So unless you have a better idea, I have to implement an importXML method
> for the Versioning. This method will have to be in core and would import any
> /jcr:system/jcr:versionStorage of Jackrabbit.
>
> What do you think of this solution? Do you have a better idea?
i would write an own org.apache.jackrabbit.core.xml.Importer that does
not check the protected states, and then use this one for the version
workspace. i would even setup an own fake workspace for the version
storage and not go via the normal one.

regards, toby
-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: Issue when restoring the Node version history

Posted by Nicolas <nt...@gmail.com>.
Hi Tobias,

The issue I have is nothing allow

It's really simpler for me to update all protected nodes, restore the
version history and then switch back to the protection. However to do so, I
don't see any other option than adding a method reregisterBuiltIn in the
NodeTypeManager... I am not sure if it's a wise decision. Besides when I
try  commenting those check, the import is false. I think some reference are
out of date...

So unless you have a better idea, I have to implement an importXML method
for the Versioning. This method will have to be in core and would import any
/jcr:system/jcr:versionStorage of Jackrabbit.

What do you think of this solution? Do you have a better idea?

Nico

On 8/7/06, Nicolas <nt...@gmail.com> wrote:
>
>
>
> ---------- Forwarded message ----------
> From: Nicolas < ntoper@gmail.com>
> Date: Aug 7, 2006 11:33 AM
> Subject: Re: Issue when restoring the Node version history
> To: tobias.bocanegra@day.com
>
> Yes that's why I thought :)
>
> I do think however, adding an import method to the VersionManager is way
> more elegant. Do you agree?
>
>
> On 8/7/06, Tobias Bocanegra <to...@day.com> wrote:
> >
> > > Why wouldn't it work if we bypass the VersionManager?
> >
> > you would need to flush all the caches. but since you probably restart
> > the repo anyways after restore, this might not be a problem.
> >
> > regards, toby
> > --
> > -----------------------------------------< tobias.bocanegra@day.com >---
> > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> > T +41 61 226 98 98, F +41 61 226 98 97
> > -----------------------------------------------< http://www.day.com >---
> >
>
>
>
> --
> a+
>
> Nico
> my blog! http://www.deviant-abstraction.net !!
>
>
> --
> a+
> Nico
> my blog! http://www.deviant-abstraction.net !!
>



-- 
a+
Nico
my blog! http://www.deviant-abstraction.net !!

Issue when restoring the Node version history

Posted by Nicolas <nt...@gmail.com>.
---------- Forwarded message ----------
From: Nicolas <nt...@gmail.com>
Date: Aug 7, 2006 11:33 AM
Subject: Re: Issue when restoring the Node version history
To: tobias.bocanegra@day.com

Yes that's why I thought :)

I do think however, adding an import method to the VersionManager is way
more elegant. Do you agree?


On 8/7/06, Tobias Bocanegra <to...@day.com> wrote:
>
> > Why wouldn't it work if we bypass the VersionManager?
>
> you would need to flush all the caches. but since you probably restart
> the repo anyways after restore, this might not be a problem.
>
> regards, toby
> --
> -----------------------------------------< tobias.bocanegra@day.com >---
> Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> T +41 61 226 98 98, F +41 61 226 98 97
> -----------------------------------------------< http://www.day.com >---
>



-- 
a+

Nico
my blog! http://www.deviant-abstraction.net !!


-- 
a+
Nico
my blog! http://www.deviant-abstraction.net !!

Re: Issue when restoring the Node version history

Posted by Tobias Bocanegra <to...@day.com>.
> Why wouldn't it work if we bypass the VersionManager?

you would need to flush all the caches. but since you probably restart
the repo anyways after restore, this might not be a problem.

regards, toby
-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: Issue when restoring the Node version history

Posted by Nicolas <nt...@gmail.com>.
Why wouldn't it work if we bypass the VersionManager?

BR
Nico
my blog! http://www.deviant-abstraction.net !!

Re: Issue when restoring the Node version history

Posted by Tobias Bocanegra <to...@day.com>.
> Hi,
>
> I have encountered an issue when restoring the node version history. As you
> know it is part of the shared subtree /jcr:system. All the versioning is
> contained within /jcr:system/jcr:versionStorage. All those nodes are
> protected. I have backupped the data by using the exportXML method of
> Session.
>
> I encounter a problem to restore it since those node is protected. I have
> found quite a few different approach to restore them. I need your feedback
> and your ideas on this please to know which one is the best.
>
> 1/ Modify temporarily the NodeDefinition of jcr:storage so it is not
> protected.
> This approach would modify the NodeDefinition of the protected nodes so they
> can be unprotected. I would restore the data using import and then restore
> the protection and reload the repository. This way seems the easiest to
> achieve restore.
>
> 2/ Redefine InternalAddChild in NodeImpl so I can bypass protection. This
> method is protected. I would need to add a public method in NodeImpl which
> would not check any protection. I would then be able to import the data
> using importXML.
>
> 3/ Add to the VersionManagerImpl a public import method heavily based on the
> SessionImpl one. This solution seems the most elegant but might not be the
> easiest.
>
> 4/ Change the storage format (right now the sysView) in order to get an
> easier restore (using for instance Java serialization).
>
> What do you think?

i would go for 3, since 1+2 do not work because they bypass the versionmanager.

regards, toby


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: AbstractSAXEventGenerator query

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

On 8/7/06, Stefan Guggisberg <st...@gmail.com> wrote:
> AbstractSAXEventGenerator is a core class. i try to avoid making internal
> jackrabbit classes public in order to discourage their use from outside of the
> core package. core classes should not be externally referenced as they might
> change at any time and without notice.

+1

> if AbstractSAXEventGenerator is reasonably generic and without
> dependencies on the core we could consider moving it to a 'util'
> package. feel free to file an 'enhancement' issue.

+1 to this as well. The XML exporters and perhaps even the XML
importers after some refactoring to remove the direct Jackrabbit
dependencies would IMHO be good candidates for inclusion in Jackrabbit
commons.

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

Re: AbstractSAXEventGenerator query

Posted by Jack Park <ja...@sri.com>.
Thanks!

What I have done in the mean time is simply clone code from two classes, 
AbstractSAXEventGenerator and the class that extends it and, from that, 
written my own exporter that works fine!

I don't have the results in front of me, and perhaps I should try 
another export just to prove it again (in case some code changed 
recently), but, the general form of an export I did looks like this:
<node ...>
   <property...>
   </property>
   <property...>
   </property>
<node...>
  ...
I did not see any </node>
But, I will say this: I only hand cleaned up the first half dozen nodes 
in a fairly large export. Exports come without any line breaks for 
prettyprinting, so it's quite a chore to turn the file into a 
"prettyprint" appearance to see the missing </node>

I should point out that I remain most pleased with jackrabbit!

Thanks
Jack

Stefan Guggisberg wrote:
> On 8/6/06, Jack Park <ja...@sri.com> wrote:
>> What might be the objections raised to turning this abstract class into
>> a public one (in future distributions) for purposes of allowing others
>> to write exporters in jackrabbit applications that have different
>> behaviors? That would be done by externally extending this class. (I
>> realize that, as a default, one can simply duplicate the code in this
>> class externally).
>
> AbstractSAXEventGenerator is a core class. i try to avoid making internal
> jackrabbit classes public in order to discourage their use from 
> outside of the
> core package. core classes should not be externally referenced as they 
> might
> change at any time and without notice.
>
> if AbstractSAXEventGenerator is reasonably generic and without
> dependencies on the core we could consider moving it to a 'util'
> package. feel free to file an 'enhancement' issue.
>
>>
>> As a for instance, I would prefer to be able to just export an arbitrary
>> node (perhaps there is a way, but I haven't found it), and I'd prefer to
>> have the namespace declarations not go with the first node exported, but
>> instead, go with a set of declarations outside nodes.
>> And, I wouldn't mind a closing </node> tag (not available in an svn
>> build from a month ago, possibly changed lately?)
>
> i seriously doubt that the exported xml is not wellformed. please 
> create a
> jira issue if you can proof me wrong.
>
> cheers
> stefan
>
>>
>> Thanks.
>> Jack
>>


Re: AbstractSAXEventGenerator query

Posted by Stefan Guggisberg <st...@gmail.com>.
On 8/6/06, Jack Park <ja...@sri.com> wrote:
> What might be the objections raised to turning this abstract class into
> a public one (in future distributions) for purposes of allowing others
> to write exporters in jackrabbit applications that have different
> behaviors? That would be done by externally extending this class. (I
> realize that, as a default, one can simply duplicate the code in this
> class externally).

AbstractSAXEventGenerator is a core class. i try to avoid making internal
jackrabbit classes public in order to discourage their use from outside of the
core package. core classes should not be externally referenced as they might
change at any time and without notice.

if AbstractSAXEventGenerator is reasonably generic and without
dependencies on the core we could consider moving it to a 'util'
package. feel free to file an 'enhancement' issue.

>
> As a for instance, I would prefer to be able to just export an arbitrary
> node (perhaps there is a way, but I haven't found it), and I'd prefer to
> have the namespace declarations not go with the first node exported, but
> instead, go with a set of declarations outside nodes.
> And, I wouldn't mind a closing </node> tag (not available in an svn
> build from a month ago, possibly changed lately?)

i seriously doubt that the exported xml is not wellformed. please create a
jira issue if you can proof me wrong.

cheers
stefan

>
> Thanks.
> Jack
>

AbstractSAXEventGenerator query

Posted by Jack Park <ja...@sri.com>.
What might be the objections raised to turning this abstract class into 
a public one (in future distributions) for purposes of allowing others 
to write exporters in jackrabbit applications that have different 
behaviors? That would be done by externally extending this class. (I 
realize that, as a default, one can simply duplicate the code in this 
class externally).

As a for instance, I would prefer to be able to just export an arbitrary 
node (perhaps there is a way, but I haven't found it), and I'd prefer to 
have the namespace declarations not go with the first node exported, but 
instead, go with a set of declarations outside nodes.
And, I wouldn't mind a closing </node> tag (not available in an svn 
build from a month ago, possibly changed lately?)

Thanks.
Jack