Exemple #1
0
 @Override
 public List<Event> getEvents(Resource resource) {
   // currently events are not cached in memory
   Resource reload = getResource(resource);
   if (reload == null) {
     return Collections.emptyList();
   }
   if (eventPersister == null) {
     throw new UnsupportedOperationException("Event are not available in preview mode");
   }
   return eventPersister.getEvents(reload);
 }
Exemple #2
0
  @Override
  public Event addEvent(
      Resource resource, String name, String description, String category, @Nullable Date date) {
    Event event = new Event(name, description, category);
    if (date != null) {
      event.setDate(date);
    }

    if (eventPersister != null) {
      eventPersister.saveEvent(resource, event);
    }
    return null;
  }
Exemple #3
0
 @Override
 public void deleteEvent(Event event) {
   if (eventPersister != null) {
     eventPersister.deleteEvent(event);
   }
 }