As the Content Delivery API was only just released in the last week for CMS 12 the documentation may not have been updated. I imaging there will be some changes so you'd have expected a version 3 of this page. I'd submit feedback on the page asking
Ok, thanks.
Will it be updates in the documentation soon how to do this?
I'm trying to implement the solution from
https://github.com/vsolheim/Demo-ModelConverters-Epi-ContentApi
in CMS 12 - Content Delivery API v3
@paul Wiren: we would provide a sample in details for this. Quite busy now with new milestone and several SCs. I would start this the next week.. So sorry for any delay.
For quick info, you can create a new provider inheriting IPropertyConverterProvider, and SortOrder should be larger than 0. Then within Resolve function, just need to return IPropertyCOnverter for your special propertydata
Example
public IPropertyConverter Resolve(PropertyData propertyData)
{
if (propertyData == your_propertyData)
{
return yourPropertyConverter;
}
return null
}
We use Provider Pattern so that if your provider has higher order, it would be called to handle the request, and if it returns null, other providers (our default provider) is still activated.
Sorry if short answer :)
Hi!
Jumping in late in this thread. I have difficulties finding information/documention about how to rewrite an existing solution using the interfaces:
IContentModelMapper
IPropertyModelConverter
This is based on the musicfestival template code found here that is still referenced in the current content delivery api documentation.
Could anyone point me on the right direction?
Thanks in advance!
Implement interface IPropertyConverterProvider like
YourPropertyConvertorProvider : IPropertyConverterProvider
{
// in method
IPropertyConverter Resolve(PropertyData propertyData){
//check propertyData type - if it matches then returns YourPropertyConvertor
}
}
YourPropertyConvertor should implement IPropertyConverter which has a single method 'Convert' - then from convert return PropertyModel as you woiuld do in cms 11.
Hope that helps.
Hi
I'm trying to implement ContentModelMapper in Content Delivery API 3.0.0 in a cms 12 site.
"Working with ContentModelMapper"
https://world.optimizely.com/documentation/developer-guides/content-delivery-api/getting-started/serialization/#ContentModelMapper
I don't see any support for this yet.
Has it been replaced or is in a future release?
Missing interfaces
IContentModelMapper
IPropertyModelConverter