2013-04-29 5 views
1

QueryManager와 다소 비슷한 방식으로 Component # doBeforeRender 호출 내에서 ChannelManager ref를 가져 오는 방법을 찾고 있습니다.Component 내에서 ChannelManager를 가져 오는 방법

서비스 인터페이스를 요청할 수있는 관리자 레지스트리가 있습니까?

최저

, 에도아르도는

답변

2

은 ChannelManager에 가서 그것의 용도를 찾을 수 있습니다.

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

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

} 위의 코드

+0

가에서 찾을 수 있습니다 : org.onehippo.cms7.channelmanager.channels.ChannelUtil 일 –

+0

감사합니다, 그것은 당신에게 충분한 hits..like을 줄 것이다. 그러나 CM의 사용법을 검색해도 아무런 안타깝게 생각하지 않습니다 ... – Eddy

+0

"Project"에서 "Project and libraries"로 검색 범위를 변경합니다 .. Intellij IDE –

관련 문제