Documentation Center

Synchronizing a content item and its Schema using TOM.NET

If a content item and its Schema are not in sync, you can use the TOM.NET API to synchronize them. A typical use case for this would be a change to an existing Component Schema which has many Components based on it: first query the Schema to get a list of Components that use it, then synchronize the list in one go.

Procedure

  1. Combine the following synchronization flags, available in the API, to tweak the sychronization behavior:
    FlagDescription
    FixNamespaceIf the namespace of the content item's root element is not the same as the Schema's, it is set to the Schema's.
    RemoveUnknownFieldsAny fields in the content item that are not in the Schema are removed from the content item.
    RemoveAdditionalValuesAny value beyond the first value in a field that the Schema defines as single-value are removed from the content item.
    ApplyDefaultValuesForMissingMandatoryFieldsIf the Schema contains a mandatory field (with a default value) but the content item does not, the field is added to the content item, set to its default value.
    ApplyDefaultValuesForMissingNonMandatoryFieldsIf the Schema contains a non-mandatory field (with a default value) but the content item does not, the field is added to the content item, set to its default value.
    ApplyFilterXsltToXhtmlFieldsIf the Schema contains a Format Area field with an associated XSLT stylesheet to be applied to it, but the content item's version of the field has not had the stylesheet applied it, the stylesheet will be applied to the content item's field.
    ConvertFieldTypeIf the Schema field has a different data type than its corresponding content item field, the data in the content item field will be converted to the new type.
    AllDo all of the above
  2. Use these flags when you call the API method SynchronizeWithSchema.

    For more information on the method and the flags, refer to the TOM.NET API reference documentation.