示例#1
1
  public CalendarBooking getCalendarBooking(long calendarId, long parentCalendarBookingId)
      throws PortalException, SystemException {

    CalendarPermission.check(getPermissionChecker(), calendarId, ActionKeys.MANAGE_BOOKINGS);

    return calendarBookingLocalService.getCalendarBooking(calendarId, parentCalendarBookingId);
  }
  @Override
  public Calendar getCalendar(long calendarId) throws PortalException, SystemException {

    CalendarPermission.check(getPermissionChecker(), calendarId, ActionKeys.VIEW);

    return calendarLocalService.getCalendar(calendarId);
  }
示例#3
0
  public CalendarBooking addCalendarBooking(
      long calendarId,
      Map<Locale, String> titleMap,
      Map<Locale, String> descriptionMap,
      String location,
      Date startDate,
      Date endDate,
      boolean allDay,
      String recurrence,
      int firstReminder,
      int secondReminder,
      ServiceContext serviceContext)
      throws PortalException, SystemException {

    CalendarPermission.check(getPermissionChecker(), calendarId, ActionKeys.MANAGE_BOOKINGS);

    return calendarBookingLocalService.addCalendarBooking(
        getUserId(),
        calendarId,
        titleMap,
        descriptionMap,
        location,
        startDate,
        endDate,
        allDay,
        recurrence,
        firstReminder,
        secondReminder,
        serviceContext);
  }
  @Override
  public Calendar updateColor(long calendarId, int color, ServiceContext serviceContext)
      throws PortalException, SystemException {

    CalendarPermission.check(getPermissionChecker(), calendarId, ActionKeys.UPDATE);

    return calendarLocalService.updateColor(calendarId, color, serviceContext);
  }
示例#5
0
  public CalendarBooking deleteCalendarBooking(long calendarBookingId)
      throws PortalException, SystemException {

    CalendarBooking calendarBooking =
        calendarBookingPersistence.findByPrimaryKey(calendarBookingId);

    CalendarPermission.check(
        getPermissionChecker(), calendarBooking.getCalendarId(), ActionKeys.MANAGE_BOOKINGS);

    return calendarBookingLocalService.deleteCalendarBooking(calendarBookingId);
  }
示例#6
0
  public void invokeTransition(
      long calendarBookingId, String transitionName, ServiceContext serviceContext)
      throws PortalException, SystemException {

    CalendarBooking calendarBooking =
        calendarBookingPersistence.findByPrimaryKey(calendarBookingId);

    CalendarPermission.check(
        getPermissionChecker(), calendarBooking.getCalendarId(), ActionKeys.MANAGE_BOOKINGS);

    calendarBookingApprovalWorkflow.invokeTransition(
        getUserId(), calendarBookingId, transitionName, serviceContext);
  }
  @Override
  public Calendar fetchCalendar(long calendarId) throws PortalException, SystemException {

    Calendar calendar = calendarPersistence.fetchByPrimaryKey(calendarId);

    if (calendar == null) {
      return null;
    }

    CalendarPermission.check(getPermissionChecker(), calendar, ActionKeys.VIEW);

    return calendar;
  }
  @Override
  public Calendar updateCalendar(
      long calendarId,
      Map<Locale, String> nameMap,
      Map<Locale, String> descriptionMap,
      int color,
      ServiceContext serviceContext)
      throws PortalException, SystemException {

    CalendarPermission.check(getPermissionChecker(), calendarId, ActionKeys.UPDATE);

    return calendarLocalService.updateCalendar(
        calendarId, nameMap, descriptionMap, color, serviceContext);
  }