/**
  * @EXT\Route(
  *     "/announcement/list/aggregate/{aggregateId}/page/{page}",
  *     name = "claro_announcements_list",
  *     defaults={"page"=1}
  * )
  * @EXT\Method("GET")
  * @EXT\ParamConverter(
  *      "aggregate",
  *      class="ClarolineAnnouncementBundle:AnnouncementAggregate",
  *      options={"id" = "aggregateId", "strictId" = true}
  * )
  * @EXT\Template("ClarolineAnnouncementBundle::announcementsList.html.twig")
  *
  * @param AnnouncementAggregate $aggregate
  * @param $page
  *
  * @return Response
  */
 public function announcementsListAction(AnnouncementAggregate $aggregate, $page = 1)
 {
     $collection = new ResourceCollection([$aggregate->getResourceNode()]);
     try {
         $this->checkAccess('EDIT', $aggregate);
         $announcements = $this->announcementManager->getAllAnnouncementsByAggregate($aggregate);
     } catch (AccessDeniedException $e) {
         $this->checkAccess('OPEN', $aggregate);
         $announcements = $this->announcementManager->getVisibleAnnouncementsByAggregate($aggregate);
     }
     $pager = $this->pagerFactory->createPagerFromArray($announcements, $page, 5);
     return ['_resource' => $aggregate, 'announcements' => $pager, 'resourceCollection' => $collection, 'workspace' => $aggregate->getResourceNode()->getWorkspace()];
 }
 /**
  * @param AnnouncementAggregate $aggregate
  * @param Announcement          $announcement
  */
 public function __construct(AnnouncementAggregate $aggregate, Announcement $announcement)
 {
     $details = array('announcement' => array('aggregate' => $aggregate->getId(), 'title' => $announcement->getTitle(), 'announcer' => $announcement->getAnnouncer()));
     parent::__construct($aggregate->getResourceNode(), $details);
 }