7

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

6

The value that you saw in ExtensionXml is only there temporarily; it is used by a Data Extender to save the information in Application Data. So setting it when using the Core Service won't do you any good, as the Data Extender won't be run.

However, inline editing for fields is enabled by default. You don't actually have to do anything, so don't worry about it :)

4

Tridion does not have the option for 1 field to be editable and the next not editable. I am not sure why this attribute is there - but no worries, content created with this schema (and the schema itself) will always be editable, unless it is in a Blueprint child item where all fields are read only (unless localized).

  • 3
    It's a setting for Experience Manager – Nuno Linhares Mar 27 '13 at 22:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.