Thanks again for your quick reply.
Concerning the problem 2 (move), here is an example :
jcrSession.move(
fichierNode.path,
fichierNode.parent.path + '/' + 'newName')
fichierNode.setProperty( JcrConstants.ELIOT_DATE_MODIFICATION,
Calendar.getInstance() )
jcrSession.save() => throws javax.jcr.PathNotFoundException: <old path>
The problem is solved when I update the property before the move.
For the problem 1, I give you a short description followed by my concrete
code.
I have 2 mixin types, let's say A and B, with B that inherits A.
When I add the type A, and then the type B I get an exception
javax.jcr.nodetype.ConstraintViolationException:
no matching property definition found for ...
It works when I save the session after adding the type A.
Here is the relevant part of my CND file:
<eliot = 'http://www.fylab.com/eliot'> [eliot:item] mixin -
eliot:proprietaire_id (string) mandatory - eliot:auteurs_ids (string)
mandatory multiple - eliot:item_description (string) -
eliot:date_modification (date) mandatory [eliot:item_partage] > eliot:item
mixin - eliot:consultation_autorites_ids (string) mandatory multiple -
eliot:modification_autorites_ids (string) mandatory multiple
And my code :
// Création du noeud racine de l'espace de partage de l'organisation
Node partageNode =
organisationNode.addNode(
JcrSystemNodeDefinitions.getInfoEspacePartage(organisationId).nom,
JcrConstants.NT_FOLDER
)
partageNode.addMixin(JcrConstants.ELIOT_RACINE_ESPACE_PARTAGE)
partageNode.addMixin(JcrConstants.MIX_REFERENCEABLE)
partageNode.addMixin(JcrConstants.ELIOT_ITEM)
// Propriétaire
partageNode.setProperty(
JcrConstants.ELIOT_PROPRIETAIRE_ID,
JcrConstants.ELIOT_ADMIN_ID
)
// Auteurs
partageNode.setProperty(
JcrConstants.ELIOT_AUTEURS_IDS,
(String[])[].toArray()
)
// Description
partageNode.setProperty(
JcrConstants.ELIOT_ITEM_DESCRIPTION,
JcrSystemNodeDefinitions.getInfoEspacePartage(
organisationId).description
)
// Date modification
partageNode.setProperty(
JcrConstants.ELIOT_DATE_MODIFICATION,
Calendar.getInstance()
)
*jcrSession.save() => Without that save it works with the Repository
from core, but not with a webdav connection*
// Initialise les attributs de partage
partageNode.addMixin(JcrConstants.ELIOT_ITEM_PARTAGE)
partageNode.setProperty(
JcrConstants.ELIOT_CONSULTATION_AUTORITES_IDS,
(String[]) [] // Liste vide //Todo: Tout le monde doit pouvoir
consulter
)
partageNode.setProperty(
JcrConstants.ELIOT_MODIFICATION_AUTORITES_IDS,
(String[]) [] // Liste vide //Todo: Initialiser avec les
groupes qui ont le droit d'écriture par défaut
)
jcrSession.save()
The concrete exception I get without the intermediary save is:
javax.jcr.nodetype.ConstraintViolationException: no matching property
definition found for {http://www.fylab.com/eliot}proprietaire_id
<http://www.google.com/url?sa=D&q=http%3A%2F%2Fwww.fylab.com%2Feliot%7Dproprietaire_id>
John
2010/4/29 Angela Schreiber <[email protected]>
> hi john
>
>
> Unfortunately, many of my integration tests are not passing anymore.
>> After some investigations, I could figure out these 2 issues :
>> 1) DavEx requires the session to be saved more frequently to avoid
>> exception
>> on type constraints (in particular, I have a mixin type that inherits from
>> another - When I need to add both types to a node, a session.save() in
>> between is necessary).
>>
>
> can you provide a test that illustrates the problem.
> from the description above i can't tell if this is bug or not.
>
>
> 2) session.move doesn't seem to be handled properly : after a move, any
>> operation on the moved node within the current session leads to a
>> PathNotFoundException (with the old path).
>>
>
> there were a couple of issues fixed for version 2.1, including
> some move problems... again... having a simple test illustrating
> the error would be useful to find out if this is a known/fixed
> problem or not.
>
>
> I wonder if those are known issues? And if there is a solution? Maybe it
>> is
>> different in version 2.0.0 (I'm using 1.6.0).
>>
>
> see above.
>
>
> I saw on jira the issue JCR-2540 that says : "all TCK tests including move
>> or reorder fail in the setup jcr2spi - spi2dav(ex) - jcr-server."
>> It could be my problem.
>>
>
> no. JCR-2540 is about observation only.
>
> regards
> angela
>