Examples of CalendarEntry


Examples of com.saasovation.collaboration.domain.model.calendar.CalendarEntry

        assertEquals("A changed calendar entry location.", changedCalendarEntry.location());
    }

    public void testRescheduleCalendarEntry() throws Exception {

        CalendarEntry calendarEntry = this.calendarEntryAggregate();

        DomainRegistry.calendarEntryRepository().save(calendarEntry);

        Date now = new Date();
        Date nextWeek = new Date(now.getTime() + (86400000L * 7L));
        Date nextWeekAndOneHour = new Date(nextWeek.getTime() + (1000 * 60 * 60));

        calendarEntryApplicationService
            .rescheduleCalendarEntry(
                    calendarEntry.tenant().id(),
                    calendarEntry.calendarEntryId().id(),
                    "A changed description.",
                    "A changed location.",
                    nextWeek,
                    nextWeekAndOneHour,
                    "DoesNotRepeat",
                    nextWeekAndOneHour,
                    "Hours",
                    8);

        CalendarEntry changedCalendarEntry =
                DomainRegistry
                    .calendarEntryRepository()
                    .calendarEntryOfId(
                            calendarEntry.tenant(),
                            calendarEntry.calendarEntryId());

        assertNotNull(changedCalendarEntry);
        assertEquals("A changed description.", changedCalendarEntry.description());
        assertEquals("A changed location.", changedCalendarEntry.location());
        assertEquals(nextWeek, changedCalendarEntry.timeSpan().begins());
        assertEquals(nextWeekAndOneHour, changedCalendarEntry.timeSpan().ends());
        assertTrue(changedCalendarEntry.repetition().repeats().isDoesNotRepeat());
        assertTrue(changedCalendarEntry.alarm().alarmUnitsType().isHours());
        assertEquals(8, changedCalendarEntry.alarm().alarmUnits());
    }
View Full Code Here

Examples of com.saasovation.collaboration.domain.model.calendar.CalendarEntry

        assertEquals(8, changedCalendarEntry.alarm().alarmUnits());
    }

    public void testUninviteCalendarEntryParticipant() throws Exception {

        CalendarEntry calendarEntry = this.calendarEntryAggregate();

        DomainRegistry.calendarEntryRepository().save(calendarEntry);

        Set<String> invitees = new HashSet<String>(0);
        invitees.add("participant1");
        invitees.add("participant2");
        invitees.add("participant3");

        calendarEntryApplicationService
            .inviteCalendarEntryParticipant(
                    calendarEntry.tenant().id(),
                    calendarEntry.calendarEntryId().id(),
                    invitees);

        Set<String> uninvitees = new HashSet<String>(invitees);
        assertTrue(uninvitees.remove("participant2"));

        calendarEntryApplicationService
            .uninviteCalendarEntryParticipant(
                calendarEntry.tenant().id(),
                calendarEntry.calendarEntryId().id(),
                uninvitees);

        CalendarEntry changedCalendarEntry =
                DomainRegistry
                    .calendarEntryRepository()
                    .calendarEntryOfId(
                            calendarEntry.tenant(),
                            calendarEntry.calendarEntryId());

        assertNotNull(changedCalendarEntry);
        assertEquals(1, changedCalendarEntry.allInvitees().size());
        assertEquals("participant2", changedCalendarEntry.allInvitees().iterator().next().identity());
    }
View Full Code Here

Examples of com.saasovation.collaboration.domain.model.calendar.CalendarEntry

                    "Hours",
                    8,
                    new HashSet<String>(0),
                    result);

        CalendarEntry calendarEntry =
                DomainRegistry
                    .calendarEntryRepository()
                    .calendarEntryOfId(
                            calendar.tenant(),
                            new CalendarEntryId(calendarEntryId));

        assertNotNull(calendarEntry);
        assertEquals("My annual checkup appointment", calendarEntry.description());
        assertEquals("Family Health Offices", calendarEntry.location());
        assertEquals("owner1", calendarEntry.owner().identity());
    }
View Full Code Here

Examples of com.saasovation.collaboration.domain.model.calendar.CalendarEntry

        super();
    }

    public void testCalendarEntryDataOfId() throws Exception {

        CalendarEntry calendarEntry = this.calendarEntryAggregate();

        DomainRegistry.calendarEntryRepository().save(calendarEntry);

        CalendarEntryData calendarEntryData =
                calendarEntryQueryService
                    .calendarEntryDataOfId(
                            calendarEntry.tenant().id(),
                            calendarEntry.calendarEntryId().id());

        assertNotNull(calendarEntryData);
        assertNotNull(calendarEntryData.getAlarmAlarmUnitsType());
        assertNotNull(calendarEntryData.getCalendarEntryId());
        assertNotNull(calendarEntryData.getCalendarId());
        assertEquals(calendarEntry.calendarId().id(), calendarEntryData.getCalendarId());
        assertNotNull(calendarEntryData.getDescription());
        assertNotNull(calendarEntryData.getLocation());
        assertNotNull(calendarEntryData.getOwnerEmailAddress());
        assertNotNull(calendarEntryData.getOwnerIdentity());
        assertNotNull(calendarEntryData.getOwnerName());
        assertNotNull(calendarEntryData.getRepetitionType());
        assertEquals(calendarEntry.tenant().id(), calendarEntryData.getTenantId());
        assertNotNull(calendarEntryData.getInvitees());
        assertTrue(calendarEntryData.getInvitees().isEmpty());
    }
View Full Code Here

Examples of com.saasovation.collaboration.domain.model.calendar.CalendarEntry

        super();
    }

    public void testChangeCalendarEntryDescription() throws Exception {

        CalendarEntry calendarEntry = this.calendarEntryAggregate();

        DomainRegistry.calendarEntryRepository().save(calendarEntry);

        calendarEntryApplicationService
            .changeCalendarEntryDescription(
                    calendarEntry.tenant().id(),
                    calendarEntry.calendarEntryId().id(),
                    "A changed calendar entry description.");

        CalendarEntry changedCalendarEntry =
                DomainRegistry
                    .calendarEntryRepository()
                    .calendarEntryOfId(
                            calendarEntry.tenant(),
                            calendarEntry.calendarEntryId());

        assertNotNull(changedCalendarEntry);
        assertEquals("A changed calendar entry description.", changedCalendarEntry.description());
    }
View Full Code Here

Examples of com.saasovation.collaboration.domain.model.calendar.CalendarEntry

        assertEquals("A changed calendar entry description.", changedCalendarEntry.description());
    }

    public void testInviteCalendarEntryParticipant() throws Exception {

        CalendarEntry calendarEntry = this.calendarEntryAggregate();

        DomainRegistry.calendarEntryRepository().save(calendarEntry);

        Set<String> invitees = new HashSet<String>(0);
        invitees.add("participant1");
        invitees.add("participant2");
        invitees.add("participant3");

        calendarEntryApplicationService
            .inviteCalendarEntryParticipant(
                    calendarEntry.tenant().id(),
                    calendarEntry.calendarEntryId().id(),
                    invitees);

        CalendarEntry changedCalendarEntry =
                DomainRegistry
                    .calendarEntryRepository()
                    .calendarEntryOfId(
                            calendarEntry.tenant(),
                            calendarEntry.calendarEntryId());

        assertNotNull(changedCalendarEntry);
        assertEquals(3, changedCalendarEntry.allInvitees().size());

        for (Participant invitee : changedCalendarEntry.allInvitees()) {
            assertTrue(invitee.identity().equals("participant1") ||
                       invitee.identity().equals("participant2") ||
                       invitee.identity().equals("participant3"));
        }
    }
View Full Code Here

Examples of com.vaadin.terminal.gwt.client.ui.CalendarEntry

    final List entries = entrySource.getEntries(date,
        DateTimeService.RESOLUTION_DAY);
    int currentCol = 1;
    for (final Iterator it = entries.iterator(); it.hasNext();) {
      final CalendarEntry entry = (CalendarEntry) it.next();
      int start = 0;
      int hours = 24;
      if (!entry.isNotime()) {
        Date d = entry.getStart();
        // TODO consider month&year as well
        start = (d.getDate() < date.getDate() ? 0 : d.getHours());
        d = entry.getEnd();
        hours = (d.getDate() > date.getDate() ? 24 : d.getHours())
            - start;
        if (hours < 1) {
          // We can't draw entries smaller than
          // one
          hours = 1;
        }
      }
      int col = currentCol;
      if (col > 1) {
        while (!hourTable.isCellPresent(start, col - 1)) {
          col--;
        }
      }
      hourTable.setHTML(start, col, "<span>"
          + (entry.getTitle() != null ? entry.getTitle() : "&nbsp")
          + "</span>");
      hourTable.getFlexCellFormatter().setRowSpan(start, col, hours);
      hourTable.getFlexCellFormatter().setStyleName(start, col,
          CLASSNAME + "-entry");
      final String sn = entry.getStyleName();
      if (sn != null && !sn.equals("")) {
        hourTable.getFlexCellFormatter().addStyleName(start, col,
            CLASSNAME + "-" + entry.getStyleName());
      }
      final Element el = hourTable.getFlexCellFormatter().getElement(
          start, col);

      String tooltip;
      if (DateTimeService.isSameDay(entry.getStart(), entry.getEnd())) {
        tooltip = (start < 10 ? "0" : "") + start + ":00";
        if (dts.isTwelveHourClock()) {
          final String ampm = (start < 12 ? "am" : "pm");
          tooltip = (start <= 12 ? start : start - 12) + ":00 "
              + ampm;

        }
        tooltip += " (" + hours + "h) ";
        if (entry.getTitle() != null) {
          tooltip += entry.getTitle() + "\n ";
        }
      } else {
        tooltip = entry.getStringForDate(entry.getEnd()) + "\n ";
      }
      if (entry.getDescription() != null) {
        tooltip += "\"" + entry.getDescription() + "\"";
      }
      DOM.setElementProperty(el, "title", tooltip);

      currentCol++;
    }
View Full Code Here

Examples of com.vaadin.terminal.gwt.client.ui.CalendarEntry

        endDate = (Date) startDate.clone();
      }
      final String title = item.getStringAttribute("title");
      final String desc = item.getStringAttribute("description");
      final boolean notime = item.getBooleanAttribute("notime");
      final CalendarEntry entry = new CalendarEntry(styleName, startDate,
          endDate, title, desc, notime);

      // TODO should remove+readd if the same entry (id) is
      // added again

      for (final Date d = new Date(entry.getStart().getTime()); d
          .getYear() <= entry.getEnd().getYear()
          && d.getMonth() <= entry.getEnd().getYear()
          && d.getDate() <= entry.getEnd().getDate(); d.setTime(d
          .getTime() + 86400000)) {
        final String key = d.getYear() + "" + d.getMonth() + ""
            + d.getDate();
        ArrayList l = (ArrayList) dates.get(key);
        if (l == null) {
View Full Code Here

Examples of com.vaadin.terminal.gwt.client.ui.CalendarEntry

      if (entries == null) {
        return res;
      }
      for (final Iterator it = entries.iterator(); it.hasNext();) {
        final CalendarEntry item = (CalendarEntry) it.next();
        if (DateTimeService.isInRange(date, item.getStart(), item
            .getEnd(), resolution)) {
          res.add(item);
        }
      }
View Full Code Here

Examples of gov.nysenate.openleg.model.CalendarEntry

        // New section entry list!
        List<CalendarEntry> calendarEntries = section.getCalendarEntries();

        // Loop through the entries
        for(XMLCalno xmlCalno:xmlSection.getCalnos().getCalno()) {
            CalendarEntry cEntry = null;
            try  {
                // Add each entry with a parent reference
                cEntry = parseCalno(storage, section.getId(), xmlCalno, supplemental.getCalendar().getSession());
                cEntry.setSection(section);

                // But don't add things twice
                if (!calendarEntries.contains(cEntry))
                    calendarEntries.add(cEntry);
            }
            catch (Exception e) {
                if (cEntry != null)
                    logger.error("Error adding CalenderEntry: " + cEntry.getOid(), e);
                else {
                    logger.error("Error adding CalenderEntry: ", e);
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.