Class AgendaEventSplitRest

java.lang.Object
org.exoplatform.agenda.rest.AgendaEventSplitRest

@RestController public class AgendaEventSplitRest extends Object
Splits a recurring event at one of its dates: a "this and upcoming" change.

No rule lives here. Who may split, what the continuation keeps and which answers start over are AgendaEventService's; this resource reads the user from the session, turns the body into the split the Service takes and maps its refusals to statuses.

It answers the continuation's identifier, which the event page then reads from the event resource as it reads any event: that read builds its identities through social's EntityBuilder, which needs the JAX-RS request context a Spring MVC request does not have.

A refusal writes its own body, {"message": "<code>"}, as AgendaEventAttendeeRest does, with the date that blocks when a limit is below the Yes answers of one of the series' dates. No exception's text is ever a body: it goes to the log.

  • Constructor Summary

    Constructors
    Constructor
    Description
    AgendaEventSplitRest(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.agenda.service.AgendaEventService agendaEventService, org.exoplatform.agenda.service.AgendaEventAttendeeService agendaEventAttendeeService)
    Builds the resource.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<Object>
    splitEvent(jakarta.servlet.http.HttpServletRequest request, long eventId, String timeZoneId, boolean confirmClose, org.exoplatform.agenda.rest.model.EventSplitEntity splitEntity)
    Splits a recurring event at one of its dates.
    org.springframework.http.ResponseEntity<Object>
    unreadableBody(org.springframework.http.converter.HttpMessageNotReadableException e)
    A body that cannot be read as a change is refused with a code, never with the parser's text.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AgendaEventSplitRest

      @Autowired public AgendaEventSplitRest(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.agenda.service.AgendaEventService agendaEventService, org.exoplatform.agenda.service.AgendaEventAttendeeService agendaEventAttendeeService)
      Builds the resource.
      Parameters:
      identityManager - resolves the user of the session and the people the change adds or removes
      agendaEventService - holder of every rule of the split
      agendaEventAttendeeService - reads the series' attendees, among whom the people removed are found
  • Method Details

    • splitEvent

      @PostMapping(path="events/{eventId}/split", consumes="application/json", produces="application/json") @Secured("users") public org.springframework.http.ResponseEntity<Object> splitEvent(jakarta.servlet.http.HttpServletRequest request, @PathVariable("eventId") long eventId, @RequestParam(name="timeZoneId",required=false) String timeZoneId, @RequestParam(name="confirmClose",defaultValue="false") boolean confirmClose, @RequestBody(required=false) org.exoplatform.agenda.rest.model.EventSplitEntity splitEntity)
      Splits a recurring event at one of its dates.
      Parameters:
      request - the authenticated request
      eventId - technical identifier of the recurring event
      timeZoneId - the zone the user read the event in
      confirmClose - whether the user confirmed closing the event while people wait for a seat
      splitEntity - the change
      Returns:
      {"id": <the continuing series>}, or a refusal
    • unreadableBody

      @ExceptionHandler(org.springframework.http.converter.HttpMessageNotReadableException.class) public org.springframework.http.ResponseEntity<Object> unreadableBody(org.springframework.http.converter.HttpMessageNotReadableException e)
      A body that cannot be read as a change is refused with a code, never with the parser's text.
      Parameters:
      e - the parser's failure
      Returns:
      the refusal