Extensibility | Extending ItemType

So you`ve got a data extender now!

Let`s find out how to get an access to the new property which you`ve just added.

One of the possible options is to extend an associated item type. In our case, the new property is in Folder Item, thus we should extend the Folder Item type.

To extend an ItemType you need to create a model extension, and add an item-type extensibility rule into modelextensions section:

You should specify the id which is the itemType identifier (you can find all definitions in the associated model configuration file) and specify the implementation which is an actual implementation of your extension.

Implement your extension functionality.

Note the invalidateReadOnlyProperties method. This method is called when an Item gets invalidated, for instance when its content is reloaded, we have to invalidate the item state. So all properties will be recollected from the new item data. There are a few more methods you should be aware of:
invalidateLocalState itself, which completelly updates the item state, including its content data and both editable and readonly properties.
invalidateReadOnlyProperties invalidates only readonly properties
invalidateEditableProperties invalidates only editable properties

..almost done

We still should extend a group where original itemType implementation is located, so our resource will be loaded together with initial itemType implementation.

Create your group where you put a reference to the file with your extension implementation. Define groups extensions rule. And register resource extension.

Finally check if it`s working and have a nice day!