Package org.apache.cocoon.portal.event

Examples of org.apache.cocoon.portal.event.Publisher


  /* (non-Javadoc)
   * @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 Publisher publisher = context.getEventPublisher();
            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.publish(event);
                    }
            //        return;
                }
            }
        }
View Full Code Here


            // ignore exception
        } finally {
            this.manager.release(service);
        }
        if ( instances != null ) {
            Publisher publisher = null;
            EventManager eventManager = null;
            try {
                eventManager = (EventManager) this.manager.lookup(EventManager.ROLE);
                publisher = eventManager.getPublisher();
            } catch (Exception ignore) {
                // ignore exception
            } finally {
                this.manager.release(eventManager);
            }

            if ( publisher != null ) {
                if ( e instanceof ChangeCopletsJXPathEvent ) {
                    final String path = ((ChangeCopletsJXPathEvent)e).getPath();
                    final Object value = ((ChangeCopletsJXPathEvent)e).getValue();
                   
                    Iterator i = instances.iterator();
                    while ( i.hasNext() ) {
                        CopletInstanceData current = (CopletInstanceData) i.next();
                        Event event = new CopletJXPathEvent(current, path, value);
                        publisher.publish(event);
                    }
                }
            }
        }
    }
View Full Code Here

     */
    public void process(EventAspectContext context, PortalService service) {
        final Request request = ObjectModelHelper.getRequest(context.getObjectModel());
        String[] values = request.getParameterValues(this.getRequestParameterName());
        if (values != null) {
            final Publisher publisher = context.getEventPublisher();
            for (int i = 0; i < values.length; i++) {
                // first try to make an event out of the value of the parameter
                final String value = values[i];
                Event e = null;
                try {
                    e = context.getEventConverter().decode(value);
                    if (null != e) {
                        publisher.publish(e);
                    }
                } catch (Exception ignore) {
                    // ignroe it
                }
                // the event could not be generated, so try different approach
View Full Code Here

        EventConverter converter = null;
        PortalService service = null;
        try {
            service = (PortalService)this.manager.lookup(PortalService.ROLE);
            converter = (EventConverter) this.manager.lookup(EventConverter.ROLE);
            Publisher publisher = this.getPublisher();

            converter.start();
           
            // Invoke aspects
            context.setEventPublisher( publisher );
View Full Code Here

  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);
                    }
                }
View Full Code Here

            // parameter name is path
            // parameter value is value
            // if the value is null or empty, the value is not set!
            final String[] names = parameters.getNames();
            if ( names != null ) {
                final Publisher publisher = portalService.getComponentManager().getEventManager().getPublisher();
                for(int i=0; i<names.length; i++) {
                    final String path = names[i];
                    final String value = parameters.getParameter(path, null );
                    if ( value != null && value.trim().length() > 0 ) {
                        final Event event = new CopletJXPathEvent(portalService.getComponentManager().getProfileManager().getCopletInstanceData(copletId),
                                path,
                                value);
                        publisher.publish(event);
                    }
                }
            }
           
            return EMPTY_MAP;
View Full Code Here

  implements EventAspect, ThreadSafe {

    protected void process(EventAspectContext context, Request request, String parameterName) {
        String[] values = request.getParameterValues( parameterName );
        if ( values != null ) {
            final Publisher publisher = context.getEventPublisher();
            for(int i=0; i<values.length; i++) {
                final String current = values[i];
                final Event e = context.getEventConverter().decode(current);
                if ( null != e) {
                    publisher.publish(e);
                }
            }
        } else {
            List list = (List) request.getAttribute("org.apache.cocoon.portal." + parameterName);
            if (list != null) {
                Event[] events = (Event[]) list.toArray(new Event[0]);
                final Publisher publisher = context.getEventPublisher();
                for (int i = 0; i < events.length; i++) {
                    publisher.publish(events[i]);
                }
            }
        }
    }
View Full Code Here

  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 );
                    }
                }
View Full Code Here

  implements EventAspect, ThreadSafe {

    protected void process(EventAspectContext context, Request request, String parameterName) {
        String[] values = request.getParameterValues( parameterName );
        if ( values != null ) {
            final Publisher publisher = context.getEventPublisher();
            for(int i=0; i<values.length; i++) {
                final String current = values[i];
                final Event e = context.getEventConverter().decode(current);
                if ( null != e) {
                    publisher.publish(e);
                }
            }
        }
    }
View Full Code Here

     */
    public void process(EventAspectContext context, PortalService service) {
        final Request request = ObjectModelHelper.getRequest(context.getObjectModel());
        String[] values = request.getParameterValues(this.getRequestParameterName());
        if (values != null) {
            final Publisher publisher = context.getEventPublisher();
            for (int i = 0; i < values.length; i++) {
                // first try to make an event out of the value of the parameter
                final String value = values[i];
                Event e = null;
                try {
                    e = context.getEventConverter().decode(value);
                    if (null != e) {
                        publisher.publish(e);
                    }
                } catch (Exception ignore) {
                }
                // the event could not be generated, so try different approach
                if (e == null) {
View Full Code Here

TOP

Related Classes of org.apache.cocoon.portal.event.Publisher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.