I answered my own question with a little more digging in the Sling docs.  I'm 
new to Sling so I'm still finding my way about.


According to the Sling documentation here:


https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html#typehint


I have to add the following additional form field to the POST operation:


publisher@typeHint=Reference


Doing so resulted in the node being committed without error, and the 
reference-valued property way populated correctly.


jgl

________________________________
From: John Logan <john.lo...@texture.com>
Sent: Wednesday, September 21, 2016 10:40:14 AM
To: users@sling.apache.org
Subject: Setting the UUID for a reference property via SlingPostServlet?

Hi,


I'm trying to create a node that has a reference as part of its data type via 
the SlingPostServlet, and am seeing the following error when Sling tries to 
commit the change:


Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: 
OakConstraint0055: /build/john-dc-07/title/gag[[nimcb:Title]]: Required 
property type violation in publisher = 4902ecef-4415-4918-98c4-38e44ef680e6


The UUID is the jcr:uuid of an existing node.  Is it possible to supply 
reference-valued properties via the SlingPostServlet, and if so, how does one 
do that?


Thanks!  John

Reply via email to