Class AgendaSpaceSubscriptionColorListener

java.lang.Object
org.exoplatform.agenda.listener.AgendaSpaceSubscriptionColorListener
All Implemented Interfaces:
org.exoplatform.services.listener.ListenerBase<org.exoplatform.agenda.model.Calendar,Object>

@Component public class AgendaSpaceSubscriptionColorListener extends Object implements org.exoplatform.services.listener.ListenerBase<org.exoplatform.agenda.model.Calendar,Object>
Keeps a space's subscribed calendars in the colour of the space's calendar (EXO-90373): a manager changing the colour in the space settings, or the space's calendar being created with one, recolours the events the space's subscriptions import. Glue only: the rule is the subscription service's.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Broadcast by AgendaCalendarStorage once a calendar row is created.
    static final String
    Broadcast by AgendaCalendarStorage once a calendar row is updated.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AgendaSpaceSubscriptionColorListener(org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.agenda.service.AgendaCalendarSubscriptionService subscriptionService)
    Builds the listener.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Registers the listener on the calendar creation and update events.
    void
    onEvent(org.exoplatform.services.listener.Event<org.exoplatform.agenda.model.Calendar,Object> event)
    Hands the saved calendar to the subscription service, unless it is itself a subscribed calendar: recolouring one broadcasts its update too.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.exoplatform.services.listener.ListenerBase

    getName
  • Field Details

    • CALENDAR_CREATED_EVENT

      public static final String CALENDAR_CREATED_EVENT
      Broadcast by AgendaCalendarStorage once a calendar row is created.
      See Also:
    • CALENDAR_UPDATED_EVENT

      public static final String CALENDAR_UPDATED_EVENT
      Broadcast by AgendaCalendarStorage once a calendar row is updated.
      See Also:
  • Constructor Details

    • AgendaSpaceSubscriptionColorListener

      @Autowired public AgendaSpaceSubscriptionColorListener(org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.agenda.service.AgendaCalendarSubscriptionService subscriptionService)
      Builds the listener.
      Parameters:
      listenerService - the platform event bus
      subscriptionService - the owner of calendar subscriptions
  • Method Details

    • init

      @PostConstruct public void init()
      Registers the listener on the calendar creation and update events.
    • onEvent

      public void onEvent(org.exoplatform.services.listener.Event<org.exoplatform.agenda.model.Calendar,Object> event)
      Hands the saved calendar to the subscription service, unless it is itself a subscribed calendar: recolouring one broadcasts its update too.
      Specified by:
      onEvent in interface org.exoplatform.services.listener.ListenerBase<org.exoplatform.agenda.model.Calendar,Object>
      Parameters:
      event - the event, whose source is the saved calendar