HST Code and Configuration Updates

Update Channel Event Listeners

In channel manager event listener classes that implement the ComponentManagerAware interface, make the following changes:

  • Change the import statement from import com.google.common.eventbus.Subscribe to import org.onehippo.cms7.services.eventbus.Subscribe.

  • Remove the annotation import com.google.common.eventbus.AllowConcurrentEvent. It is no longer supported.

  • Remove the implements ComponentManagerAware and the #setComponentManager method.

  • Add import org.hippoecm.hst.pagecomposer.jaxrs.api.ChannelEventListenerRegistry;

  • Replace the existing #init and #destroy methods with this code:

   @SuppressWarnings("UnusedDeclaration")
   public void init() {
       ChannelEventListenerRegistry.get().register(this);
   }

   @SuppressWarnings("UnusedDeclaration")
   public void destroy() {
       ChannelEventListenerRegistry.get().unregister(this);
   }
  • Remove unused import statements.
When testing the upgrade, make sure to validate that the events arrive as expected.

Update ChannelInfo Help Texts

To add an explanation to Channel Settings in ChannelInfo classes, a label could be specified using the key <propertyName>.help. The suffix of this key has changed to .hint to be in line with all other field hint texts. Search in .yaml and .properties files of ChannelInfo classes for the .help suffix and replace them with .hint.

Update Custom Channel Filters

If your project has custom Channel Filters implemented, you need to update them.

Instead of implementing com.google.common.base.Predicate<Channel>, a Channel Filter now must implement java.util.function.BiPredicate<Session,Channel>.

The extra Session argument passed into the #test method is a JCR session for the currently logged-in CMS user. If, after this change, the logic of your #test method still requires access to a HstRequestContext, make sure to guard your code against null-pointer access, because background jobs can also trigger Channel Filters in circumstances where there is no HstRequestContext available. Also note that, when available, the HstRequestContext will pertain to a request to the CMS web application rather than the site web appication, as used to be the case before version 13. 

Custom channel filters should be configured in Spring beans below

site/src/main/resources/META-INF/hst-assembly/overrides

instead of below

site/src/main/resources/META-INF/hst-assembly/overrides/addon/org/hippoecm/hst/cmsrest

Lastly, it is not possible to skip the default built-in channel filtering any more. If you have a reference to the Spring id defaultChannelFilters in your Spring wiring, this won't function any more and must be removed.

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?