Hello,
I have been using extensively the latest Magnolia REST Module for migrating
data from older Magnolia installation and older schema into a new one, also
activating content via data scripts. It has been working great however lately I
am facing the issue of being unable to create a new content node that has a
list of subnodes with an http request.
The content I am unable to create has the following schema:
[code]
{
"name": "slideshow-rest-3",
"type": "mgnl:slideshow",
"path": "/slideshow-rest-3",
"properties": [
{
"name": "authors",
"type": "String",
"multiple": true,
"values": [
"My author"
]
},
{
"name": "description",
"type": "String",
"multiple": false,
"values": [
"Slideshow Description"
]
},
{
"name": "title",
"type": "String",
"multiple": false,
"values": [
"Slideshow Title "
]
}
],
"nodes": [
{
"name": "slides",
"path": "/slideshow-rest-3/slides",
"properties": [],
"nodes": [
{
"name": "00",
"type": "mgnl:contentNode",
"path": "/slideshow-rest-3/slides/00",
"identifier": "7f961b38-2ba3-47dc-b401-8db6955f0501",
"properties": [
{
"name": "showAd",
"type": "Boolean",
"multiple": false,
"values": [
"true"
]
},
{
"name": "slideTitle",
"type": "String",
"multiple": false,
"values": [
"Slide Title 1"
]
}
]
},
{
"name": "01",
"path": "/slideshow-rest-3/slides/01",
"properties": [
{
"name": "slideTitle",
"type": "String",
"multiple": false,
"values": [
"Slide Title 2"
]
},
{
"name": "slideDescription",
"type": "String",
"multiple": false,
"values": [
"Slide DEscr 2"
]
},
{
"name": "description",
"type": "String",
"multiple": false,
"values": [
"Slide 2 Description"
]
},
{
"name": "title",
"type": "String",
"multiple": false,
"values": [
"Slide 2"
]
}
]
}
]
}
]
}
[/code]
As you can see I am building an array of nodes for each slide. This structure
get's build in Magnolia when I use the UI form using the following YAML
[code]
- name: slides
class:
info.magnolia.ui.form.field.definition.MultiValueFieldDefinition
label: Slides
transformerClass:
info.magnolia.ui.form.field.transformer.multi.MultiValueSubChildrenNodePropertiesTransformer
field:
name: compositeField
layout: vertical
class:
info.magnolia.ui.form.field.definition.CompositeFieldDefinition
transformerClass:
info.magnolia.ui.form.field.transformer.composite.NoOpCompositeTransformer
fields:
- name: slideTitle
class:
info.magnolia.ui.form.field.definition.TextFieldDefinition
label: Title
- name: slideDescription
class:
info.magnolia.ui.form.field.definition.TextFieldDefinition
label: Description
rows: 4
- name: showAd
class:
info.magnolia.ui.form.field.definition.CheckboxFieldDefinition
label: Show Add
buttonLabel: ""
- name: image
class:
info.magnolia.ui.form.field.definition.LinkFieldDefinition
label: Image
targetWorkspace: dam
appName: assets
identifierToPathConverter:
class:
info.magnolia.dam.app.assets.field.translator.AssetCompositeIdKeyTranslator
contentPreviewDefinition:
contentPreviewClass:
info.magnolia.dam.app.ui.field.DamFilePreviewComponent
[/code]
The error I am getting back trying to submit the json above does not have a
meaningful message but just "400 Bad request".
Is this a limitation of the REST module. If not how am I supposed to persist a
2 level deep data structure via the api?
Thanks
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=5d6a3d39-0c4f-49f5-b45f-7633de9aa2e3
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------