jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frederic BOY" <frederic....@gmail.com>
Subject importXML() fails with a ConstraintViolationException
Date Tue, 27 May 2008 14:15:47 GMT
Hi,

 

Here's my problem: 

 

I have a repository organized as follows:

root (jcr:system)

|-- Video (mc:ItemType)

|      |-- Item1 (mc:VideoItem)

|      |-- Item2 (mc:VideoItem)

|           .

|      |-- ItemN (mc:VideoItem)

|-- Audio (mc:ItemType)

|      |-- Item1 (mc:AudioItem)

|      |-- Item2 (mc:AudioItem)

|           .

|      |-- ItemN (mc:AudioItem)

|-- Template (mc:ItemType)

|      |-- .

 

   

In order to backup all my data, I call the following methods:

      session.exportSystemView("/Video", videoOut, true, false);

      session.exportSystemView("/Audio", audioOut, true, false);

            session.exportSystemView("/Template", templateOut, true, false);

 

(It works like a charm: my 3 xml files are created properly)

 

And on the other end, I try to import data by calling:

            session.importXML("/Video", videoIn,
ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);

      session.importXML("/Audio", audioIn,
ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);

      session.importXML("/Template", templateIn,
ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);

 

On import, though my node types are correctly registered, I would get the
following exception:

ConstraintViolationException: no matching child node definition found for
child node {}Video.

 

Here is my CND file:

<nt = 'http://www.jcp.org/jcr/nt/1.0'>

<mix = 'http://www.jcp.org/jcr/mix/1.0'>

<mc = 'http://www.v-4-x.com/mediacenter'>

 [mc:AbstractMediaItem] > nt:base, mix:referenceable

 - mc:Title (string) primary

 - mc:Category (string)

 - mc:Tags (string) multiple

 - mc:Description (string)

 - mc:Comment (string)

 - mc:Source (string)

 - mc:Author (string)

 [mc:VideoItem] > mc:AbstractMediaItem

 + mc:WaveForm (mc:Resource)

 + mc:Thumbnail (mc:VideoThumbnail) multiple

 [mc:AudioItem] > mc:AbstractMediaItem

 + mc:WaveForm (mc:Resource)

 [mc:TemplateItem] > mc:AbstractMediaItem

 [mc:ItemType]

 + * (mc:AbstractMediaItem)

 

 

I must have missed something .

Could someone please help me? I'm kinda stuck here

 

Thanks in advance !

 

Frederic Boy


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message