use of org.apereo.portal.character.stream.events.PortletContentPlaceholderEvent in project uPortal by Jasig.
the class PortletRenderingInitiationCharacterComponent method getEventReader.
/* (non-Javadoc)
* @see org.apereo.portal.rendering.PipelineComponent#getEventReader(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
@Override
public PipelineEventReader<CharacterEventReader, CharacterEvent> getEventReader(HttpServletRequest request, HttpServletResponse response) {
final PipelineEventReader<CharacterEventReader, CharacterEvent> pipelineEventReader = this.wrappedComponent.getEventReader(request, response);
final CharacterEventReader eventReader = pipelineEventReader.getEventReader();
final List<CharacterEvent> eventBuffer = new LinkedList<CharacterEvent>();
while (eventReader.hasNext()) {
final CharacterEvent event = eventReader.next();
switch(event.getEventType()) {
case PORTLET_HEADER:
{
final PortletHeaderPlaceholderEvent headerEvent = (PortletHeaderPlaceholderEvent) event;
final IPortletWindowId portletWindowId = headerEvent.getPortletWindowId();
if (!this.portletExecutionManager.isPortletRenderHeaderRequested(portletWindowId, request, response)) {
this.portletExecutionManager.startPortletHeaderRender(portletWindowId, request, response);
}
break;
}
case PORTLET_CONTENT:
{
final PortletContentPlaceholderEvent headerEvent = (PortletContentPlaceholderEvent) event;
final IPortletWindowId portletWindowId = headerEvent.getPortletWindowId();
if (!this.portletExecutionManager.isPortletRenderRequested(portletWindowId, request, response)) {
this.portletExecutionManager.startPortletRender(portletWindowId, request, response);
}
break;
}
}
eventBuffer.add(event);
}
final Map<String, String> outputProperties = pipelineEventReader.getOutputProperties();
final CharacterEventBufferReader bufferEventReader = new CharacterEventBufferReader(eventBuffer.listIterator());
return new PipelineEventReaderImpl<CharacterEventReader, CharacterEvent>(bufferEventReader, outputProperties);
}
Aggregations