/**
* @see org.apache.cocoon.portal.event.aspect.EventAspect#process(org.apache.cocoon.portal.event.aspect.EventAspectContext, org.apache.cocoon.portal.PortalService)
*/
public void process(EventAspectContext context, PortalService service) {
if (this.labelManager != null) {
final EventManager publisher = service.getComponentManager().getEventManager();
final Request request = ObjectModelHelper.getRequest(context.getObjectModel());
final String parameterName = this.labelManager.getRequestParameterName();
String label = request.getParameter(parameterName);
// The pageLabel must be single valued
if (label != null) {
String previous = this.labelManager.getPreviousLabel();
if (previous != null && previous.equals(label)) {
// Already on this page. Don't publish the pageLabel events
} else {
Iterator iter = this.labelManager.getPageLabelEvents(label).iterator();
// Publish all the events for this page label.
while (iter.hasNext()) {
Event event = (Event) iter.next();
publisher.send(event);
}
// return;
}
}
}