4PointSolutions / FluentFormsAPI

Fluent API for Adobe AEM Forms
Apache License 2.0
6 stars 8 forks source link

Allow setting of appPrefix in Spring Boot Starter Adaptive Form Rendering code. #40

Open rmcdouga opened 1 year ago

rmcdouga commented 1 year ago

The Adaptive Form Service rendering code in FluentFormsAutoConfiguration.java always uses StandardFormsFeederUrlFilters.getStandardInputStreamFilter(). Instead, this should be configurable.

It should be configurable in a couple of different ways. The client should be able replace this filter with a custom filter and there there should be an application.properties entry that can provide an appPrefix to the standardStreamFilter.

I would propose that I update the autoconfiguration class to look for a bean named afInputStreamFilter that implements Function<InputStream, InputStream>. If not provided, then it would default to StandardFormsFeederUrlFilters.getStandardInputStreamFilter().

This would allow you to provide a bean that would override the default using something like:

      @Bean
      public Function<InputStream, InputStream> afInputStreamFilter() {
            return StandardFormsFeederUrlFilters.getStandardInputStreamFilter("/myClientApp");
      }

Also, if no afInputStreamFilter is supplied but a configuration property called fluentforms.af.appPrefix is supplied, then we should set the appPrefix on the standardInputStreamFilter using the value of that property