kontent-ai / java-packages

Delivery Java SDK for Kontent.ai including examples for Spring, Gradle, Kotlin and Java Android app
https://kontent.ai/learn/tutorials/develop-apps/overview/?tech=java
MIT License
14 stars 28 forks source link

Default fallback inline resolver #110

Closed Simply007 closed 3 years ago

Simply007 commented 3 years ago

Motivation

Currently, if you want to have an inline resolver for rich text elements, it is required to register it for all content models. It would be great to have some approach to reduce this necessity.

Proposed solution

Allow defining a default inline rich text resolver as a fallback when no other resolver is used.

Additional context

Proposal #108

Simply007 commented 3 years ago

I might find another solution for this. It is possible to extend the TemplateConfig if not previous resolvers find an appropriate resolution.

I have created a showcase for that in the Springboot application: https://github.com/Kentico/kontent-java-packages/blob/default-inline-richtext-resolver/sample-app-spring-boot/src/main/java/kentico/kontent/delivery/sample/dancinggoat/springboot/KontentConfiguration.java#L60

Simply007 commented 3 years ago

Default resolver for template engine covered in https://github.com/Kentico/kontent-java-packages/wiki/Rich-text-resolution#completely-custom-template-configuration-ie-default-fallback-rich-text-element-resolver