Package org.projectforge.plugins.teamcal.admin

Examples of org.projectforge.plugins.teamcal.admin.TeamCalDO


      }
      userXmlPreferencesDao.serialize(userPrefs, filter);
      return;
    } else if (obj instanceof TeamCalDO) {
      log.info("Migrating " + obj);
      final TeamCalDO cal = (TeamCalDO) obj;
      cal.setFullAccessUserIds(updateIds(xstreamSavingConverter, PFUserDO.class, cal.getFullAccessUserIds()));
      cal.setReadonlyAccessUserIds(updateIds(xstreamSavingConverter, PFUserDO.class, cal.getReadonlyAccessUserIds()));
      cal.setMinimalAccessUserIds(updateIds(xstreamSavingConverter, PFUserDO.class, cal.getMinimalAccessUserIds()));
      cal.setFullAccessGroupIds(updateIds(xstreamSavingConverter, GroupDO.class, cal.getFullAccessGroupIds()));
      cal.setReadonlyAccessGroupIds(updateIds(xstreamSavingConverter, GroupDO.class, cal.getReadonlyAccessGroupIds()));
      cal.setMinimalAccessGroupIds(updateIds(xstreamSavingConverter, GroupDO.class, cal.getMinimalAccessGroupIds()));
    }
  }
View Full Code Here


    if (filter instanceof TeamCalCalendarFilter) {
      final TemplateEntry activeTemplateEntry = ((TeamCalCalendarFilter) filter).getActiveTemplateEntry();
      if (activeTemplateEntry.getDefaultCalendarId() == null && activeTemplateEntry.getCalendars().size() > 0) {
        activeTemplateEntry.setDefaultCalendarId(activeTemplateEntry.getCalendars().get(0).getId());
      }
      final TeamCalDO calendar = teamCalDao.getById(activeTemplateEntry.getDefaultCalendarId());
      final TeamEventDO event = new TeamEventDO();
      event.setAllDay(range.isAllDay());
      event.setStartDate(new Timestamp(DateHelper.getDateTimeAsMillis(range.getStart()))).setEndDate(
          new Timestamp(DateHelper.getDateTimeAsMillis(range.getEnd())));
      event.setCalendar(calendar);
View Full Code Here

      for (final Integer calendarId : filter.getTeamCals()) {
        final TeamEventSubscription eventSubscription = subscriptions.get(calendarId);
        if (eventSubscription == null) {
          continue;
        }
        final TeamCalDO calendar = TeamCalCache.getInstance().getCalendar(calendarId);
        if (getTeamCalRight().getAccessType(calendar, userId).isIn(TeamCalAccessType.FULL, TeamCalAccessType.READONLY,
            TeamCalAccessType.MINIMAL) == false) {
          continue;
        }
        teamCals.add(calendarId);
      }
    }
    if (filter.getTeamCalId() != null) {
      final TeamEventSubscription eventSubscription = subscriptions.get(filter.getTeamCalId());
      if (eventSubscription != null) {
        final TeamCalDO cal = TeamCalCache.getInstance().getCalendar(filter.getTeamCalId());
        if (getTeamCalRight().getAccessType(cal, userId)
            .isIn(TeamCalAccessType.FULL, TeamCalAccessType.READONLY, TeamCalAccessType.MINIMAL) == true) {
          teamCals.add(filter.getTeamCalId());
        }
      }
    }
    if (teamCals != null) {
      for (final Integer calendarId : teamCals) {
        final TeamEventSubscription eventSubscription = subscriptions.get(calendarId);
        if (eventSubscription != null) {
          final List<TeamEventDO> recurrenceEvents = eventSubscription.getRecurrenceEvents();
          if (recurrenceEvents != null && recurrenceEvents.size() > 0) {
            for (final TeamEventDO event : recurrenceEvents) {
              final TeamCalDO calendar = TeamCalCache.getInstance().getCalendar(calendarId);
              if (getTeamCalRight().getAccessType(calendar, userId) == TeamCalAccessType.MINIMAL) {
                result.add(event.createMinimalCopy());
              } else {
                result.add(event);
              }
View Full Code Here

    return result;
  }

  private TeamCalAccessType getAccessType(final Integer calendarId, final Integer userId)
  {
    final TeamCalDO cal = TeamCalCache.getInstance().getCalendar(calendarId);
    return getTeamCalRight().getAccessType(cal, userId);
  }
View Full Code Here

  public List<TeamCalDO> getCalendars()
  {
    final List<TeamCalDO> result = new ArrayList<TeamCalDO>();
    final TeamCalCache cache = TeamCalCache.getInstance();
    for (final TemplateCalendarProperties props : this.calendarProperties) {
      final TeamCalDO cal = cache.getCalendar(props.getCalId());
      if (cal != null) {
        result.add(cal);
      } else {
        log.error("Oups, calendar with id " + props.getCalId() + " not found in TeamCalCache.");
      }
View Full Code Here

    if (visibleCalendarIds == null) {
      // Nothing to do.
      return;
    }
    for (final Integer calId : visibleCalendarIds) {
      final TeamCalDO teamCalDO = TeamCalCache.getInstance().getCalendar(calId);
      if (teamCalDO == null || teamCalDO.isExternalSubscription() == false) {
        // Nothing to do.
        continue;
      }
      TeamEventExternalSubscriptionCache.instance().updateCache(teamCalDao, teamCalDO, true);
    }
View Full Code Here

   * @param teamCalendarId If null, then team calendar will be set to null;
   * @see BaseDao#getOrLoad(Integer)
   */
  public void setCalendar(final TeamEventDO teamEvent, final Integer teamCalendarId)
  {
    final TeamCalDO teamCal = teamCalDao.getOrLoad(teamCalendarId);
    teamEvent.setCalendar(teamCal);
  }
View Full Code Here

    super.init();

    final Recur recur = data.getRecurrenceObject();
    recurrenceData = new TeamEventRecurrenceData(recur, PFUserContext.getTimeZone());
    gridBuilder.newSplitPanel(GridSize.COL50);
    final TeamCalDO teamCal = data.getCalendar();
    // setting access view
    if (isNew() == true || teamCal == null || teamCal.getOwner() == null) {
      access = true;
    } else {
      if (right.hasUpdateAccess(getUser(), data, data) == true) {
        access = true;
      } else {
View Full Code Here

   * @param fieldSet
   */
  private void initTeamCalPicker(final FieldsetPanel fieldSet)
  {
    if (access == false) {
      final TeamCalDO calendar = data.getCalendar();
      final Label teamCalTitle = new Label(fieldSet.newChildId(), calendar != null ? new PropertyModel<String>(data.getCalendar(), "title")
          : "");
      fieldSet.add(teamCalTitle);
    } else {
      final List<TeamCalDO> list = teamCalDao.getAllCalendarsWithFullAccess();
View Full Code Here

       */
      @Override
      public void populateItem(final Item<ICellPopulator<TeamEventDO>> item, final String componentId, final IModel<TeamEventDO> rowModel)
      {
        final TeamEventDO teamEvent = rowModel.getObject();
        final TeamCalDO calendar = teamEvent.getCalendar();
        item.add(new ListSelectActionPanel(componentId, rowModel, TeamEventEditPage.class, teamEvent.getId(), returnToPage,
            calendar != null ? calendar.getTitle() : ""));
        cellItemListener.populateItem(item, componentId, rowModel);
        addRowClick(item);
      }
    });

View Full Code Here

TOP

Related Classes of org.projectforge.plugins.teamcal.admin.TeamCalDO

Copyright © 2018 www.massapicom. 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.