I'm looking for a way to fetch a ChannelManager ref from within a Component#doBeforeRender call, in a somewhat similar way to the QueryManager.

Is there a *Manager registry I can ask for service interfaces?

Best, Edoardo

有帮助吗?

解决方案

go to ChannelManager and find usages of it. It will give you enough hits..like:

public static ChannelManager getChannelManager() {
    ComponentManager componentManager = HstServices.getComponentManager();
    if (componentManager == null) {
        return null;
    }

    return HstServices.getComponentManager().getComponent(ChannelManager.class.getName());

}

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top