I'm programatically creating a new schema using the core service, and I'd like to be able to create a component link field that is marked as editable.
Currently I'm performing the following (note this is via Java):
final ComponentLinkFieldDefinitionData fieldData = factory.createComponentLinkFieldDefinitionData();
fieldData.setName(this.fieldName);
fieldData.setDescription(this.fieldDescription);
fieldData.setMinOccurs(0);
final ItemFieldDefinitionData.ExtensionXml extension = factory.createItemFieldDefinitionDataExtensionXml();
//extension.setAny(element);
fieldData.setExtensionXml(factory.createItemFieldDefinitionDataExtensionXml(extension));
The question is - are there any core service methods that allow me to set the element part - or do I need to hand-craft the XML? Looking at a schema created in the CME, I see the resultant XML needs to look like this:
<ExtensionXml xmlns="http://www.tridion.com/ContentManager/5.0">
<configuration xmlns="http://www.sdltridion.com/2011/SiteEdit">
<field>
<editable>true</editable>
</field>
</configuration>
</ExtensionXml>
So it's the configuration element I'm after.
And if I don't set this ExtensionXml
, will the field default to being uneditable?
Many thanks,
Ben