* Determine target channel and pass corresponding
* actions/params to that channel
* @param request the <code>HttpServletRequest</code>
*/
private void processRequestChannelParameters(HttpServletRequest request, HttpServletResponse response) {
final IChannelRequestParameterManager channelParameterManager = ChannelRequestParameterManagerLocator.getChannelRequestParameterManager();
final Set<String> targetedChannelIds = channelParameterManager.getTargetedChannelIds(request);
if (targetedChannelIds.size() > 0) {
this.channelTarget = targetedChannelIds.iterator().next();
}
else {
this.channelTarget = null;
}
if (channelTarget != null) {
// Obtain the channel description
IUserLayoutChannelDescription channelDesc = null;
IUserLayoutNodeDescription parentNode = null;
try {
final IUserLayoutManager userLayoutManager = userPreferencesManager.getUserLayoutManager();
channelDesc = (IUserLayoutChannelDescription) userLayoutManager.getNode(channelTarget);
final String parentNodeId = userLayoutManager.getParentId(channelDesc.getId());
if (parentNodeId != null) {
parentNode = userLayoutManager.getNode(parentNodeId);
}
}
catch (PortalException pe) {
log.warn("Failed to load IUserLayoutChannelDescription and parent IUserLayoutNodeDescription for channel with subscribe id: " + channelTarget, pe);
}
final IPerson person = userPreferencesManager.getPerson();
// Tell StatsRecorder that a user has interacted with the channel
if (channelDesc != null) {
final ApplicationEventPublisher applicationEventPublisher = EventPublisherLocator.getApplicationEventPublisher();
final UserProfile currentProfile = userPreferencesManager.getCurrentProfile();
applicationEventPublisher.publishEvent(new ChannelTargetedInLayoutPortalEvent(this, person, currentProfile, channelDesc, parentNode));
}
final Map<String, Object[]> channelParameters = channelParameterManager.getChannelParameters(request, channelTarget);
if (channelParameters != null) {
targetParams = new HashMap<String, Object>(channelParameters);
}
else {
targetParams = null;