public static com.liferay.calendar.model.CalendarSoap addCalendar(
      long groupId,
      long calendarResourceId,
      java.lang.String[] nameMapLanguageIds,
      java.lang.String[] nameMapValues,
      java.lang.String[] descriptionMapLanguageIds,
      java.lang.String[] descriptionMapValues,
      int color,
      boolean defaultCalendar,
      com.liferay.portal.service.ServiceContext serviceContext)
      throws RemoteException {
    try {
      Map<Locale, String> nameMap =
          LocalizationUtil.getLocalizationMap(nameMapLanguageIds, nameMapValues);
      Map<Locale, String> descriptionMap =
          LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds, descriptionMapValues);

      com.liferay.calendar.model.Calendar returnValue =
          CalendarServiceUtil.addCalendar(
              groupId,
              calendarResourceId,
              nameMap,
              descriptionMap,
              color,
              defaultCalendar,
              serviceContext);

      return com.liferay.calendar.model.CalendarSoap.toSoapModel(returnValue);
    } catch (Exception e) {
      _log.error(e, e);

      throw new RemoteException(e.getMessage());
    }
  }
  public static com.liferay.calendar.model.CalendarSoap[] search(
      long companyId,
      long[] groupIds,
      long[] calendarResourceIds,
      java.lang.String name,
      java.lang.String description,
      boolean andOperator,
      int start,
      int end,
      com.liferay.portal.kernel.util.OrderByComparator orderByComparator,
      java.lang.String actionId)
      throws RemoteException {
    try {
      java.util.List<com.liferay.calendar.model.Calendar> returnValue =
          CalendarServiceUtil.search(
              companyId,
              groupIds,
              calendarResourceIds,
              name,
              description,
              andOperator,
              start,
              end,
              orderByComparator,
              actionId);

      return com.liferay.calendar.model.CalendarSoap.toSoapModels(returnValue);
    } catch (Exception e) {
      _log.error(e, e);

      throw new RemoteException(e.getMessage());
    }
  }
  public static com.liferay.calendar.model.CalendarSoap getCalendar(long calendarId)
      throws RemoteException {
    try {
      com.liferay.calendar.model.Calendar returnValue = CalendarServiceUtil.getCalendar(calendarId);

      return com.liferay.calendar.model.CalendarSoap.toSoapModel(returnValue);
    } catch (Exception e) {
      _log.error(e, e);

      throw new RemoteException(e.getMessage());
    }
  }
  public static com.liferay.calendar.model.CalendarSoap updateColor(
      long calendarId, int color, com.liferay.portal.service.ServiceContext serviceContext)
      throws RemoteException {
    try {
      com.liferay.calendar.model.Calendar returnValue =
          CalendarServiceUtil.updateColor(calendarId, color, serviceContext);

      return com.liferay.calendar.model.CalendarSoap.toSoapModel(returnValue);
    } catch (Exception e) {
      _log.error(e, e);

      throw new RemoteException(e.getMessage());
    }
  }
  /**
   * 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 Calendar toModel(CalendarSoap soapModel) {
    if (soapModel == null) {
      return null;
    }

    Calendar model = new CalendarImpl();

    model.setUuid(soapModel.getUuid());
    model.setCalendarId(soapModel.getCalendarId());
    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.setResourceBlockId(soapModel.getResourceBlockId());
    model.setCalendarResourceId(soapModel.getCalendarResourceId());
    model.setName(soapModel.getName());
    model.setDescription(soapModel.getDescription());
    model.setColor(soapModel.getColor());
    model.setDefaultCalendar(soapModel.getDefaultCalendar());
    model.setEnableComments(soapModel.getEnableComments());
    model.setEnableRatings(soapModel.getEnableRatings());

    return model;
  }