throw new IllegalStateException("ChannelFactory returned null on request to instantiate layout channel with id [" + sessionId + "] and description [" + channelDescription + "]");
}
final IPerson person = userPreferencesManager.getPerson();
final ApplicationEventPublisher applicationEventPublisher = EventPublisherLocator.getApplicationEventPublisher();
final UserProfile currentProfile = userPreferencesManager.getCurrentProfile();
IUserLayoutNodeDescription parentNode = null;
try {
final IUserLayoutManager userLayoutManager = userPreferencesManager.getUserLayoutManager();
final String parentNodeId = userLayoutManager.getParentId(channelDescription.getId());
if (parentNodeId != null) {
parentNode = userLayoutManager.getNode(parentNodeId);
}
}
catch (PortalException pe) {
log.warn("Failed to load parent IUserLayoutNodeDescription for channel with subscribe id: " + channelDescription.getChannelPublishId(), pe);
}
applicationEventPublisher.publishEvent(new ChannelInstanciatedInLayoutPortalEvent(this, person, currentProfile, channelDescription, parentNode));
// Create and stuff the channel static data
final ChannelStaticData channelStaticData = new ChannelStaticData(channelDescription.getParameterMap(), userPreferencesManager.getUserLayoutManager());
channelStaticData.setChannelSubscribeId(channelSubscribeId);
channelStaticData.setTimeout(channelDescription.getTimeout());