Platform Explorer / server 10.10

Extension point deprecation

Extension Point to register deprecated/removed properties. XML extensions may contain any number of 'property' elements of the form:

    <property deprecated="true" name="size" schema="common"/>
    <property fallback="content/name" name="filename" schema="file"/>

A property contributed to this extension point enables deprecation mechanisms inside Nuxeo Platform. This generates WARN message of usage to help to remove deprecated usage.

A contribution is one of these types:

  • deprecated: property still exists in schema definition, but it'll be removed in next version
  • removed: property has been removed from schema definition, relax platform behavior. This will avoid Nuxeo property not found exceptions for remaining use of the property

The fallback attribute is optional, its value has to be a xpath referencing an existing property in the same schema than removed/deprecated property. When presents, it is used:

  • to set the value to the fallback property
  • to get the value from the fallback property if it exists

Note: for a deprecated property, setValue also set value to property and getValue get value from property if fallback value is null.

For example, the contribution below enables WARN message of usage of property file:filename . This will also get/set the value from/to file:content/name for deprecated usage of file:filename property.

    <property fallback="content/name" name="filename" schema="file"/>

As it, each usage of this property will automatically fallback on the fallback and avoid exception from platform. This will also allows to import document declaring the removed property.

Contribution Descriptor

Existing Contributions

  • nuxeo-core-10.10.jar /OSGI-INF/CoreExtensions.xml
    <extension point="deprecation" target="org.nuxeo.ecm.core.schema.TypeService">
        <documentation>The deprecated core properties</documentation>
        <!-- Removed since 9.1 -->
        <property name="size" schema="common"/>
        <property fallback="content/name" name="filename" schema="file"/>
        <property fallback="files/*/file/name" name="files/*/filename" schema="files"/>