List of usage examples for com.liferay.portal.kernel.settings LocalizedValuesMap getValues
public Map<Locale, String> getValues()
From source file:com.liferay.calendar.search.test.CalendarBookingIndexerTest.java
License:Open Source License
protected void addCalendarBooking(LocalizedValuesMap titleMap) { try {/*from w w w . j a v a2 s. com*/ ServiceContext serviceContext = new ServiceContext(); CalendarResource calendarResource = CalendarResourceUtil.getGroupCalendarResource(_group.getGroupId(), serviceContext); Calendar calendar = CalendarLocalServiceUtil.addCalendar(_user.getUserId(), _group.getGroupId(), calendarResource.getCalendarResourceId(), RandomTestUtil.randomLocaleStringMap(), RandomTestUtil.randomLocaleStringMap(), StringPool.UTC, RandomTestUtil.randomInt(0, 255), false, false, false, serviceContext); long startTime = DateUtil.newTime() + RandomTestUtil.randomInt(); long endTime = startTime + Time.HOUR; HashMap<Locale, String> hashMap = new HashMap<>(); CalendarBookingLocalServiceUtil.addCalendarBooking(_user.getUserId(), calendar.getCalendarId(), new long[0], CalendarBookingConstants.PARENT_CALENDAR_BOOKING_ID_DEFAULT, 0, titleMap.getValues(), hashMap, null, startTime, endTime, false, null, 0, "email", 0, "email", serviceContext); } catch (PortalException pe) { throw new RuntimeException(pe); } }
From source file:com.liferay.calendar.search.test.CalendarFixture.java
License:Open Source License
public Calendar addCalendar(LocalizedValuesMap nameLocalizedValuesMap, LocalizedValuesMap descriptionLocalizedValuesMap, ServiceContext serviceContext) throws PortalException { CalendarResource calendarResource = CalendarResourceUtil.getGroupCalendarResource(_group.getGroupId(), serviceContext);//from w w w . ja va 2 s . co m Calendar calendar = _calendarLocalService.addCalendar(serviceContext.getUserId(), _group.getGroupId(), calendarResource.getCalendarResourceId(), nameLocalizedValuesMap.getValues(), descriptionLocalizedValuesMap.getValues(), StringPool.UTC, RandomTestUtil.randomInt(0, 255), false, false, false, serviceContext); _calendars.add(calendar); return calendar; }
From source file:com.liferay.calendar.search.test.CalendarFixture.java
License:Open Source License
public CalendarBooking addCalendarBooking(LocalizedValuesMap titleLocalizedValuesMap, Calendar calendar, ServiceContext serviceContext) throws PortalException { long startTime = DateUtil.newTime() + RandomTestUtil.randomInt(); long endTime = startTime + Time.HOUR; CalendarBooking calendarBooking = _calendarBookingLocalService.addCalendarBooking( serviceContext.getUserId(), calendar.getCalendarId(), new long[0], CalendarBookingConstants.PARENT_CALENDAR_BOOKING_ID_DEFAULT, 0, titleLocalizedValuesMap.getValues(), Collections.emptyMap(), null, startTime, endTime, false, null, 0, "email", 0, "email", serviceContext);/*from ww w .j ava 2 s .c o m*/ _calendarBookings.add(calendarBooking); return calendarBooking; }