protected void addCalendarBooking(
      String uuid,
      long calendarBookingId,
      long companyId,
      long groupId,
      long userId,
      String userName,
      Date createDate,
      Date modifiedDate,
      long calendarId,
      long calendarResourceId,
      String title,
      String description,
      String location,
      long startTime,
      long endTime,
      boolean allDay,
      String recurrence,
      int firstReminder,
      NotificationType firstReminderType,
      int secondReminder,
      NotificationType secondReminderType)
      throws SystemException {

    CalendarBooking calendarBooking = calendarBookingPersistence.create(calendarBookingId);

    calendarBooking.setUuid(uuid);
    calendarBooking.setCompanyId(companyId);
    calendarBooking.setGroupId(groupId);
    calendarBooking.setUserId(userId);
    calendarBooking.setUserName(userName);
    calendarBooking.setCreateDate(createDate);
    calendarBooking.setModifiedDate(modifiedDate);
    calendarBooking.setCalendarId(calendarId);
    calendarBooking.setCalendarResourceId(calendarResourceId);
    calendarBooking.setParentCalendarBookingId(calendarBookingId);
    calendarBooking.setTitle(title);
    calendarBooking.setDescription(description);
    calendarBooking.setLocation(location);
    calendarBooking.setStartTime(startTime);
    calendarBooking.setEndTime(endTime);
    calendarBooking.setAllDay(allDay);
    calendarBooking.setRecurrence(recurrence);
    calendarBooking.setFirstReminder(firstReminder);
    calendarBooking.setFirstReminderType(firstReminderType.toString());
    calendarBooking.setSecondReminder(secondReminder);
    calendarBooking.setSecondReminderType(secondReminderType.toString());
    calendarBooking.setStatus(WorkflowConstants.STATUS_APPROVED);
    calendarBooking.setStatusByUserId(userId);
    calendarBooking.setStatusByUserName(userName);
    calendarBooking.setStatusDate(createDate);

    calendarBookingPersistence.update(calendarBooking);
  }
Пример #2
0
  protected CalendarBooking filterCalendarBooking(CalendarBooking calendarBooking)
      throws PortalException, SystemException {

    if (!CalendarPermission.contains(
        getPermissionChecker(), calendarBooking.getCalendarId(), ActionKeys.VIEW_BOOKING_DETAILS)) {

      calendarBooking.setTitle(StringPool.BLANK);
      calendarBooking.setDescription(StringPool.BLANK);
      calendarBooking.setLocation(StringPool.BLANK);
    }

    return calendarBooking;
  }
Пример #3
0
  protected static CalendarBooking filterCalendarBooking(
      CalendarBooking calendarBooking, PermissionChecker permissionChecker)
      throws PortalException, SystemException {

    if (!CalendarPermission.contains(
        permissionChecker, calendarBooking.getCalendarId(), ACTION_VIEW_BOOKING_DETAILS)) {

      calendarBooking.setTitle(StringPool.BLANK);
      calendarBooking.setDescription(StringPool.BLANK);
      calendarBooking.setLocation(StringPool.BLANK);
    }

    return calendarBooking;
  }
  /**
   * Converts the soap model instance into a normal model instance.
   *
   * @param soapModel the soap model instance to convert
   * @return the normal model instance
   */
  public static CalendarBooking toModel(CalendarBookingSoap soapModel) {
    if (soapModel == null) {
      return null;
    }

    CalendarBooking model = new CalendarBookingImpl();

    model.setUuid(soapModel.getUuid());
    model.setCalendarBookingId(soapModel.getCalendarBookingId());
    model.setGroupId(soapModel.getGroupId());
    model.setCompanyId(soapModel.getCompanyId());
    model.setUserId(soapModel.getUserId());
    model.setUserName(soapModel.getUserName());
    model.setCreateDate(soapModel.getCreateDate());
    model.setModifiedDate(soapModel.getModifiedDate());
    model.setCalendarId(soapModel.getCalendarId());
    model.setCalendarResourceId(soapModel.getCalendarResourceId());
    model.setParentCalendarBookingId(soapModel.getParentCalendarBookingId());
    model.setTitle(soapModel.getTitle());
    model.setDescription(soapModel.getDescription());
    model.setLocation(soapModel.getLocation());
    model.setStartTime(soapModel.getStartTime());
    model.setEndTime(soapModel.getEndTime());
    model.setAllDay(soapModel.getAllDay());
    model.setRecurrence(soapModel.getRecurrence());
    model.setFirstReminder(soapModel.getFirstReminder());
    model.setFirstReminderType(soapModel.getFirstReminderType());
    model.setSecondReminder(soapModel.getSecondReminder());
    model.setSecondReminderType(soapModel.getSecondReminderType());
    model.setStatus(soapModel.getStatus());
    model.setStatusByUserId(soapModel.getStatusByUserId());
    model.setStatusByUserName(soapModel.getStatusByUserName());
    model.setStatusDate(soapModel.getStatusDate());

    return model;
  }