jackalope/jackalope — Issue #69: Backend error on adding new mixin type to node already having a mixin type
Author: dbu
Created: 2011-12-28 12:49:45+00:00
State: open

Adding a new mixin type to a node that already has another mixin type fails. This is either a special case of mixin or maybe even a general issue with multivalue properties.

see 10_Writing/NodeTypeAssignmentTest::testAddMixinTwice

on the update, jackalope transport sends this:

PROPPATCH /server/tests/jcr:root/tests_write_nodetype/testAddMixinTwice HTTP/1.1
Authorization: Basic YWRtaW46YWRtaW4=
Host: localhost:8080
Accept: */*
Depth: 0
Content-Type: text/xml; charset=utf-8
User-Agent: jackalope-php/1.0
TransactionId:
Content-Length: 370

mix:referenceablemix:mimeType

while jackrabbit uses the diff format:

POST /server/tests/jcr%3aroot/ HTTP/1.1
Authorization: Basic YWRtaW46YWRtaW4=
User-Agent: Jakarta Commons-HttpClient/3.0
Host: localhost:8080
Content-Length: 717
Content-Type: multipart/form-data; boundary=m4KJBTKajpqZ-F6H2rWTQLaUSNL9qY2jm

--m4KJBTKajpqZ-F6H2rWTQLaUSNL9qY2jm
Content-Disposition: form-data; name="/tests_write_nodetype/testAddMixinTwice/jcr:mixinTypes"
Content-Type: jcr-value/name; charset=UTF-8
Content-Transfer-Encoding: 8bit

mix:referenceable
--m4KJBTKajpqZ-F6H2rWTQLaUSNL9qY2jm
Content-Disposition: form-data; name="/tests_write_nodetype/testAddMixinTwice/jcr:mixinTypes"
Content-Type: jcr-value/name; charset=UTF-8
Content-Transfer-Encoding: 8bit

mix:mimeType
--m4KJBTKajpqZ-F6H2rWTQLaUSNL9qY2jm
Content-Disposition: form-data; name=":diff"
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

^/tests_write_nodetype/testAddMixinTwice/jcr:mixinTypes : []
--m4KJBTKajpqZ-F6H2rWTQLaUSNL9qY2jm--

we have to figure out whether there is some way to specify the change in the xml format correctly, or we have to implement the diff stuff.

1. test if this is mixin specific or relevant for all multivalue properties
2. see if the xml format can update multivalue or if we need to do the diff
3. implement solution