public void process(EventAspectContext context, PortalService service) {
final String requestParameterName = FullScreenCopletEvent.REQUEST_PARAMETER_NAME;
final Request request = ObjectModelHelper.getRequest( context.getObjectModel() );
String[] values = request.getParameterValues( requestParameterName );
if ( values != null ) {
final Publisher publisher = context.getEventPublisher();
for(int i=0; i<values.length; i++) {
final String current = values[i];
Event e = context.getEventConverter().decode(current);
if ( null != e ) {
publisher.publish(e);
FullScreenCopletEvent fsce = (FullScreenCopletEvent)e;
if ( fsce.getLayout() != null) {
service.getComponentManager().getLinkService().addEventToLink( e );
}
}
}
} else {
List list = (List) request.getAttribute("org.apache.cocoon.portal." + requestParameterName);
if (list != null)
{
FullScreenCopletEvent[] events =
(FullScreenCopletEvent[]) list.toArray(new FullScreenCopletEvent[0]);
final Publisher publisher = context.getEventPublisher();
for (int i = 0; i < events.length; i++)
{
FullScreenCopletEvent e = events[i];
publisher.publish(e);
if (e.getLayout() != null)
{
service.getComponentManager().getLinkService().addEventToLink(e);
}
}