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());
    }
  }
Esempio n. 2
0
  public static List<Calendar> getSelectedCalendars(long userId)
      throws PortalException, SystemException {

    ArrayList<Calendar> calendars = new ArrayList<Calendar>();

    String otherCalendarPreferences = "calendar-portlet-other-calendars";

    if (_calendarVersion == 0) {
      Portlet calendarPortlet = PortletLocalServiceUtil.getPortletById(PortletKeys.CALENDAR);

      String calendarVersionStr = calendarPortlet.getPluginPackage().getVersion();

      Version calendarVersion = Version.getInstance(calendarVersionStr);

      _calendarVersion = GetterUtil.getInteger(calendarVersion.getBuildNumber(), 1);
    }

    if (_calendarVersion < 10) {
      otherCalendarPreferences = "otherCalendars";
    }

    long[] calendarIds =
        GetterUtil.getLongValues(
            StringUtil.split(
                PortletPreferencesFactoryUtil.getPortalPreferences(userId, true)
                    .getValue(SessionClicks.class.getName(), otherCalendarPreferences)));

    for (long calendarId : calendarIds) {
      calendars.add(CalendarServiceUtil.getCalendar(calendarId));
    }

    return calendars;
  }
  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());
    }
  }
Esempio n. 5
0
  public static List<Calendar> getCalendarResourceCalendars(CalendarResource calendarResource)
      throws PortalException, SystemException {

    return CalendarServiceUtil.search(
        calendarResource.getCompanyId(),
        new long[] {calendarResource.getGroupId()},
        new long[] {calendarResource.getCalendarResourceId()},
        null,
        false,
        QueryUtil.ALL_POS,
        QueryUtil.ALL_POS,
        new CalendarNameComparator(true));
  }
  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());
    }
  }
  public static int searchCount(
      long companyId,
      long[] groupIds,
      long[] calendarResourceIds,
      java.lang.String keywords,
      boolean andOperator)
      throws RemoteException {
    try {
      int returnValue =
          CalendarServiceUtil.searchCount(
              companyId, groupIds, calendarResourceIds, keywords, andOperator);

      return returnValue;
    } catch (Exception e) {
      _log.error(e, e);

      throw new RemoteException(e.getMessage());
    }
  }