Headless Server Developer Manual / Version 2404
Table Of ContentsNew handlers can be added or existing handlers can be replaced. To do this, extend the class
AbstractOutputHandler
and develop a customized handler according to your individual
needs. Then register the new handler by adding a TypeDescription with the new handler as a regular Spring
Bean to CaasConfig.java
with the Qualifier 'caasRichtextTypeDescriptions'.
After this, the new handler can be used under its tag name in a transformation definition, like
default.yml
.
public class MyOutputHandler extends AbstractOutputHandler { ... } @Bean public TypeDescription customTypeDescription() { return new TypeDescription(MyOutputHandler.class, new Tag("!MyOutputHandler")); }
Replacing an existing handler is done the same way but in this case using the existing tag name, e.g. LinkWriter. If an existing handler is replaced, the revised handler should implement the same properties, e.g. attributeTransformers. Not doing so will most likely raise an exception at startup because, the transformation yaml tries to set properties, that do not exist anymore.
public class CustomLinkWriter extends AbstractOutputHandler { ... } @Bean @Qualifier(QUALIFIER_CAAS_RICHTEXT_TYPE_DESCRIPTIONS) public TypeDescription customLinkWriterTypeDescription() { return new TypeDescription(CustomLinkWriter.class, new Tag("!Linkwriter")); }