You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Frédéric Esnault <fe...@legisway.com> on 2007/06/08 15:46:37 UTC

JCR-325 - multivalued properties in doc view export

Hi,

 

I'm not quite sure about what to understand from the Jira item about this.

Is there a plan about exporting the multivalued properties in document view export?

 

It seems very strange to just ignore the multivalued properties. It gives completely wrong documents.

Exemple : 

My contracts reference contractors, and may have several internal and external contractors.

All of them are stored as multiple values of two multivalued properties :

- internalCotnractors

- externalContractors

 

It is unacceptable (in such a context) that the contractors referenced are lost ;)

 

Any news about this?

 

Frédéric Esnault


RE: JCR-325 - multivalued properties in doc view export

Posted by Frédéric Esnault <fe...@legisway.com>.
And one point about roundtripping...

I think exported document view docs should either :
- contain type information AND definition;
- do not contain the node type definition, only the node type information (ie. this node is of type ns:myType).

In first case, the nodes can be imported in a repository like this :
- existing node type definitions are simply ignored if identical, and raises a ConflictException if the XML one differs from the repository one;
- not existing node types are created (provided namespaces exist - same mechanism)

In second case, try to import nodes in the repository, checking them against the existing node types. If one node type is not in the repository, simply raise an exception and stop the import.

But anyway I cannot see why you want to add some repository as extra properties. This is the kind of silent behaviour problem-generating. See the roundtrippind example.

Better a choice between 2 or 3 strcit options, raising errors if not respected, without silent behaviours. 

What's your feeling?

Frédéric Esnault - Ingénieur R&D

-----Message d'origine-----
De : Jukka Zitting [mailto:jukka.zitting@gmail.com] 
Envoyé : vendredi 8 juin 2007 16:15
À : users@jackrabbit.apache.org
Objet : Re: JCR-325 - multivalued properties in doc view export

Hi,

On 6/8/07, Frédéric Esnault <fe...@legisway.com> wrote:
> Well first I think an error is better than a JCR exporting silently an erroneous
> document, but this is my opinion.

The JCR spec actually gives some leeway to implementations on what to
include in docview exports, so AFAIUI we're not actually producing
erroneous documents. But you're right in that the current solution is
suboptimal. Perhaps we should restore the feature to export
multivalued properties and throw an exception if someone attempts to
import such a document.

> Then it puts me into trouble because the system view correctly exports the
> multivalued properties, but on import it gives me the error :
>
> {http://www.jcp.org/jcr/mix/1.0}referenceable: already contained in primary node type
>
> No idea why it's complaining about this?

Hmm, I'll need to check the code. If it's coming from the import code
then we may need to change that.

BR,

Jukka Zitting

RE: JCR-325 - multivalued properties in doc view export

Posted by Frédéric Esnault <fe...@legisway.com>.
May be I'm doing something wrong, but I tried two ways of exporting/importing system views :

1. I created a "business root" called lgw:root, which is holding all my business content. First method was to leave the node type informations in the repository and export the lgw:root node (business export); like this I can use a fresh repository with just type informations and import my lgw:root. But this doesn't work because of the previous error :

{http://www.jcp.org/jcr/mix/1.0}referenceable: already contained in primary node

 What surprises me is I import a node (not the repository root), and the export includes the full node type description (primary type, mixin types....). I was guessing it was too much during import because the lgw:root node type was already in the repository node types...;


2. I exported everything (repository root), and import in a brand new fresh repository, nothing at all in it. And it fails with another error :

/jcr:root/jcr:system/jcr:nodeTypes: cannot add a child to a protected node 


Basically, I understand the protected node complaint, but for an export, it should be managed by the repository core, meaning it should be allowed in this situation.

Not sure if there is a way to import/export currently working.

Frédéric Esnault - Ingénieur R&D

-----Message d'origine-----
De : Jukka Zitting [mailto:jukka.zitting@gmail.com] 
Envoyé : vendredi 8 juin 2007 16:15
À : users@jackrabbit.apache.org
Objet : Re: JCR-325 - multivalued properties in doc view export

Hi,

On 6/8/07, Frédéric Esnault <fe...@legisway.com> wrote:
> Well first I think an error is better than a JCR exporting silently an erroneous
> document, but this is my opinion.

The JCR spec actually gives some leeway to implementations on what to
include in docview exports, so AFAIUI we're not actually producing
erroneous documents. But you're right in that the current solution is
suboptimal. Perhaps we should restore the feature to export
multivalued properties and throw an exception if someone attempts to
import such a document.

> Then it puts me into trouble because the system view correctly exports the
> multivalued properties, but on import it gives me the error :
>
> {http://www.jcp.org/jcr/mix/1.0}referenceable: already contained in primary node type
>
> No idea why it's complaining about this?

Hmm, I'll need to check the code. If it's coming from the import code
then we may need to change that.

BR,

Jukka Zitting

Re: JCR-325 - multivalued properties in doc view export

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

On 6/8/07, Frédéric Esnault <fe...@legisway.com> wrote:
> Well first I think an error is better than a JCR exporting silently an erroneous
> document, but this is my opinion.

The JCR spec actually gives some leeway to implementations on what to
include in docview exports, so AFAIUI we're not actually producing
erroneous documents. But you're right in that the current solution is
suboptimal. Perhaps we should restore the feature to export
multivalued properties and throw an exception if someone attempts to
import such a document.

> Then it puts me into trouble because the system view correctly exports the
> multivalued properties, but on import it gives me the error :
>
> {http://www.jcp.org/jcr/mix/1.0}referenceable: already contained in primary node type
>
> No idea why it's complaining about this?

Hmm, I'll need to check the code. If it's coming from the import code
then we may need to change that.

BR,

Jukka Zitting

RE: JCR-325 - multivalued properties in doc view export

Posted by Frédéric Esnault <fe...@legisway.com>.
Well first I think an error is better than a JCR exporting silently an erroneous document, but this is my opinion.

Then it puts me into trouble because the system view correctly exports the multivalued properties, but on import it gives me the error : 

{http://www.jcp.org/jcr/mix/1.0}referenceable: already contained in primary node type

No idea why it's complaining about this?

Frédéric Esnault - Ingénieur R&D


-----Message d'origine-----
De : Jukka Zitting [mailto:jukka.zitting@gmail.com] 
Envoyé : vendredi 8 juin 2007 15:59
À : users@jackrabbit.apache.org
Objet : Re: JCR-325 - multivalued properties in doc view export

Hi,

On 6/8/07, Frédéric Esnault <fe...@legisway.com> wrote:
> I'm not quite sure about what to understand from the Jira item about this.
> Is there a plan about exporting the multivalued properties in document
> view export?

I've been working for ages to make multivalue import work correctly at
least for most values in docview import, but so far I've had little
progress.

> It seems very strange to just ignore the multivalued properties. It gives
> completely wrong documents.

I see your point. Earlier on we disabled the multivalue export in
docview because people were getting confused when their exports would
not roundtrip properly.

BR,

Jukka Zitting

Re: JCR-325 - multivalued properties in doc view export

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

On 6/8/07, Frédéric Esnault <fe...@legisway.com> wrote:
> I'm not quite sure about what to understand from the Jira item about this.
> Is there a plan about exporting the multivalued properties in document
> view export?

I've been working for ages to make multivalue import work correctly at
least for most values in docview import, but so far I've had little
progress.

> It seems very strange to just ignore the multivalued properties. It gives
> completely wrong documents.

I see your point. Earlier on we disabled the multivalue export in
docview because people were getting confused when their exports would
not roundtrip properly.

BR,

Jukka Zitting